To install and self-host Discourse, follow the steps below. But if you'd rather skip the setup, maintenance, and server management, our official Discourse hosting takes care of everything for you.
If you prefer to self-host but need help setting it up we have partners who can help. Click here to explore self-hosting set-up options.
Set up Discourse in about 10 minutes with zero knowledge of Rails or Linux shell. Works on any Docker-compatible cloud provider or local server.
- Quick Start
- Requirements
- Installation
- The Setup Wizard
- After Installation
- Advanced Configuration
- Troubleshooting
- Optional Features
Run this single command on a fresh Ubuntu/Debian server:
wget -qO- https://raw.githubusercontent.com/discourse/discourse_docker/main/install-discourse | sudo bashThat's it! The installer will:
- Install Docker and git automatically (if not present)
- Download the Discourse Docker configuration
- Launch an interactive setup wizard
Don't have a domain name? No problem! The installer offers free subdomains like
yoursite.discourse.diy— no purchase required.Don't want to set up email? Skip SMTP and users can log in via Discourse ID with social logins (Google, Facebook, Apple, GitHub).
| Requirement | Minimum | Recommended |
|---|---|---|
| RAM | 1 GB (with swap) | 2 GB+ |
| CPU | 1 core | 2+ cores |
| Disk | 10 GB | 20 GB+ |
| OS | 64-bit Linux | Ubuntu LTS |
Auto-scaling: The installer automatically tunes
UNICORN_WORKERSanddb_shared_buffersbased on your server's RAM and CPU.
The installer works on any cloud provider with Docker support:
- DigitalOcean
- AWS EC2
- Google Cloud Platform
- Linode / Akamai
- Vultr
- Hetzner
- Any VPS with root SSH access
You have two options:
| Option | Best For | Setup |
|---|---|---|
Free subdomain (mysite.discourse.diy) |
Testing, learning, hobby projects | Claim at id.discourse.com/my/subdomain |
Your own domain (forum.example.com) |
Production, custom branding | Purchase from a registrar, configure DNS A record |
Visit id.discourse.com/my/subdomain anytime to claim your subdomain. You can do this before or during installation:
- Log in with your Discourse account (or create one)
- Choose your desired subdomain name (e.g.,
mysite) - When ready to install, click "Generate Code" to get a 6-digit verification code (valid for 10 minutes)
How it works: The installer verifies your code with Discourse ID, then automatically creates a DNS A record pointing
yoursite.discourse.diyto your server's IP. No manual DNS configuration required!
- Purchase a domain from a registrar like Namecheap
- Create a DNS A record pointing your subdomain (e.g.,
forum.example.com) to your server's IP address - Wait for DNS propagation (can take up to 48 hours, usually much faster)
-
Create a cloud server on any provider (e.g., a DigitalOcean droplet with Ubuntu)
-
SSH into your server:
ssh root@your-server-ip
wget -qO- https://raw.githubusercontent.com/discourse/discourse_docker/main/install-discourse | sudo bashThe wizard will guide you through:
- Admin email(s) — Enter the email addresses for admin accounts
- Domain selection:
- Select No for free subdomain → enter your subdomain and verification code
- Select Yes for your own domain → enter your hostname (e.g.,
forum.example.com)
- SMTP configuration — Skip to use Discourse ID login, or configure your email provider
After confirming your settings, the installer builds your Discourse (~5-10 minutes).
Note: SSL certificates via Let's Encrypt are provisioned automatically — no additional configuration required.
Unlike previous versions, you can skip email configuration during initial setup. When you skip SMTP, the installer automatically enables Login via Discourse ID, which provides:
- Email-based login — Users sign in through id.discourse.com (no SMTP needed)
- Social logins — Google, Facebook, Apple, and GitHub authentication built-in
- Centralized identity — Users can use the same account across multiple Discourse communities
- Web push notifications — Users still receive real-time notifications on all browsers and PWA-enabled devices
This is perfect for:
- Getting started quickly without email provider setup
- Communities that prefer social login over email registration
- Mobile-first communities using the PWA experience
Note: If you want traditional email features (email digests, mailing list mode, or email replies), you can configure SMTP later via Admin → Email or by re-running the setup wizard.
The wizard handles these automatically:
- Public IP detection — Finds your server's IP using multiple services
- Resource scaling — Sets optimal
UNICORN_WORKERSanddb_shared_buffersbased on your hardware - Port validation — Checks that ports 80 and 443 are available
- DNS verification — Confirms your domain resolves to this server
- Swap creation — Offers to create swap space on low-memory servers
Once the build completes (5-10 minutes), your forum will be available at:
https://yoursite.discourse.diy(free subdomain)https://forum.example.com(your own domain)
- Visit your forum URL
- Click Sign Up or Log In
- If using Discourse ID login: sign in with Google, Facebook, Apple, GitHub, or email via id.discourse.com
- If using SMTP: use one of the admin emails you entered during setup and check your inbox
- Complete the in-app setup wizard that appears after registration
Tip: Make sure you register with one of the admin emails you entered during installation to get admin privileges.
We strongly recommend enabling automatic security updates:
# Ubuntu/Debian - enable unattended upgrades
dpkg-reconfigure -plow unattended-upgrades
# Install fail2ban for brute-force protection
apt install fail2banVia web UI (recommended):
Visit https://your-forum/admin/upgrade and click Upgrade
Via command line:
cd /var/discourse
./launcher rebuild appDiscourse will email you when new versions are available. Stay current for the latest features and security fixes.
For advanced users, edit the configuration file directly:
nano /var/discourse/containers/app.yml
cd /var/discourse
./launcher rebuild appFor IP-based geolocation features (country detection, etc.), register for a free MaxMind GeoLite2 license key and add it to your app.yml:
env:
DISCOURSE_MAXMIND_LICENSE_KEY: "your_license_key_here"The launcher script in /var/discourse provides these commands:
Usage: launcher COMMAND CONFIG [--skip-prereqs] [--docker-args STRING]
Commands:
start Start/initialize a container
stop Stop a running container
restart Restart a container
destroy Stop and remove a container
enter Open a shell inside the container
logs View Docker logs for a container
bootstrap Bootstrap a container from template
rebuild Rebuild a container (destroy old, bootstrap, start new)
cleanup Remove stopped containers (> 24 hours old)
# Check what's using the ports
lsof -i :80
lsof -i :443
# Stop conflicting services
systemctl stop nginx # or apache2
systemctl disable nginx- Ensure your A record points to the correct server IP
- DNS propagation can take up to 48 hours
- Use
--skip-connection-testto bypass verification temporarily
- Ensure you're using the same Discourse ID account that claimed the subdomain
- Verification codes expire after 10 minutes — generate a new one if expired
- Each subdomain can only be claimed by one user
# View container logs
cd /var/discourse
./launcher logs app
# Enter container for debugging
./launcher enter app
# Check Rails production logs
cat /var/discourse/shared/standalone/log/rails/production.logThe installer will offer to create swap space. You can also create it manually:
# Create 2GB swap
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile swap swap defaults 0 0' >> /etc/fstabIf you configured SMTP but emails aren't sending, see the Email Troubleshooting Guide.
After installation, you can enable additional features:
- Google OAuth2
- GitHub Login
- Facebook Login
- Twitter/X Login
- Single Sign-On (SSO)
- More auth plugins on meta.discourse.org
- Reply via Email
- Recommended Email Providers — If you skipped SMTP during setup
- Install Plugins
- Import from Other Platforms — vBulletin, phpBB, Vanilla, etc.
- Embed in WordPress
- Embed Comments on Static Sites
Help us improve this guide! Feel free to ask questions on meta.discourse.org or submit a pull request.
Still finding setup too complex? Let us host Discourse for you — we handle everything.
