This is a sample repository containing a self-sufficient Commento instance running on Docker Compose and using free auto-renewable SSL/TLS certificates provided by Let's Encrypt.
Using this as a starting point, you can set up a self-hosted Commento instance in a matter of minutes.
- You own a domain and a Linux server
- You have
root
shell access to the server
- Install Docker and docker-compose
- Clone the project code to
/opt/commento
, for example:sudo git clone https://github.com/yktoo/commento-docker-compose.git /opt/commento
- Edit
/opt/commento/docker-compose.yml
and update the environment variable values appropriately - Recommended: pre-build and pre-pull the required images:
cd /opt/commento docker-compose -p commento pull docker-compose -p commento build
- Create systemd service symlink, reload the daemon, enable and start the service:
sudo ln -s /opt/commento/etc/commento.service /etc/systemd/system/commento.service sudo systemctl daemon-reload sudo systemctl enable commento.service sudo systemctl start commento.service
- Check the service health with
systemctl status commento.service
- Recommended: check in your changes to a new git repository for future use
To stop and clean containers up manually (comments and SSL/TLD certificates are always retained):
cd /opt/commento
docker-compose -p commento down -v
To rebuild the Docker images, for example if you want to upgrade to a newer version of Commento/PostgreSQL/Nginx:
cd /opt/commento
docker-compose -p commento pull
docker-compose -p commento build
# Restart the service
sudo systemctl restart commento.service
To back up the database, the easiest way is to make a dump of the commento
database.
First, set up a passwordless login to your server using public key authentication.
Then you can export the entire commento
database using the command:
ssh YOUR_SERVER_HOST docker exec -t commento_postgres_1 pg_dump -U postgres -d commento > /path/to/dump.sql