Prerequisites
Before going forward, make sure you have the following prerequisites:- A server with root access
- A domain name or IP address
- A web server that can be used to serve static files
- Nginx installed and configured on the machine
Install Certbot and the Nginx Plugin
First, install Certbot and the Nginx plugin using the following command:Configure Nginx
Edit your Nginx configuration file to include your server name. Open the file with a text editor:server_name directive:
Create an A Record in Your Domain Registrar
Log in to your domain registrar (e.g., GoDaddy) and create anA record pointing to the IP address of your server.
- Record Type: A
- Name: test.chaicode.com
- Value: IPv4 address of the server
Obtain an SSL Certificate
Run Certbot to obtain an SSL certificate for your subdomain:- Enter the email address associated with your domain registrar account.
- Accept the terms of service.
- Press Enter to continue.
Access Your Site
You can now access your site using HTTPS:Renewing the Certificate
To check if the certificate is close to expiring, run:Summary
In this guide, we learned how to set up SSL for Nginx on Ubuntu using Certbot. We installed Certbot and the Nginx plugin, configured Nginx, created an A record in your domain registrar, and obtained an SSL certificate. We also learned how to renew the certificate.Next: Deploy Node API with Nginx
Continue your journey by learning how to deploy a Node API with Nginx on Ubuntu server.



