Installing and setting up Discourse on a Linux server
Discourse is an extremely powerful tool for server owners to get their community growing. Today, we’ll dive into setting up your very own install of Discourse.
- Ubuntu 16.04 server with at least 2GB of RAM. We recommend following DigitalOcean’s initial server setup guide.
- A domain name that resolves to your server, numbers will not work with Discourse.
- An SMTP provider set up with the same domain name. A list of recommended providers can be found here.
Step 1 – Installing Docker
Discourse needs to run in a Docker environment, so we need to install that.
First off, you need to be in a root user, so we’ll switch to that.
Now, we’re going to install Docker and Git onto our server.
wget -qO- https://get.docker.com/ | sh
That command always installs the latest version of Docker and Git.
Step 2 – Downloading Discourse
We’re going to create a directory for Discourse to use, and download the latest official build of Discourse into it.
sudo -s mkdir /var/discourse git clone https://github.com/discourse/discourse_docker.git /var/discourse cd /var/discourse
You will still need to be in a root user for the coming steps.
Step 3 – Installing Discourse
Now that we’ve downloaded Discourse, it’s time to configure it’s settings and install.
Let’s confirm you’re in the proper directory by switching to it:
There should be a setup tool from the previous step in the Discourse directory, launch it.
Discourse will ask you the following questions:
Hostname for your Discourse? [discourse.example.com]: Email address for admin account(s)? [firstname.lastname@example.org,email@example.com]: SMTP server address? [smtp.example.com]: SMTP port? : SMTP user name? [firstname.lastname@example.org]: SMTP password? [pa$$word]: Let's Encrypt account email? (ENTER to skip) [email@example.com]:
Just answer each one and press ENTER. When you get to the SMTP settings, keep this in mind: It is a hassle to set up and configure an SMTP provider with your domain, but the rewards are limitless.
In my experience, neither Gmail or Yahoo’s built in SMTP server will work with Discourse.
Once you have completed the configuration, Discourse will begin the bootstrapping process.
The process could take between 2 and 15 minutes to complete, depending on the speed of your server. You must keep the terminal window open during the bootstrap process.
If you need to edit any settings after installation, simply run
cd /var/discourse nano containers/app.yml ./launcher rebuild app
And Discourse will bootstrap again, updating its settings in the process.
Step 3 – Registering an admin account
If bootstrapping was successful, you may now visit your domain name and you should see the Discourse welcome screen.
Discourse will ask you to create a password for your admin user, make it secure! After your password is created, Discourse will send you a confirmation email.
Hold your breath! If you have configured SMTP properly, you should have no problems with confirming your email.
If you do not get your confirmation email within 5 minutes (check your spam folder), you have incorrectly configured SMTP 🙁
Luckily, Discourse has a handy post-installation email troubleshooting guide that should solve all your problems.
That’s it. You’re done. You may now start managing your new forum board and users may now sign up.