Here are the steps to install Let’s Encrypt SSL on Ubuntu with Certbot:
- First, update your Ubuntu system by running the following command:
sudo apt update
- Install the Certbot package by running the following command:
sudo apt install certbot
- Once Certbot is installed, you can use it to obtain and install an SSL certificate for your domain. To obtain a certificate, run the following command:
sudo certbot certonly --webroot --webroot-path /var/www/html -d example.com -d www.example.com
Replace example.com and www.example.com with your own domain name(s). This command will generate the necessary files and store them in /etc/letsencrypt/live/.
- Once the SSL certificate is obtained, you can configure your web server to use it. For example, if you’re using Apache, you can enable SSL and configure it to use the certificate by running the following commands:arduino
sudo a2enmod ssl
sudo systemctl restart apache2
sudo nano /etc/apache2/sites-available/default-ssl.conf
In the default-ssl.conf file, find the following lines and update them with the appropriate values:
bashSSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
Replace these lines with the following:
bashSSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
Save and close the file.
- Finally, restart Apache to apply the changes:
sudo systemctl restart apache2
Your website should now be using a valid SSL certificate from Let’s Encrypt.