How to Install Let's Encrypt SSL in Nginx on CentOS Stream 9

To install Let's Encrypt SSL on Nginx running on CentOS Stream 9, follow these steps:

Step 1 : Ensure the domain is DNS-ready for verification.

Step 2 : Update your system:

Step 3 : Install Certbot and python3-certbot-nginx:

Step 4 : Create a configuration file for your domain (e.g., example.devtutorial.io) and add the necessary configurations.

Inside the configuration file, add the following basic setting

Step 5 : Create a directory for the domain and an index.html file:

Step 6 : Update SELinux file context (if using SELinux)

Step 7 : Test the Nginx configuration:

Step 8 : Restart Nginx:

Step 9 : Obtain SSL certificate:

- Enter your email address when prompted.

- Agree to the terms of service by typing 'y'.

- Share your email address with the Electronic Frontier Foundation if you wish ('y').

- Once successful, you will receive a confirmation message.

Step 10 : Test certificate renewal:

Step 11 : Visit your domain to verify the SSL installation.

Congratulations, you have successfully installed Let's Encrypt SSL on Nginx running on CentOS Stream 9.