How to Install Commento on Linux Mint

Commento is an open-source and privacy-focused commenting platform that you can self-host. In this tutorial, we will show you how to install Commento on your Linux Mint system.

Prerequisites

Before proceeding with the installation, make sure your system meets the following prerequisites:

Step 1: Clone Commento Repository

Firstly, you need to clone the Commento repository from the GitLab using the following command:

git clone https://gitlab.com/commento/commento.git

Once the cloning process is completed, you will get the Commento source code in the commento directory.

Step 2: Configuration

Now, navigate to the commento directory and create a .env file by copying the .env.sample file.

cd commento
cp .env.sample .env

Then, edit the .env file using your preferred text editor, and specify the following information:

COMMENTO_ORIGIN=https://yourdomain.com
COMMENTO_PORT=80
COMMENTO_POSTGRES_HOST=postgres
COMMENTO_POSTGRES_PORT=5432
COMMENTO_POSTGRES_USER=commento
COMMENTO_POSTGRES_PASSWORD=<strong_password>
COMMENTO_POSTGRES_DBNAME=commento
COMMENTO_SMTP_HOST=<your_smtp_host>
COMMENTO_SMTP_PORT=<your_smtp_port>
COMMENTO_SMTP_USERNAME=<your_smtp_username>
COMMENTO_SMTP_PASSWORD=<your_smtp_password>
COMMENTO_EMAIL_FROM=<commento_sender_email_address>

Replace the following variables with your own values:

Step 3: Run Commento using Docker

Now, run the following command to build and start Commento containers using Docker.

docker-compose up -d

It should take some time to build the Commento containers, and you should see the following output generated:

Creating network "commento_default" with the default driver
Creating commento_postgres_1 ... done
Creating commento_commento_1 ... done

Step 4: Set up Nginx as a Reverse Proxy

Lastly, you need to configure Nginx as a reverse proxy for Commento. To do so, create an Nginx server block by executing the following command:

sudo nano /etc/nginx/sites-available/commento.conf

And, add the following configuration:

server {
    listen 80;
    server_name yourdomain.com;

    location / {
        proxy_pass http://localhost:8080/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }

    location /commento {
        proxy_pass http://localhost:8080/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

Save the file and create a symbolic link for this file under sites-enabled directory using the following command:

sudo ln -s /etc/nginx/sites-available/commento.conf /etc/nginx/sites-enabled/commento.conf

Then, run the following command to reload the Nginx configuration:

sudo systemctl reload nginx

Step 5: Test Commento

Now that you've set up Commento on your server and configured Nginx as a reverse proxy. You can test your Commento installation by navigating to your domain or subdomain in your web browser.

http://yourdomain.com

You will be redirected to the Commento login page. Create a new account and create your first comment.

Congratulations! You have successfully installed Commento on your Linux Mint system.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!