Discourse

Open-source community platform with dynamic trust levels, real-time chat, and a powerful plugin architecture for self-hosted forums.

47.4Kstars
8.9Kforks
GNU GPLv2
Ruby

Discourse is a 100% open-source community platform built for organizations that want complete ownership over their data and community infrastructure. Developed on Ruby on Rails with an Ember.js frontend, it replaces fragmented communication tools with a unified environment that handles threaded forum discussions, real-time chat, private messaging, and searchable knowledge bases in a single self-hosted installation.

At its core, Discourse is built around a trust level system that automatically promotes users based on observed engagement — posts read, time spent, contributions made — rather than requiring manual role assignment. This behavioral moderation model creates self-regulating communities where power users earn elevated capabilities organically, reducing administrative burden while improving community quality.

The platform ships with an extensible plugin architecture that allows teams to add AI-powered moderation, data exploration, calendar integrations, gamification, and OAuth providers without modifying core code. The Docker-based deployment model packages the entire Ruby, PostgreSQL, Redis, and Nginx stack into a reproducible container, enabling both one-server community setups and horizontally scaled multi-node deployments. Communities built on Discourse include GitHub, Rust, Ubuntu, Ethereum, and thousands of others ranging from indie developer forums to enterprise support portals.

What You Get

  • Behavioral trust level system - Automatically promotes users through five trust levels based on read time, days visited, and contributions, granting moderation powers to engaged community members without manual role management.
  • Built-in real-time chat - Enables direct messages, group channels, and threaded chats alongside forum topics so communities don’t need a separate messaging tool.
  • Discourse AI plugin - Adds LLM-powered topic summarization, semantic search, automated post moderation, and an AI chatbot that draws on community knowledge for answers.
  • Docker-based deployment - Ships as a fully configured container with PostgreSQL, Redis, Nginx, and Sidekiq pre-integrated, making new installations possible in under 30 minutes with a single setup script.
  • Plugin and theme system - Supports official and community plugins that inject routes, models, serializers, and frontend components without touching core code, plus a browser-based theme editor using CSS variables.
  • Searchable public knowledge base - Every forum topic is indexed and accessible to search engines by default, turning community Q&A into a living documentation resource for users and teams.
  • Admin dashboard with moderation tools - Provides review queues, automated flagging, trust level configuration, user analytics, and email digest controls in a unified administrative interface.
  • SSO and OAuth integration - Supports login via Google, GitHub, Discord, and others, plus custom SSO implementations for organizations wanting seamless identity federation with existing systems.

Common Use Cases

  • Developer community forum - An open-source project replaces a GitHub Discussions page with Discourse to get full moderation control, searchable history, and category-based organization for bug reports, feature requests, and announcements.
  • Customer support knowledge base - A SaaS company deploys Discourse so support staff and power users collaboratively answer questions that are indexed by Google, reducing first-contact support tickets by building a searchable public archive.
  • Internal team collaboration hub - A remote engineering team uses Discourse to replace Confluence and Slack: long-form decisions live in forum topics with searchable history, while quick communication happens in built-in chat channels.
  • Product feedback and roadmap community - A product team creates a dedicated category for user ideas with voting, links forum topics to GitHub issues via the Discourse GitHub plugin, and publishes roadmap updates as pinned announcements.
  • Educational cohort discussion boards - An online course platform embeds Discourse via the SSO API to give each cohort a structured discussion space with instructor moderation and a persistent archive for future students.

Under The Hood

Architecture Discourse uses a clean client-server separation: a Ruby on Rails JSON API backend paired with an Ember.js single-page application communicating via RESTful endpoints, supplemented by WebSocket channels for real-time topic and notification updates. The backend follows layered MVC with service objects and concern modules preventing bloated models, while serializers decouple persistence from API presentation. The plugin registry (DiscoursePluginRegistry) provides a formalized extension surface allowing plugins to inject routes, models, serializers, migrations, and frontend components without modifying core — a genuinely sophisticated extensibility boundary. Background jobs run via Sidekiq with well-typed worker classes, and data flow is predictable: controllers delegate to services, results flow through serializers to JSON, and the Ember frontend hydrates from a preload store on boot.

Tech Stack The backend runs Ruby 3.4+ on Rails 8.0 with ActiveRecord and PostgreSQL as the primary data store, Redis for caching and pub/sub delivery of real-time events, and Sidekiq for background job processing. The frontend is Ember.js with Glimmer components and TypeScript via Glint for type-safe template development, built with esbuild and Babel. Deployment is exclusively Docker-based through the discourse_docker project. Testing uses RSpec for the backend with fabricators and request specs, Playwright for end-to-end browser acceptance tests, and a full CI pipeline via GitHub Actions. Tooling includes pnpm workspaces, Lefthook for git hooks, ESLint, Prettier, and Stylelint for frontend code consistency, with TypeScript type checking via ember-tsc.

Code Quality The test suite is extensive — nearly two thousand spec files spanning unit tests for models, request specs for API endpoints, integration tests, and acceptance layers, all backed by RSpec with factory-style fabricators for fixtures. Frontend tests use Playwright for end-to-end coverage. Error handling is explicit throughout: controllers use rescue_from hooks, models use ActiveRecord validation callbacks, and CSRF handling is explicitly overridden with meaningful HTTP responses. The codebase applies Ruby idioms consistently (frozen_string_literal throughout, concern modules for cross-cutting behavior, Guardian pattern for authorization) and frontend components follow Glimmer conventions with tracked properties and typed templates. CI enforces linting, type checks, and full test suites on every pull request.

What Makes It Unique Discourse’s trust level system is architecturally distinctive: users automatically advance through five privilege tiers based on observed behavior — reading time, replies, likes given, days active — rather than static admin-assigned roles, creating self-regulating moderation without manual overhead. The plugin API goes beyond configuration hooks: plugins can define new database migrations, API endpoints, ActiveRecord models, Ember components, and admin pages from a single plugin directory that loads dynamically at boot. The AI integration (discourse-ai plugin) is semantically embedded in the community data model rather than bolted on, enabling topic summarization, semantic vector search across posts, and automated review queue triage using the same PostgreSQL schema. The browser-based theme editor exposes CSS variables and component override slots, enabling visual and behavioral customization without a deployment cycle.

Self-Hosting

Discourse is licensed under the GNU General Public License version 2.0 (GPL-2.0), which is a strong copyleft license. In plain terms, you can use, modify, and deploy Discourse freely for any purpose — personal, commercial, or organizational — as long as any modifications you distribute are also released under GPL-2.0. For most self-hosters running a private community, this means no practical obligation: you are running the software internally and do not distribute it. If you build a hosted service on top of Discourse and distribute it to others, you would need to make your modifications available under the same license.

Operationally, running Discourse yourself is a real commitment. The officially supported deployment method is Docker on a 64-bit Linux server with at least 1 GB of RAM (2 GB recommended for anything beyond a small community) and 10 GB of disk space. You are responsible for server provisioning, PostgreSQL and Redis uptime, SSL certificate management, email delivery configuration (Discourse is email-heavy for notifications and digests), and applying updates. Upgrades are straightforward via the admin panel’s built-in /admin/upgrade UI, but you need to monitor them and handle any migration failures. Backup and restore are well-documented but manual — you own your data pipeline entirely.

Compared to Discourse’s official managed hosting (discourse.org/pricing), self-hosting gives you full data control, plugin flexibility, and no per-seat fees, but you give up managed upgrades, DDoS mitigation, enterprise support SLAs, and high-availability infrastructure that Discourse’s cloud team provides. The managed tiers also include onboarding assistance and direct access to Discourse staff support, which can matter significantly for non-technical teams or communities where downtime carries real cost. For engineering-led teams comfortable with Docker infrastructure, self-hosting is entirely viable; for community managers without infrastructure experience, the managed option removes meaningful operational risk.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack

No spam. Unsubscribe anytime.

Join 750+ subscribers
No spam. Unsubscribe anytime.

Search