I needed to set up a community forum for a project and looked at a lot of options. Most self-hosted forum software feels like it was designed in 2005. Discourse feels current: clean interface, real-time updates, good mobile experience, sensible moderation tools.
The trade-off with Discourse is that the official installation uses Docker and requires at least 2 GB RAM. It's not the most lightweight thing to self-host. But for a community that outgrows simple chat or comment sections, it's the right tool for the job.
The email configuration is the one thing you absolutely have to get right before going live — Discourse is heavily dependent on email for account creation and notifications. This guide covers that explicitly, along with the Docker-based installation that the Discourse team officially supports.
I run Discourse on Tencent Cloud Lighthouse. Discourse requires at minimum 2 GB RAM — 4 GB is more comfortable for a small-to-medium community. As your community grows, Lighthouse's spec upgrade option lets you move to a higher-RAM plan without re-deploying or migrating data. The snapshot feature is particularly valuable before Discourse version upgrades (which the official launcher handles, but aren't always smooth) — a pre-upgrade snapshot means you can restore in minutes if the update causes issues.
- Key Takeaways
| Feature | What it does |
|---|---|
| Discussion categories | Organized topic areas |
| Trust levels | Progressive user permissions (new → regular → leader → moderator) |
| Full-text search | Built-in search across all posts |
| Email notifications | Digest emails, mention notifications |
| SSO | Single sign-on with other systems |
| Plugins | Hundreds of community-built plugins |
| Chat | Built-in real-time messaging (optional) |
| Polls | Native polling in topics |
| API | Full REST API for integrations |
| Requirement | Notes |
|---|---|
| Cloud server | Tencent Cloud Lighthouse Ubuntu 22.04 |
| 2 GB RAM minimum | 4 GB recommended for comfortable performance |
| 20 GB+ disk | Discourse uses ~2 GB for the base installation; grows with content |
| A domain name | Required — Discourse needs a domain, not just an IP |
| Email service | Mandatory for Discourse to function (Mailgun, SendGrid, or SMTP) |
ssh ubuntu@YOUR_SERVER_IP
sudo apt update && sudo apt upgrade -y
# Discourse's official installer requires these
sudo apt install -y git wget
# Open firewall
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw enable
Discourse's official installer is Docker-based. Install Docker first:
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
newgrp docker
# Verify
docker --version
Discourse has an official Docker-based deployment tool called discourse_docker:
sudo git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse
sudo cp samples/standalone.yml containers/app.yml
sudo nano containers/app.yml
The key sections to configure:
## Hostname for your Discourse instance
DISCOURSE_HOSTNAME: 'forum.yourdomain.com'
## Required: developer emails (get admin access on first login)
DISCOURSE_DEVELOPER_EMAILS: 'you@yourdomain.com'
## Email configuration (see Part 4)
DISCOURSE_SMTP_ADDRESS: smtp.mailgun.org
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: postmaster@mg.yourdomain.com
DISCOURSE_SMTP_PASSWORD: your_mailgun_password
DISCOURSE_SMTP_ENABLE_START_TLS: true
## Contact email shown on the site
DISCOURSE_NOTIFICATION_EMAIL: noreply@yourdomain.com
## CDN (optional, improve global performance)
# DISCOURSE_CDN_URL: https://your-cdn.example.com
Discourse requires email for user registration, notifications, and admin setup. You must configure an SMTP service before installation.
smtp.mailgun.orgpostmaster@mg.yourdomain.comsmtp.sendgrid.netapikeyUpdate containers/app.yml with these credentials before proceeding.
cd /var/discourse
# Build the Discourse container (takes 10-30 minutes)
sudo ./launcher bootstrap app
This command:
Wait for it to complete. You'll see significant output — this is normal.
# Start Discourse
sudo ./launcher start app
# Check status
sudo ./launcher logs app
Visit http://forum.yourdomain.com — Discourse should load.
http://forum.yourdomain.comDISCOURSE_DEVELOPER_EMAILSComplete the wizard to finish initial setup.
Discourse can handle its own SSL via containers/app.yml:
## Uncomment and configure:
- exec:
cd: $home
cmd:
- ruby -e "require 'yaml'; y = YAML.load(File.read('config/discourse.conf')); y['force_https'] = true; File.open('config/discourse.conf', 'w') {|f| f.write(y.to_yaml)}"
Or use the standard Certbot + Nginx approach. Rebuild after any config change:
sudo ./launcher rebuild app
Access via Admin → Settings:
| Setting | Recommendation |
|---|---|
min_post_length |
20 characters (prevents very short posts) |
title_min_entropy |
10 (prevents low-quality titles) |
allow_new_registrations |
Enable or disable based on your community goals |
default_locale |
Set to your community's primary language |
max_image_size_kb |
10240 (10 MB max image upload) |
Edit containers/app.yml to add plugins before ./launcher rebuild app:
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- git clone https://github.com/discourse/discourse-math.git
- git clone https://github.com/discourse/discourse-solved.git
- git clone https://github.com/discourse/discourse-reactions.git
Then rebuild: sudo ./launcher rebuild app
cd /var/discourse
sudo ./launcher enter app
# Inside the container
discourse backup
# Backup file appears in /var/www/discourse/public/backups/
exit
sudo ./launcher enter app
# Upload backup file to /var/www/discourse/public/backups/
discourse restore backup-file.tar.gz
exit
Discourse will appear to install correctly, but without working email:
The result: a forum that looks functional but can't onboard users.
Configure email before building the container. If you need to change email settings after installation:
containers/app.ymlsudo ./launcher rebuild appFor testing before going live, Mailtrap (mailtrap.io) provides a sandbox SMTP endpoint that catches all emails without actually sending them.
# Discourse launcher commands
cd /var/discourse
sudo ./launcher start app # Start Discourse
sudo ./launcher stop app # Stop Discourse
sudo ./launcher restart app # Restart
sudo ./launcher rebuild app # Rebuild container (after config changes)
sudo ./launcher bootstrap app # Full reinstall
sudo ./launcher logs app # View logs
sudo ./launcher logs app -f # Follow logs
sudo ./launcher enter app # Shell inside container
# Inside the container (after ./launcher enter app):
discourse version # Check Discourse version
discourse upgrade # Upgrade to latest
rails runner "User.count" # Quick data queries
# Update Discourse
sudo ./launcher rebuild app
| Issue | Likely Cause | Fix |
|---|---|---|
| Connection refused | Service not running or wrong port | Check systemctl status SERVICE and verify firewall rules |
| Permission denied | Wrong file ownership or permissions | Check file ownership with ls -la and use chown/chmod to fix |
| 502 Bad Gateway | Backend service not running | Restart the backend service; check logs with journalctl -u SERVICE |
| SSL certificate error | Certificate expired or domain mismatch | Run sudo certbot renew and verify domain DNS points to server IP |
| Service not starting | Config error or missing dependency | Check logs with journalctl -u SERVICE -n 50 for specific error |
| Out of disk space | Logs or data accumulation | Run df -h to identify usage; clean logs or attach CBS storage |
| High memory usage | Too many processes or memory leak | Check with htop; consider upgrading instance plan if consistently high |
| Firewall blocking traffic | Port not open in UFW or Lighthouse console | Open port in Lighthouse console firewall AND sudo ufw allow PORT |
How long does it take to set up Discourse on a cloud server?
With the appropriate Lighthouse application image (if available), setup takes 10–30 minutes. Manual installation from a plain Ubuntu image typically takes 30–90 minutes following this guide.
What server specifications do I need for Discourse?
Check the prerequisites section of this guide for specific requirements. As a general rule: start with the minimum recommended spec, monitor actual usage, and upgrade from the Lighthouse console if needed.
How do I keep Discourse updated?
Follow the update procedure specific to how it was installed (package manager, Docker pull, or binary replacement). Take a Lighthouse snapshot before any major update as a safety net.
How do I back up Discourse data?
Use Lighthouse snapshots for full-server recovery plus the application's own export/backup mechanism for granular recovery. Both together provide comprehensive backup coverage.
htop and expand the server spec or attach CBS storage as needed.Build your community today:
👉 Tencent Cloud Lighthouse — Powerful VPS for Discourse
👉 View current pricing and promotions
👉 Explore all active deals and offers