Discourse Installation Tutorial

Discourse is a containerized application that’s relatively straightforward to install, but on mainland Chinese servers, the installation can get stuck or fail for various reasons. This topic will walk you through successfully installing Discourse on both mainland Chinese and overseas servers.

Minimum Server Requirements

CPU: 2 cores
Memory: 4G
Available storage: 10G+

Once your server is ready, you can begin the installation.

Install Docker

First, you’ll need to install Docker on your system. You can follow the official Docker installation guide, which supports installation on nearly all major operating systems. This tutorial uses AlmaLinux 9 for demonstration.

For mainland Chinese servers, use the Tsinghua University mirror to speed up downloads. Instructions are available at:

Once Docker is installed, run systemctl enable --now docker to set it to start on boot and launch the Docker service immediately.

For mainland Chinese servers, configure Docker mirror acceleration. Edit the file /etc/docker/daemon.json using vim and paste the following content:

{
    "registry-mirrors": [
        "https://docker.1ms.run"
    ]   
}

Save the file, then run systemctl restart docker to restart the Docker service.

Prepare Discourse Installation Environment

  • A functional SMTP email account for sending administrator activation emails.
  • A forum domain name pointed to your server’s public IP address, which you will need to enter during the installation process.
  • Git installed on your server, using either dnf install git or apt install git.

Once your environment is fully prepared, you can download the Discourse Docker management tool.

sudo -s
git clone https://github.com/discourse/discourse_docker.git /var/discourse
cd /var/discourse
chmod 700 containers

If you are unable to connect to GitHub from a mainland Chinese server, you can search for available GitHub acceleration proxy services or set up your own.

Once everything is set up correctly, you can proceed to install Discourse.

Install Discourse

Run ./discourse-setup to launch the installation wizard.

You will be prompted to enter your forum’s domain name; enter it and press Enter. The wizard will then check your domain’s DNS resolution. If the check fails, you will not be able to proceed further.

If the prompt indicates that your domain is not properly resolved, you can manually adjust the configuration to continue the installation, though this method is outside the scope of this guide. Once you have resolved the DNS issue, re-run ./discourse-setup to launch the installation wizard again.

Next, you will be asked to enter your administrator email address, SMTP server, SMTP port, SMTP username, SMTP password, notification email address, as well as the optional Let’s Encrypt notification email address and Maxmind license key. Fill out all required fields as prompted.

Finally, a confirmation screen will appear; press Enter if all details are correct to begin the installation.

For overseas servers, simply wait for the installation to complete. For mainland Chinese servers, press Ctrl+C to terminate the installation wizard and proceed with the following steps.

Modifications for Mainland Chinese Servers

For well-documented reasons, you will need to modify your configuration files to successfully install Discourse on mainland Chinese servers. Without these modifications, the installation will likely get stuck at some step or fail entirely.

Open the main configuration file with vim containers/app.yml, and add - "templates/web.china.template.yml" after - "templates/web.template.yml" in the templates section.

Once you have made these changes, save and close the file, then run ./launcher rebuild app to begin the installation. (After applying these optimizations, you can directly enter the GitHub link for plugins in the plugin configuration section, without needing to convert it to a mirror link.)

Post-Installation Steps

Open your forum’s domain name in a web browser to configure your website settings and create your administrator account.

Activate your administrator account via email and log in to the admin dashboard. The installation is now complete! Congratulations on setting up your own Discourse forum.

Other Reference Tutorials

3 Likes

Perfect timing to learn how to set up

What specs does this little gadget have? It’s really fast.

2h8g, this program is quite memory-intensive.

I’m using a setup with 2 vCPUs, 4096 MB RAM, 100 GB NVMe, and 5.00 TB transfer, and it feels really good.

Check the website, which region is the server located in?

The website is currently restarting; it is hosted in Japan.

Otaku’s Wonderful House - This is a 2D anime gathering place (justnainai.com)

Looks good. How was the multi-language switch on the header implemented? Is it a plugin?

The frosted glass effect of the top navigation looks good, but the text below is too close to the top navigation bar.

You can use the padding-top code to add some spacing.

Mainly, I feel more comfortable in the shade, so I’m getting things set up in there.

I can’t remember which plugin this is from. Anyway, when you switch while not logged in, the button disappears after you log in.
I didn’t pay much attention to this.

By the way, how do I turn off the summary feature? It’s a bit annoying to receive hundreds of emails every time :downcast_face_with_sweat:

Backend User Preference Settings: Change the summary frequency to Never

1 Like

I see, thank you.

Could you please explain this to me? This keeps happening to me.

Also, I really haven’t been able to find any other tutorials that cover this.

It is recommended that you properly complete the parsing first. If you are sure you want to skip parsing, refer to this article.

It still doesn’t work. This time I chose to directly delete the data and did not install the panel, but it is still the same issue:

Did you run ./discourse-setup --skip-connection-test?

Okay, the domain can now be bound normally, but another error occurred:

ENTER to continue, ‘n’ to try again, Ctrl+C to exit:
letsencrypt.ssl.template.yml enabled

Configuration file at containers/app.yml updated successfully!

DISCOURSE_DEVELOPER_EMAILS left at incorrect default of me@example.com,you@example.com

Sorry, these containers/app.yml settings aren’t valid – can’t continue!
If you have unusual requirements, edit containers/app.yml and then:
./launcher bootstrap app
Which translates to: Sorry, these containers/app.yml settings are invalid - cannot continue!
If you have unusual requirements, edit containers/app.yml, then:
./launcher bootstrap app