Install Certbot
You can use free SSL certification by Let’s Encrypt. First, you should install certbot to use Let’s Encrypt.
$ sudo pacman -S certbot certbot-nginx
Certificate sites
To certificate domain www.lama-lab.mydns.jp and nc.lama-lab.mydns.jp, type
$ sudo certbot --nginx --agree-tos --domain example.com --email 'email@example.com' --no-eff-email
Configure Firewall
$ sudo ufw allow https
$ sudo ufw reload
Scheduling Certification renew
The certification will be expired every 3 months. So you should renew the certification automatically.
$ sudo vi /etc/cron.daily/certbot-renew
#!/bin/sh
certbot renew --post-hook "systemctl reload nginx"
Change the permission of the script.
$sudo chmod 755 /etc/cron.daily/certbot-renew
Note: How to delete a certification
To delete a certification, type
$ sudo certbot delete --cert-name www.lama-lab.mydns.jp
Last Updated on March 8, 2025 by lama-admin
Leave a Reply