Creating SSL Certificates
Our guide to creating SSL Certificates
Step 1: Installing Certbot
First we need to install certbot
bash
sudo apt install -y python3-certbot-nginx
bash
sudo apt install -y python3-certbot-apache
bash
sudo apt install -y certbot
Step 2: Creating the Certificate
Then we are going to create the certificate
Step 1: Stopping the webserver
IMPORTANT
Make sure you are not running anything on port 80 if you are running anything on port 80 certbot will not work. You can check this by running: sudo lsof -i :80
bash
sudo systemctl stop nginx
bash
sudo systemctl stop apache2
Step 2: Creating the certificate
IMPORTANT
Make sure to replace example.com with the domain name you want to use.
bash
certbot certonly --nginx -d example.com
bash
certbot certonly --apache -d example.com
bash
certbot certonly --standalone -d example.com
Renewing
And now you are done. The certificates will however need to be renewed often. You can do this manualy by running certbot renew
or you can setup a cronjob to do it for you:
First open your crontab: crontab -e
Then you set this cronjob in it to do the renewing for you every day at 23:00
IMPORTANT
Make sure to replace nginx with the webserver that you are using.
bash
0 23 * * * certbot renew --quiet --deploy-hook 'systemctl restart nginx'