My website initially run without domain (only droplet IP), that’s why i skipped the SSL installation part in the very beginning configuration. I have domain for my site now and want to install the Let’s Encrypt to my site. Any instruction that can help on this? Many thanks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
This would require a few steps. And before making any changes, it’s crucial to back up your entire WordPress site (including databases and files). You can take a manual backup of your files and database or backup your Droplet directly.
Once you have your backup you can follow these steps:
Update Apache Virtual Host
/etc/apache2/sites-available/
. The file name would typically match your domain name or if it is the default one it could be calleddefault
orwordpress
.ServerName
directive is set to your domain, and add aServerAlias
for thewww
version of your domain. It should look something like this:Install Certbot and Obtain SSL Certificate
Update WordPress URLs
http://
tohttps://
.wp-admin
area, you would need to access your database with a tool like PHPmyAdmin or any other MySQL client, and update the velues of the site and home URLs in yourwp_options
table.That would be pretty much it, next, you can test Your SSL Certificate, by visiting your website with
https://
to confirm that SSL is working correctly.A few things that you need to keep in mind:
http://your_ip_address
withhttps://yourdomain.com
.Hope that this helps!
Best,
Bobby
Heya @quangrmit,
Here are the general steps you need to follow:
Update Your Server: Ensure your server is updated. For a Linux server, you can typically do this with commands like
sudo apt update
andsudo apt upgrade
.Install Certbot: Certbot is the software that will obtain a free SSL certificate from Let’s Encrypt and automatically enable HTTPS on your website. You can install it with a command like
sudo apt install certbot
.Choose Web Server and System: Certbot needs to know the web server you are using (e.g., Apache, Nginx) and your operating system (e.g., Ubuntu, Debian).
Run Certbot: Execute Certbot with a command like
sudo certbot --apache
orsudo certbot --nginx
, depending on your web server. Certbot will guide you through the process.Domain Verification: Certbot will ask for the domain names you want to activate HTTPS for. It will also handle the verification of your domain to ensure you own it.
Configure Automatic Renewal: Let’s Encrypt certificates are valid for 90 days. It’s recommended to set up automatic renewal. This can usually be done by editing the crontab file with
sudo crontab -e
and adding a line like0 12 * * * /usr/bin/certbot renew --quiet
.Make sure to do a backup of your Droplet prior to doing that. You can use the Snapshost feature for that:
https://docs.digitalocean.com/products/images/snapshots/