How to Add a Domain and SSL Certificate
How to Add a Domain and SSL Certificate
- Point your domain's A record to your server's IP address at your DNS provider.
- Install Certbot for free SSL certificates:
# Ubuntu/Debian apt install certbot python3-certbot-nginx -y # CentOS/AlmaLinux dnf install certbot python3-certbot-nginx -y - Obtain and install the certificate:
certbot --nginx -d yourdomain.com -d www.yourdomain.com - Follow the prompts to configure automatic HTTPS redirection.
- Certbot auto-renews certificates. Verify the timer is active:
systemctl status certbot.timer
For Apache
# Ubuntu/Debian
apt install certbot python3-certbot-apache -y
certbot --apache -d yourdomain.com -d www.yourdomain.com
# CentOS/AlmaLinux
dnf install certbot python3-certbot-apache -y
certbot --apache -d yourdomain.com -d www.yourdomain.com