In the last post, I wrote the way to set up the commento on Ubuntu 20.04 with the binary file. It did works on my VPS. But the problem is very big, it is not updated. The latest binary release is v1.8.0. which is published on April 10, 2020, almost 10 months ago. After that, there is a lot of bug fixed committed on its master branch.

So, I did research to find a way to compile the Commento from the Source.

Let me put it step by step.

Ubuntu 20.04 lts. Nginx web server.

Setting up the environment.

Install the development dependencies.

sudo apt update
sudo apt install build-essential golang go-dep

Install Yarn

curl -sS | sudo apt-key add -
echo "deb stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn

Check the version

 yarn --version

Yes, my installation is yarn v1.22.5

Optional Go Upgrades

sudo apt install software-properties-common
[[ $(lsb_release -sr) < "18.04" ]] && sudo apt install python-software-properties
# This PPA contains an up-to-date version of Go
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt install golang

I am going to replace the binary Commento with the compiling version. So the Postgresql database is the same one. If you want to do a fresh installation, you should check my previous post for Postgresql installation part.

Compiling Commento

cd /home/davidyin/
$ git clone
$ cd commento
$ make prod

Now my compiling Commento located at ~/commento/build/prod/

Change the  Service file and Config file.

sudo nano /etc/systemd/system/commento.service

Change the content as below: the ExecStart, and EnvironmentFile

Description=Commento daemon service postgresql.service

Add a new config file.

nano /home/davidyin/commento/build/prod/commento.conf

Add the content below:

# Commento
# Network settings
## This should be set to the subdomain or the IP address hosting Commento. All API requests will go to this server. This may include subdirectories if Commento is hosted behind a reverse proxy, for example. Include the protocol in the value to use HTTP/HTTPS.
## The port to bind the Commento server to. Defaults to 8080.
## The address to bind the Commento server to. Useful if the server has multiple network interfaces. If not specified, this value defaults to COMMENTO_ORIGIN.
# Database settings
COMMENTO_POSTGRES="user=commento password=yourown_password host=/var/run/postgresql/ port=5432 dbname=commento sslmode=disable"
# Configuration file
## A configuration file for Commento. Useful to store secrets and credentials. No config file will be loaded by default, if left unspecified.
# Forbid registration of new users
## Used to disable new dashboard registrations. Useful if you are the only person using Commento on your server. Does not impact the creation of accounts for your readers. Defaults to false.
# Static files settings
## If you want to store the binary in a different directory from the static assets, set this directory to point to the static assets (HTML, JS, CSS, email templates and database migrations). Defaults to the same directory as the binary.
## If set to true, all static content will be served GZipped if the client's browser supports compression. Defaults to false.
# SMTP settings
## SMTP credentials and configuration the server should use to send emails. By default, all settings are empty and email features such as email notification and reset password are turned off.
# Akismet API key
## Create a key in your Akismet dashboard. By default, Akismet integration is turned off when this value is left empty.
# Google OAuth configuration
## Create a new project in the Google developer console ( to generate a set of credentials. By default, Google login is turned off when these values are left empty.
# GitHub OAuth configuration
## Create a new OAuth app in GitHub developer settings ( to generate a set of credentials. By default, GitHub login is turned off when these values are left empty.
# Gitlab OAuth configuration
## Create a new application in your GitLab settings ( to generate a set of credentials. By default, GitLab login is turned off when these values are left empty.
# Twitter OAuth configuration
## Create an app in the Twitter developer dashboard ( to generate a set of credentials. By default, Twitter login is turned off when these values are left empty.

Restart Commento

sudo systemctl restart commento

Now it is the latest version. Most important is the Twitter account avatar link is fixed.

David Yin

David is a blogger, geek, and web developer — founder of If you like his post, you can say thank you here

Leave a Reply

Your email address will not be published. Required fields are marked *