Discourse is an open-source discussion platform built for modern web browsers. It offers powerful features like real-time notifications and mobile responsiveness. In this guide, we will walk through the steps to install Discourse Forum on Debian 11 using Nginx and securing it with a free SSL certificate from Let's Encrypt.
Step 1: Update Your System
Start by ensuring your system is up to date:
sudo apt update && sudo apt upgrade -y
Step 2: Install Required Dependencies
Install necessary packages:
sudo apt install -y curl git wget
Step 3: Install Docker
Discourse runs on Docker, so you need to install it:
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
Step 4: Install Docker Compose
Install Docker Compose by running:
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Step 5: Create Discourse Directory
Create a directory for Discourse:
mkdir ~/discourse
cd ~/discourse
Step 6: Download Discourse Docker Image
Clone the Discourse repository:
git clone https://github.com/discourse/discourse_docker.git .
Step 7: Configure Discourse
Run the setup script:
cp samples/standalone.yml containers/app.yml
Edit the app.yml
file to set your domain name and email address:
nano containers/app.yml
Make sure to set the DISCOURSE_HOSTNAME
to your domain:
DISCOURSE_HOSTNAME: 'your_domain.com'
Step 8: Install Let's Encrypt SSL Certificate
Discourse has built-in support for Let's Encrypt. Ensure the following lines are uncommented in app.yml
:
LETSENCRYPT_ACCOUNT_EMAIL: 'your_email@example.com'
LETSENCRYPT: true
Step 9: Launch Discourse
Now you can build and launch Discourse:
./launcher bootstrap app
./launcher start app
Step 10: Configure Nginx
Discourse automatically configures Nginx, but you can also set up a reverse proxy if needed. Install Nginx:
sudo apt install -y nginx
Create a new Nginx configuration file:
sudo nano /etc/nginx/sites-available/discourse
Add the following configuration:
server {
listen 80;
server_name your_domain.com;
location / {
proxy_pass http://localhost:4000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Enable the site configuration:
sudo ln -s /etc/nginx/sites-available/discourse /etc/nginx/sites-enabled/
sudo systemctl restart nginx
Step 11: Access Discourse
You can now access your Discourse forum by navigating to:
http://your_domain.com
Follow the on-screen instructions to complete the setup.
Conclusion
You have successfully installed Discourse Forum with Nginx and secured it with a free Let's Encrypt SSL certificate on Debian 11. This modern platform will help foster discussions and collaboration in your community.
If you're looking for a reliable hosting solution for your Discourse forum, consider using Windows VPS UK. With Windows VPS, you can efficiently host your applications and ensure high performance. Whether you need VPS UK Windows or Windows Virtual Private Servers, you'll find a solution that fits your requirements.
For larger deployments or enterprise needs, explore Windows Virtual Dedicated Server Hosting or Virtual Private Server Hosting Windows. Whether you're located in the UK, Italy, or elsewhere, Windows VPS Italy and UK VPS Windows offer reliable hosting options. Visit Windows VPS Hosting UK to discover the best hosting solutions for your Discourse deployment.