How to Install Commento on Debian Latest

In this tutorial, we will learn how to install Commento on Debian latest. Commento is a lightweight and customizable commenting system that can be integrated into your website or blog. It is also open source and comes with a range of features such as spam protection, social media login, and multi-language support.

Prerequisites

Before we proceed, make sure you have the following prerequisites:

Step 1 - Install Git and Docker on Debian

First, we need to install Git and Docker on Debian. This can be done by running the following command:

$ sudo apt-get update
$ sudo apt-get install git docker docker-compose

Step 2 - Clone Commento Repository

Next, we will clone the Commento repository from GitLab by running the following command:

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

This will create a new directory called commento in your current working directory.

Step 3 - Configure Commento

Before we start the Commento server, we need to configure it by creating a new file called .env in the commento directory.

Create a new file by running the following command:

$ cd commento
$ nano .env

Add the following content to the file:

DATABASE_URL=postgres://commento:commento@localhost:5432/commento
COMMENTO_ORIGIN=https://yourdomain.com
COMMENTO_PORT=8080

Replace yourdomain.com with your actual domain name.

Step 4 - Start Commento Server

Once you have configured Commento, run the following command to start the server:

$ docker-compose up -d

This will download and start the required containers for Commento.

Step 5 - Configure Web Server

Now, we need to configure our web server to proxy the Commento traffic.

Nginx Configuration

server {
    listen 80;
    server_name yourdomain.com;

    location / {
        return 301 https://$host$request_uri;
    }
}

server {
    listen 443 ssl;
    server_name yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;

    location ^~ /commento {
        proxy_pass http://localhost:8080;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
        proxy_buffering off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Restart Nginx to apply the changes:

$ sudo systemctl restart nginx

Apache Configuration

<VirtualHost *:80>
    ServerName yourdomain.com
    Redirect permanent / https://yourdomain.com/
</VirtualHost>

<VirtualHost *:443>
    ServerName yourdomain.com

    SSLEngine On
    SSLCertificateFile /etc/letsencrypt/live/yourdomain.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/yourdomain.com/privkey.pem

    ProxyPass /commento http://127.0.0.1:8080/commento
    ProxyPassReverse /commento http://127.0.0.1:8080/commento
    ProxyPassReverseCookieDomain 127.0.0.1 yourdomain.com
    ProxyPreserveHost On

    ErrorLog ${APACHE_LOG_DIR}/commento_error.log
    CustomLog ${APACHE_LOG_DIR}/commento_access.log combined
</VirtualHost>

Restart Apache to apply the changes:

$ sudo systemctl restart apache2

Step 6 - Access Commento

You can now access Commento by navigating to https://yourdomain.com/commento/admin in your web browser.

Login with the default credentials:

It is highly recommended to change your password after logging in for the first time.

Conclusion

That's it! You have successfully installed and configured Commento on Debian latest. Now you can integrate Commento into your website or blog and enjoy its features.

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!

Alternatively, for the best virtual desktop, try Shells!