Install Certbot ​
Instructions for installing Certbot for Apache2 and Nginx on a root server.
With Certbot you can set up free TLS/SSL certificates from Let's Encrypt.
Certbot via Snap (recommended) ​
Update system
First update the system of your root server. Open the console and enter the following command:
apt update && apt upgrade -yapt update && apt upgrade -yInstall Snap
Install Snap by entering the following commands in the console:
sudo apt install snapd sudo snap install core sudo snap refresh coresudo apt install snapd sudo snap install core sudo snap refresh coreinstall Certbot
sudo snap install --classic certbotsudo snap install --classic certbotmake Certbot command available
sudo ln -s /snap/bin/certbot /usr/bin/certbotsudo ln -s /snap/bin/certbot /usr/bin/certbotuse Certbot
- For Apache2:
sudo certbot --apachesudo certbot --apache- For Nginx:
sudo certbot --nginxsudo certbot --nginxCheck certificates
- You can find certificates under:
/etc/letsencrypt/live/<your-domain>//etc/letsencrypt/live/<your-domain>/- Show status:
sudo certbot certificatessudo certbot certificatesCheck automatic renewal
Certbot automatically creates a cronjob. You can use the following command to test whether the automatic renewal works correctly:
sudo certbot renew --dry-runsudo certbot renew --dry-run
Certbot via APT ​
⚠️ Note
This method often installs outdated versions. Only use it if snap is not possible.
Update system
First update the system of your root server. Open the console and enter the following command:
apt update && apt upgrade -yapt update && apt upgrade -yinstall Certbot
- For Apache2:
sudo apt install certbot python3-certbot-apachesudo apt install certbot python3-certbot-apache- For Nginx:
sudo apt install certbot python3-certbot-nginxsudo apt install certbot python3-certbot-nginxuse Certbot
- For Apache2:
sudo certbot --apachesudo certbot --apache- For Nginx:
sudo certbot --nginxsudo certbot --nginxCheck certificates
- You can find certificates under:
/etc/letsencrypt/live/<your-domain>//etc/letsencrypt/live/<your-domain>/- Show status:
sudo certbot certificatessudo certbot certificatesCheck automatic renewal
Certbot automatically creates a cronjob. You can use the following command to test whether the automatic renewal works correctly:
sudo certbot renew --dry-runsudo certbot renew --dry-run
ℹ️ Important
The domain must point to the server (A or AAAA entry), and port 80 (HTTP challenge) must be accessible - otherwise the validation will fail.