Independent testing Updated April 2026 387 self-hosting guides 5 VPS providers tested

guide

How to Self-Host Discourse on a VPS (Complete Guide)

Learn how to self-host Discourse on a VPS with a step-by-step guide covering installation, configuration, and securing Discourse for reliable daily use.

How to Self-Host Discourse on a VPS (Complete Guide)

Discourse is a powerful open-source discussion platform designed for communities and organizations. Self-hosting Discourse on a VPS gives you greater control and flexibility. This guide walks you through the steps to install Discourse on a VPS using Docker, covering the prerequisites, configuration, and troubleshooting tips.

Choosing the Right VPS Provider

Before you can self host Discourse, you need to choose a suitable VPS provider. Below is a comparison of some popular VPS providers:

ProviderPrice (EUR/USD)Key Features
Contabo VPS5.99 EUR/moHigh disk space, SSD, scalable resources
Hetzner Cloud4.15 EUR/moAffordable pricing, good performance
DigitalOcean6 USD/moSimple management interface, robust APIs
Vultr6 USD/moFast deployment, global low-latency data centers
Linode (Akamai)5 USD/moReliable service, good education resources

You can find a more detailed comparison on our full VPS comparison.

Prerequisites

  1. Choose a VPS Plan: For this guide, a minimal setup with at least 2GB of RAM is recommended for optimal performance.
  2. Operating System: Ubuntu 20.04 or later is preferred.
  3. Domain Name: Set up a domain name pointing to your VPS IP address to make access easier.
  4. Access to the VPS: SSH access to your server is necessary.

Installing Docker and Docker Compose

Discourse runs on Docker, so you need to install it first. Follow these steps:

  1. SSH into your VPS:

    ssh root@your_vps_ip
  2. Update the package list:

    sudo apt update
  3. Install Docker:

    sudo apt install docker.io
  4. Enable Docker:

    sudo systemctl enable docker
    sudo systemctl start docker
  5. Install Docker Compose:

    sudo apt install docker-compose

Installing Discourse

With Docker and Docker Compose installed, you can now set up Discourse:

  1. Set Up the Discourse Directory:

    sudo mkdir /var/discourse
    cd /var/discourse
  2. Clone the Discourse GitHub Repository:

    sudo git clone https://github.com/discourse/discourse_docker.git .
  3. Run the Setup Script:

    sudo ./discourse-setup

    The script will prompt you for features such as email address and domain name. Ensure to enter your domain correctly.

  4. Configure Email Settings: If you plan to use a SMTP server, follow the prompts to configure it. You can use services like SendGrid or Mailgun for sending emails.

Starting Discourse

Once the setup is complete, you can start Discourse:

sudo ./launcher bootstrap app
sudo ./launcher start app

Accessing Your Discourse Instance

Open your browser and navigate to http://yourdomain.com. You should be greeted with the Discourse setup screen, where you can create your admin account and start configuring your forum.

FAQs

1. What VPS specifications are recommended for self-hosting Discourse?

For optimal performance, it is recommended to use a VPS with at least 2GB of RAM and a modern multi-core CPU. Discourse can be quite resource-intensive, especially with multiple users. Additionally, consider SSD storage for faster data access. If you expect significant traffic, upgrading to a VPS with more resources might be necessary. Providers like Hetzner or Contabo often provide good value for the needed specifications.

2. What should I do if I encounter issues during installation?

Common issues during Discourse installation include network connectivity problems, incorrect domain settings, or issues with Docker. First, check your serverโ€™s firewall settings to ensure that necessary ports (like 80 and 443) are open. Also, examine the logs with:

sudo ./launcher logs app

This provides detailed information on what might be failing. Consult the Discourse Meta community for support if youโ€™re still stuck.

3. How can I secure my Discourse instance?

To secure your Discourse installation, you should configure HTTPS. You can use Letโ€™s Encrypt to obtain a free SSL certificate, which is essential for encrypting data transmission. During the Discourse setup, you should have provided your email and domain; the setup script automatically configures Letโ€™s Encrypt for you. Additionally, always keep your Discourse instance updated, as updates often include important security patches.


With this guide, you should have a fully functional Discourse instance on your VPS. For further enhancements and self-hosting tools, consider exploring resources on r/selfhosted or the awesome-selfhosted list. Happy self-hosting!