Certbot issues free Let's Encrypt certificates and renews them automatically.
- Make sure your domain's A record points to your server IP.
- Install Certbot (Nginx example on Ubuntu/Debian):
sudo apt install certbot python3-certbot-nginx - Request the certificate:
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com - Test automatic renewal:
sudo certbot renew --dry-run
For Apache, use python3-certbot-apache and --apache instead. Port 80 must be open in your firewall for the validation to work.