Skip to content

Instantly share code, notes, and snippets.

@tsraveling
Last active March 5, 2025 16:49
Show Gist options
  • Save tsraveling/f456b07ac46eb10c7d066b8c615f89ed to your computer and use it in GitHub Desktop.
Save tsraveling/f456b07ac46eb10c7d066b8c615f89ed to your computer and use it in GitHub Desktop.
Install SSL Certbot on Ubuntu Server
  1. SSH into the VM instance
  2. Check if certbot is not installed. If it’s not, install it with the following command:
    • sudo apt-get install certbot python3-certbot-nginx
  3. Check nginx’s domain configurations.
    • In /etc/nginx/sites-available should be a file with the domain configurations
    • In /etc/nginx/sites-enabled should be a symlink to the previous nginx domain config file
  4. Create the SSL certificate running the following command:
    • sudo certbot --nginx
    • This will prompt you for some information. Pretty straightforward.
  5. Once finished, check the nginx configs in step 3. You should see that it uses the new SSL certificate for the 443 virtual server.
  6. Reload the domain in the browser, you should have SSL now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment