Categories
Tech

Adding SSL to a Digital Ocean Droplet

…was not as big a pain in that ass as I thought it would be.

I created a droplet for this dump and had arranged the DNS settings accordingly. The last thing I needed to do was add HTTPS with an SSL certificate. To handle that, we need to pop open the droplet’s console via your very own SSH connection OR via the Digital Ocean dashboard. Once that’s open, we’ll need two run commands that will do three things:

  1. Stop our Apache web server
  2. Run certbot to install SSL via Letsencrypt
  3. Restart the Apache server

Successfully installing SSL on our droplet will mean that we will have to first STOP the web server software before running our SSL installing.

To accomplish step 1, make sure we have the console open and ready to take commands. Here’s the command to stop Apache:

sudo service apache2 stop

Once that command runs error-free for us, we can install our SSL with certbot.

certbot --apache

Once that install script gets rolling, it’ll ask you the following:

Which names would you like to activate HTTPS for?

You will want ALL names listed so that SSL will be installed for ALL subdomains. This means you won’t need to enter anything and can simply hit the ENTER key.

Once the script is complete and get a successful installation, we’ll need to restart our Apache web server! Simply paste the following code and hit enter:

sudo service apache2 start

If you’re the curious type, you’ll want to test Apache via command line even further. The following lines of code can be entered separately:

sudo service apache2 restart
sudo service apache2 status

Leave a Reply

Your email address will not be published. Required fields are marked *