To install Discourse on DigitalOcean, create an Ubuntu LTS droplet with at least 2 GB of RAM, point a DNS A record at it, then run the official installer script over SSH and answer the wizard prompts. The whole thing takes roughly ten minutes of your attention plus five to ten minutes of build time. Discourse only supports the Docker based install, so do not go looking for a Rails deployment guide; the container is the supported path and the one that gets upgrades.
forum.example.com, SSH in as root, and run wget -qO- https://raw.githubusercontent.com/discourse/discourse_docker/main/install-discourse | sudo bash. The wizard asks for admin emails, your hostname and optional SMTP, then builds the container. Let’s Encrypt certificates are provisioned automatically. Upgrade later with cd /var/discourse && ./launcher rebuild app.This tutorial covers droplet sizing and swap, DNS, both the scripted and the manual install paths, what changed about the SMTP requirement, and the upgrade and backup commands you will actually use in production.
Sizing the droplet
The official cloud install guide lists 1 GB of RAM with swap as the minimum and 2 GB or more as recommended, with 1 core minimum and 2 or more preferred, plus 10 GB of disk minimum and 20 GB recommended. On DigitalOcean that maps cleanly onto the Basic Droplet range.
| Droplet | Specs | Price | Verdict for Discourse |
|---|---|---|---|
| Basic 1 GB | 1 GB RAM, 1 vCPU, 25 GB SSD | $6 per month | Works only with 2 GB of swap, slow rebuilds |
| Basic 2 GB | 2 GB RAM, 1 vCPU, 50 GB SSD | $12 per month | The sensible starting point |
| Basic 4 GB | 4 GB RAM, 2 vCPU, 80 GB SSD | $24 per month | Comfortable for an active community |
| Any size | Add block storage later | Per GB per month | Useful once uploads grow |
Pick a region close to your members, not close to you. Latency on a forum is felt in every page load. Enable backups on the droplet during creation if you want a provider level safety net in addition to Discourse’s own backup system. If you have provisioned other services on a droplet before, the workflow will be familiar from our guides to installing Node.js on cloud hosting and installing Minikube on Ubuntu.
UNICORN_WORKERS and db_shared_buffers automatically. If you resize the droplet later, rebuild the container so those values are recalculated for the new size.DNS and firewall before you start
Create the DNS record before running the installer, because the wizard verifies that your hostname resolves to the droplet and will stop if it does not. In the DigitalOcean control panel go to Networking, then Domains, add your domain, and create an A record for the subdomain you want pointing at the droplet’s public IPv4 address.
Discourse needs ports 80 and 443 free. If you enabled a cloud firewall or turned on UFW, allow those plus SSH.
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status verboseAlso confirm nothing else is bound to those ports. A droplet created from a LAMP or Nginx marketplace image already has a web server running, which will collide with the Discourse container.
sudo lsof -i :80
sudo systemctl stop nginx apache2 2>/dev/null
sudo systemctl disable nginx apache2 2>/dev/nullAdd swap first on a small droplet
The container build is memory hungry. On a 1 GB droplet it will be killed halfway through without swap, and the failure message is unhelpfully vague. The installer offers to create swap on low memory servers, but doing it yourself first is one less thing to go wrong.
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile swap swap defaults 0 0' | sudo tee -a /etc/fstab
free -hThe scripted install
This is the supported path and the one the project recommends. SSH into the droplet as root and run one command. It installs Docker and git if they are missing, downloads the Discourse Docker configuration and launches an interactive wizard.
ssh root@your-droplet-ip
wget -qO- https://raw.githubusercontent.com/discourse/discourse_docker/main/install-discourse | sudo bashThe wizard asks for three things. Admin email addresses, which become the accounts with administrator rights when they register. Your hostname, either your own domain or a free discourse.diy subdomain claimed through Discourse ID. And SMTP settings, which are now optional: skip them and the installer enables login through Discourse ID with Google, Facebook, Apple and GitHub social logins instead.
After you confirm, the container builds. Expect five to ten minutes on a 2 GB droplet, longer on 1 GB. SSL through Let’s Encrypt is provisioned automatically, so there is no separate certbot step.
The manual install path
If you prefer to see every step, or you are automating the build, clone the repository yourself and run the setup script directly. The result is identical to the scripted path.
sudo apt update && sudo apt install -y git
sudo git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse
sudo ./discourse-setupThe setup script writes /var/discourse/containers/app.yml, which is the single file that defines your forum: hostname, SMTP credentials, worker counts, plugins and environment variables. Editing it and rebuilding is how you change anything at the infrastructure level.
sudo nano /var/discourse/containers/app.yml
cd /var/discourse
sudo ./launcher rebuild appThe launcher script wraps Docker with the commands you need day to day: start, stop, restart, destroy, enter, logs, bootstrap, rebuild and cleanup. Full details live in the discourse_docker repository.
./launcher rebuild app destroys and recreates the container. Your data lives in /var/discourse/shared and survives, but the site is offline for the duration of the build. Schedule rebuilds outside peak hours and take a backup first.Upgrades, backups and routine operations
Discourse ships upgrades through the admin interface for most releases. Visit https://your-forum/admin/upgrade and click Upgrade. When a release requires a container rebuild, or the web upgrade fails, drop to the command line.
cd /var/discourse
sudo ./launcher rebuild appBackups can be scheduled in Admin then Backups, with optional upload to S3 compatible object storage such as DigitalOcean Spaces. From the shell, the container exposes a CLI for the same job.
cd /var/discourse
sudo ./launcher enter app
discourse backup
discourse restore your-backup-file.tar.gz
exitTwo more things worth doing on day one. Turn on unattended security upgrades with dpkg-reconfigure -plow unattended-upgrades, and install fail2ban to blunt brute force attempts against SSH. Neither takes more than a minute and both are recommended in the official guide. If you run monitoring alongside the forum, the approach in our guide to where to host Grafana pairs well with a droplet like this, and the walkthrough on installing Grafana on Hostinger covers the dashboard side.
Troubleshooting the install
The wizard fails DNS verification. Your A record has not propagated or points elsewhere. Check with dig +short forum.example.com from the droplet. You can bypass the check with --skip-connection-test, but fix the record properly before going live or Let’s Encrypt will fail too.
Ports 80 or 443 already in use. Another web server is running. Run lsof -i :80, then stop and disable whatever answers. Marketplace images with a preinstalled stack are the usual cause.
The build dies with no clear error. Out of memory. Add the 2 GB swap file shown above, or resize the droplet to 2 GB and rebuild. This is by far the most common failure on the cheapest instance.
The site is up but no email arrives. Either SMTP was skipped, or the credentials in app.yml are wrong. Check ./launcher logs app for authentication errors, and confirm your provider allows the sending domain. Port 25 is blocked on many providers, so use 587 with authentication.
Certificate provisioning fails. Let’s Encrypt has to reach the droplet on port 80. A cloud firewall rule or a DNS record pointing to the wrong IP will break the challenge. Fix the reachability, then rebuild.
Frequently asked questions
How much RAM does Discourse need on DigitalOcean?
The documented minimum is 1 GB with swap, and 2 GB or more is recommended. In practice the $12 per month 2 GB Basic Droplet is the right starting point, because 1 GB makes every container rebuild slow and fragile even when it succeeds.
Can I install Discourse without Docker?
Not in any supported way. Discourse only ships a Docker based install for production, and the upgrade path assumes it. A manual Rails deployment is possible in theory but leaves you maintaining the entire stack yourself with no upstream help.
Is SMTP still required to install Discourse?
No. Current versions let you skip SMTP during setup and fall back to login through Discourse ID with social providers. You should still add a mail provider afterward, because digests, notifications by email and reply by email depend on it.
How do I upgrade Discourse?
Use the web upgrade page at /admin/upgrade for routine releases. When a rebuild is needed, run cd /var/discourse then ./launcher rebuild app. Take a backup first, and expect a few minutes of downtime while the container is recreated.
Where does Discourse store its data?
In /var/discourse/shared/standalone on the host, which is bind mounted into the container. That directory holds the PostgreSQL data, uploads, logs and backups, and it survives container rebuilds. Back it up alongside the application backups.
The bottom line
Installing Discourse on DigitalOcean is one of the smoother self hosted deployments available. Create a 2 GB droplet, point DNS at it, add swap, and run the installer. The container handles PostgreSQL, Redis, the Rails app and the certificate, so the parts you would normally assemble by hand are already assembled.
What you are signing up for is maintenance rather than setup. Keep the container rebuilt on a regular cadence, verify that backups actually restore, and configure a real SMTP provider once traffic justifies it. Do those three things and a $12 droplet will comfortably run a community forum for years.
About this article: GeekBlog covers U.S. technology news, AI, phones, smartwatches and gaming. Every story is written and checked under our Editorial Policy. Spotted a mistake or have a story tip? Contact our editors.

