How to Setup Let's Encrypt SSL with NGINX on Ubuntu 24.04 server

samuel_tobaoyetola_c2ad5

Samuel Oyetola

Posted on May 16, 2024

How to Setup Let's Encrypt SSL with NGINX on Ubuntu 24.04 server
  • Install NGINX: If you haven't already installed NGINX on your Ubuntu 24.04 you can do so using the package manager

$sudo apt update
$sudo apt install nginx

  • Copy your default configuration file to your domain configuration file created (change myapp.com to your domain name)

$cp /etc/nginx/sites-available/default /etc/nginx/sites-available/myapp.com

  • Setup ssl for your domain by editing the domain configuration file, look for server_name _; and add your domain name in front of server_name _;

$nano /etc/nginx/sites-available/myapp.com
server_name myapp.com www.myapp.com; and save the configuration file

  • Unlink your default configuration file so that you can enable your domain configuration file

$unlink /etc/nginx/sites-enabled/default

  • Link your domain ( This automatically enable your domain configuration file)

$ln -s /etc/nginx/sites-available/myapp.com /etc/nginx/sites-enabled/myapp.com

After enable the domain you can then test

$nginx -t

Image description

$service nginx restart

  • Install Certbot for Let's encrypt SSL

$sudo apt-add-repository -r ppa:certbot/certbot (Press Enter)

Image description

$sudo apt install -y certbot python3-certbot-nginx

$certbot --nginx -d myapp.com -d myapp.com

Image description

💖 💪 🙅 🚩
samuel_tobaoyetola_c2ad5
Samuel Oyetola

Posted on May 16, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024

How to Use KitOps with MLflow
beginners How to Use KitOps with MLflow

November 29, 2024

Modern C++ for LeetCode 🧑‍💻🚀
leetcode Modern C++ for LeetCode 🧑‍💻🚀

November 29, 2024