Scripts2026年4月19日·1 分钟阅读

Discourse — Open Source Community Forum Platform

Discourse is a modern, open-source discussion platform built for civilized community conversations. It replaces traditional forums with real-time updates, dynamic threading, and built-in moderation tools.

Introduction

Discourse is a 100% open-source discussion platform built from the ground up for the next decade of the Internet. It serves as a mailing list, discussion forum, and long-form chat room, replacing aging forum software with a modern, real-time experience powered by Ember.js and Ruby on Rails.

What Discourse Does

  • Provides threaded discussions with real-time updates and infinite scrolling
  • Offers built-in trust levels that automatically promote helpful community members
  • Supports rich media embedding, oneboxes, and full Markdown formatting
  • Includes comprehensive moderation tools with flags, review queues, and auto-silence
  • Delivers email integration allowing users to reply and participate via email

Architecture Overview

Discourse is a monolithic Ruby on Rails application backed by PostgreSQL for persistent storage and Redis for caching and background jobs via Sidekiq. The frontend is an Ember.js single-page application that communicates with the Rails API. The official deployment method uses a custom Docker container manager called Pups, which handles bootstrapping the entire stack including Nginx, Rails, Sidekiq, PostgreSQL, and Redis in a single container.

Self-Hosting & Configuration

  • Deploy using the official Docker-based installer on a VPS with at least 2 GB RAM and 10 GB disk
  • Configure SMTP credentials during setup for mandatory email delivery (replies, notifications)
  • Set environment variables in containers/app.yml for domain, database, and plugin configuration
  • Enable automatic HTTPS via the built-in Let's Encrypt integration in the setup wizard
  • Install plugins by adding Git URLs to app.yml and rebuilding the container with ./launcher rebuild app

Key Features

  • Trust-level system that automatically grants permissions based on community participation
  • Real-time page updates without refresh using MessageBus pub/sub
  • Full-text search powered by PostgreSQL ts_vector with per-topic and per-category filtering
  • Extensive plugin API supporting SSO, chat, AI moderation, and custom theme components
  • Built-in backup and restore with optional uploads to S3-compatible storage

Comparison with Similar Tools

  • Flarum — lighter PHP-based forum with fewer built-in features but faster initial setup
  • NodeBB — Node.js forum with Redis/Mongo backend, smaller plugin ecosystem
  • phpBB — legacy PHP forum, stable but lacks modern real-time features
  • Vanilla Forums — commercial focus with an open-source edition, less community-driven
  • GitHub Discussions — tightly coupled to repositories, not suitable for standalone communities

FAQ

Q: What are the minimum server requirements for self-hosting Discourse? A: A single container install requires 1 CPU core, 2 GB RAM (with swap), and 10 GB disk. For communities above 1,000 active users, 2 cores and 4 GB RAM are recommended.

Q: Can Discourse integrate with existing authentication systems? A: Yes. Discourse supports DiscourseConnect (custom SSO), OAuth2, SAML, LDAP via plugins, and social logins for Google, GitHub, Twitter, and Facebook out of the box.

Q: How does the trust level system work? A: New users start at Trust Level 0 with limited capabilities. As they read topics, post replies, and receive likes, they automatically advance through levels 1-4, unlocking abilities like editing posts, flagging, and wiki creation.

Q: Is Discourse suitable for large-scale communities? A: Yes. Discourse powers communities with millions of posts. It supports CDN offloading, read-replica databases, horizontal Sidekiq scaling, and S3 uploads for large deployments.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产