Discourse is a popular Open Source software that is free to use and built with a vision of being the forum platform of the future! It is truly a useful and incredibly modifiable piece of software that I’ve had a lot of fun with and a that is really easy to work with once you understand the thinking behind it! In addition to this, it actually looks very nice and modern, not like those blocky old forums that I used to hang around when I was in my teens!
The Raspberry Pi, on the other hand, is a very simple, but powerful piece of hardware. It’s originally built to be a springboard into coding for beginners and younger people. With it’s highly customizable interface and open OS you can do pretty much anything you can imagine with this car-sized computer! So, one must obviously try to combine these two pieces of great technology and make something even better! A server hosting your own forum in you living room!
In this article you’ll learn just how to put two and two together and get five!

Important! Raspberry Pi is not officially supported by the team behind Discourse, but is shown to work great for development, or very small forums!
Pre-Requirements & Hardware
First of all you need to set up your Raspberry Pi! You’ll need a few additional items, such as a charger, monitor, and another computer to format the mini-SD.
I myself use the following:
- Raspberry Pi 4, 4gb (Raspberry Pi 4 and up is required, the more memory, the merrier!)
- Aluminum case with built-in fan to keep it nice and cool (not required but highly recommended)
- Power Cable
- Mini-SD card. I recommend 32gb, at least.
- Internet-connection, preferably by cable (I’ve had some issues running a forum on wifi)
- Another computer to do the setup on.
- Domain name where you have access to change nameservers
- Cloudflare account
- E-mailservice, like Mailgun, to be able to send email from your Discourse instance.
Setting up the Raspberry Pi
- Download the official formatting software from the official Raspberry Pi website and install it.
- Choose “Rasberry Pi OS (64-bit)
- Click the cog in the down right corner, and set up wifi, SSH and passwords here and save yourself some trouble down the line!
- While this is running, you might as well put together your RPi, the case and install the fan.
- When the formatting is done, insert the mini-SD into your RPi
- Plug in the power cable and wait for it to start up.
- SSH into your RPi. How to find out what IP-adress your RPi has!
- Update and Upgrade the software!

sudo apt update sudo apt upgrade

Set up Mailsending Service
Before you continue, you have to set up DNS and a mailsender service! I myself use Mailgun, which is one of the recommended providers by Discourse. Their services are free up to a certain number of sent e-mails per month and is working very reliably for me. Good for starting out!
I recommend using Cloudflarefor a forum hosted on your home network.
First, I’d recommend setting up Mailgun and making sure that e-mails go through. If there’s no e-mails, there’ll be no forum!
Setting up Cloudflare
Why do I need a Cloudflare account?
Since the forum will run on your home- or work network, it’s essential to have some form of protection for your IP-adress. That’s why we will set up a Cloudflare Tunnel that routes the traffic through Cloudflare who will hide the IP from visitors.
To set up a tunnel like that is quite easy, just follow the steps below!
- Create an account and make sure you’re logged in.
It’s a lot easier to do the following steps if you’re SSH-ing into your RPi using the same computer you’re logged into Cloudflare. - Download Cloudflare to your RPi
- Login to your account on the RPi
- Create your Tunnel
- Check that the tunnel has been created properly
- Create a configuration file
- Create a CNAME-record to let Cloudflare know what domain to send through the tunnel
- Make sure the tunnel is running properly
- Install as a Service: Make sure the tunnel doesn’t stop running and automatically start running after reboot, etc.
- Set it up
- Start the service
- Check the status of the service
- Done with the Cloudflare part of the guide!
Install Discourse on RPi
The following part is the normal installation for Discourse on any device. However, some configuration is made to the installation files for it to work on RPi.
Important! Discourse needs Docker to work. When you’re asked if you are sure about installing Docker, do that or the installation won’t work.
- Head into Sudo territory!
- Clone the official Discourse into your RPi
- Head into the Discourse-folder and start the setup!
Important: Read the next step before starting this step to save yourself a lot of time! 4. After confirming the details is correct, press Enter. Then, immediately (or at least within 5 sec) press Ctrl+C to stop the installation for now. 5. Modify the app.yml-file
Now is a great time to add any Plugins you want on your forum! 6. Rebuild the App
This might take quite some time to finish, over an hour on my longest try. 7. When the app is done rebuilding the installation is done! 8. Head to the correct web adress in a browser and finish the installation.
Problems?
Keep in mind that if you’re using a new domain, the emails could take quite some time to reach their target. They could also be in the spam/trash. The longest I’ve had to wait until everything started working properly was one whole day. I just left it over the night and came back the next to try and continue the setup.
What caused this is a mystery to me, though I believe the problem to lie in the receiving end of the email-chain. I normally use a Protonmail account to set up my admin account and perhaps Protonmail is more sensitive towards new adresses.
So far we’ve installed the forum software itself, however, there’s quite a lot more to do and go through before the forum is ready for action! I will try to create a guide for that as well in the near future and add a link to it here! Until then, feel free to ask questions!
Want more suggestions on what to do with your Raspberry Pi? Check out this articleon why it might be a good idea to let your kids play old school retro games on the RPi!
If you successfully managed to install and run Discourse on your Pi for a while you might see the disc filling up faster than you’d like. You might have to clean out your Docker images as well!
Leave a Reply