Install Discourse on Ubuntu 24.04


:blue_book: Discourse Installation Guide

Ubuntu 24.04 — Official Docker Method

This guide is formatted as a standalone document.
It is intentionally styled to appear separate from normal forum posts.


Table of Contents


1. Update the Server

sudo apt update && sudo apt upgrade -y

2. Install Required Packages

sudo apt install -y git curl ufw

3. Clone the Discourse Docker Repository

sudo git clone https://github.com/discourse/discourse_docker.git /var/discourse

4. Enter the Discourse Directory

cd /var/discourse

5. Run the Discourse Setup Tool

sudo ./discourse-setup

You will be asked for:

  • Hostname (example: techpute.com)
  • Admin email address
  • SMTP server (Brevo: smtp-relay.brevo.com)
  • SMTP port (587)
  • SMTP username (your Brevo login email)
  • SMTP password (your Brevo SMTP key)

When complete, you will see:

DONE

6. Open the Site in a Browser

Visit:

https://your-domain.com

Create your admin account.


7. Enable UFW Firewall

sudo ufw allow 22
sudo ufw allow 80
sudo ufw allow 443
sudo ufw enable

8. Install Fail2Ban

sudo apt install -y fail2ban

Fail2Ban works automatically with UFW.


9. Rebuild Discourse

sudo ./launcher rebuild app

:check_mark: Installation Complete

Your Discourse instance is now live and ready for use.