1. Update Your Server
Before installing anything, bring your system up to date. This prevents version conflicts and avoids strange behavior later.
Code
sudo apt update
sudo apt upgrade -y
2. Install Git
Discourse uses a Git repository for its Docker launcher. Git must be installed before cloning it.
Code
sudo apt install git -y
3. Install Docker (Official Script)
Discourse runs entirely inside Docker. The official Docker installation script is the most reliable method and avoids the outdated packages in Ubuntu’s repositories.
Code
curl -fsSL https://get.docker.com | sudo sh
Verify Docker is installed:
Code
docker --version
If you see a version number, you’re good.
4. Download the Discourse Docker Launcher
The launcher script lives in a GitHub repository called discourse_docker. This creates the /var/discourse directory that Discourse expects.
Code
sudo git clone https://github.com/discourse/discourse_docker.git /var/discourse
5. Run the Discourse Setup Script
This is the heart of the installation. The script asks a few questions and then builds your forum.
Code
cd /var/discourse
sudo ./discourse-setup
You will be prompted for:
-
Email address (for Let’s Encrypt certificates)
-
Your forum domain name
-
SMTP server address
-
SMTP username
-
SMTP password
-
SMTP port
When you finish, the script builds the container. This takes a few minutes.
When it completes, Discourse starts automatically.
6. Confirm That Discourse Is Running
Check Docker’s active containers:
Code
sudo docker ps
You should see a container named app.
If it’s there, your forum is live.
7. Rebuilding Later (Updates or Changes)
Discourse updates are handled through a rebuild. This is the safe, supported method.
Code
cd /var/discourse
sudo ./launcher rebuild app
A rebuild pulls the latest code, updates plugins, and restarts the container.
8. Accessing Your New Forum
Open your browser and go to:
Code
https://your-domain-here.com
You’ll be prompted to create the first admin account.
Once that’s done, your Discourse installation is complete.
Final Notes
This installation method is:
-
Clean
-
Repeatable
-
Easy to maintain
-
Fully supported by the Discourse team
If you ever need to move servers, restore from backup, or expand your setup, this foundation will serve you well.
Final Process (if needed for editing)
To edit app.yml
Code
sudo nano containers/app.yml
That’s it — that command opens the live configuration file so you can make changes.
Full workflow (so you stay oriented)
Since you like clear, step‑by‑step structure, here’s the complete rhythm:
- Go to your Discourse install directory:
Code
cd /var/discourse
- Open the config file:
Code
sudo nano containers/app.yml
-
Make your edits
-
Save: CTRL+O, then Enter
-
Exit: CTRL+X
-
-
Rebuild Discourse so your changes take effect:
Code
sudo ./launcher rebuild app