How to setup SSL Certificate in Nginx on Ubuntu 20.04

How to setup SSL Certificate in Nginx on Ubuntu 20.04

Date: 24-07-2021

Step 1: Once your certificate request is approved, you can download your SSL and intermediate certificates.

Step 2: Login to your server via SSH.

Step 3: Create a directory like below and upload the downloaded the private key, certificate and intermediate bundle files by using SFTP or SSH.
# sudo mkdir /etc/nginx/ssl

Step 4: Navigate to the SSL folder.
# cd /etc/nginx/ssl

Step 5: Combine your SSL certificate and the intermediate bundle into one file. You can use below command.
# sudo cat f84e111a2f44c1106.crt gd_bundle-g2-g1.crt >> domainname.crt

Step 6: Update below lines in the Nginx config file under the 443 section to use the SSL certificate.
=====
ssl_certificate /etc/nginx/ssl/domainname.crt;
ssl_certificate_key /etc/nginx/ssl/domainname.key;

=====
Note: domainname.key – Private key
domainname.crt – Combined certificate file

Step 7: Restart the Nginx service.
# nginx -t
# systemctl restart nginx
# systemctl status nginx

Your SSL Certificate is installed. You can verify this in your browser.

Thank you!

admin

Our team has expertise across software and web development, WordPress, e-commerce, mobile applications, UI/UX, cloud and infrastructure, DevOps, CI/CD, API integration, security, testing, automation, and technical support. The team also works with AI-based software solutions, LLMs, AI workflows, AI agents, and intelligent application development to help businesses automate processes and build smarter digital solutions. We focus on developing, deploying, maintaining, and optimising secure, scalable, and reliable technology solutions while helping businesses adopt modern technologies and drive digital transformation.

Leave a Reply

Scroll to Top