ssl,

How to generate Let's Encrypt Certificate using Certbot on Amazon Linux 2

Apr 18, 2023 · 1 min read · Post a comment

If you already have Certbot installed on Amazon Linux 2, then generating Let’s Encrypt shouldn’t be a problem. Let’s see what’s the solution.

Prerequisites

  • sudo privileges
  • certbot installed

Solution

  • Make sure that your domain name is pointed to your Amazon Linux 2 instance’s IP address. You can check this by running the following command:
    host your_domain_name
    
  • The above command should return your instance’s IP address. Once that sorted you can generate Let’s Encrypt certificate by running the following command:
    sudo certbot --nginx -d your_domain_name
    
  • Certbot will automatically configure NGINX to use the new certificate. You can confirm that the configuration was successful by running the following command:
    sudo nginx -t
    
  • Restart NGINX to apply the new configuration with the following command:
    sudo systemctl restart nginx
    

Conclusion

Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.