How to install Discourse on AlmaLinux?

I want to install Discourse on my AlmaLinux server. I have a basic knowledge of Linux commands but I am not sure how to install Discourse. Can anyone guide me with step-by-step instructions for installing Discourse on AlmaLinux?

To install Discourse on AlmaLinux, follow these steps:

1. Install Docker

Discourse requires Docker to run. First, you need to install Docker on your server. Check this guide How to Install Docker on AlmaLinux

2. Install Git

You also need Git to download Discourse.

sudo dnf install git

3. Install Discourse

Create a directory where Discourse will be installed:

sudo mkdir /var/discourse

Clone the Official Discourse Docker Image into /var/discourse .

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

4. Setup Discourse

Launch the setup tool at

./discourse-setup

During the setup, you will be asked for your domain name, email for the admin account, and SMTP settings for sending emails. Make sure you have these details ready. Here is the sample.

Hostname for your Discourse? [discourse.example.com]: 
Email address for admin account(s)? [me@example.com,you@example.com]: 
SMTP server address? [smtp.example.com]: 
SMTP port? [587]: 
SMTP user name? [user@example.com]: 
SMTP password? [pa$$word]: 
Let's Encrypt account email? (ENTER to skip) [me@example.com]: 
Optional Maxmind License key () [xxxxxxxxxxxxxxxx]:

Once the setup finishes, Discourse will automatically start inside a Docker container. You can access it by visiting your domain in a web browser.

If you have a firewall, make sure you open the necessary ports (e.g., 80 for HTTP and 443 for HTTPS):

sudo firewall-cmd --permanent --add-port=80/tcp
sudo firewall-cmd --permanent --add-port=443/tcp
sudo firewall-cmd --reload

Now, your Discourse forum should be running on your AlmaLinux server!