Setting Up Free HTTPS with Let's Encrypt on Ubuntu Server

Time to Implement HTTPS
Hello.
Last time, we learned how to connect a domain and operate multiple websites on a single Ubuntu Server.
Now most of the web service environment is set up.
But one important thing remains.
That's HTTPS.
Modern browsers now display warnings for sites without HTTPS, showing "Not Secure." Search engines also recommend HTTPS-enabled sites, and users trust sites with a lock icon more.
This time, we'll create a secure HTTPS website by applying a free SSL certificate.
The Difference Between HTTP and HTTPS
Most websites we use have two types of addresses:
http://example.com
And
https://example.com
At first glance, it's just one letter difference, but the meaning is significant.
HTTP transmits data without encryption.
In contrast, HTTPS encrypts data during transmission, keeping personal information and login details much more secure.
Most websites now use HTTPS by default.
What is an SSL Certificate?
To use HTTPS, you need an SSL certificate.
An SSL certificate:
Verifies that the server is legitimate
Encrypts communication between the user and the server
In the past, SSL certificates were often purchased for a fee,
but thanks to Let's Encrypt, anyone can now use them for free.
About Let's Encrypt
Let's Encrypt is a service that provides free SSL certificates.
It's currently the most widely used free certificate authority (CA) worldwide.
The benefits include:
Free of charge
Automatic renewal capability
Simple installation
Supported by all major browsers
Available for both individuals and businesses
It's extensively used on real production servers.
Installing Certbot
To obtain a Let's Encrypt certificate, we use the Certbot program.
First, update your package list:
sudo apt update
Then install Certbot and the Nginx plugin:
sudo apt install certbot python3-certbot-nginx -y
Once installed, you're ready to issue an SSL certificate.
Issuing the SSL Certificate
Now let's issue an SSL certificate for your domain.
For example, if using:
example.com
Run this command:
sudo certbot --nginx -d example.com -d www.example.com
Certbot automatically handles:
Certificate issuance
Modifying Nginx configuration
Applying HTTPS
So you don't need to manually configure complex settings.
How the Certification Process Works
Certbot first verifies that your domain points to your server.
After verification, it issues the SSL certificate and automatically modifies the Nginx configuration to apply HTTPS.
This means most settings are handled automatically without manual intervention.
Verifying HTTPS Implementation
Once installed, access your site via:
https://example.com
If properly implemented, you'll see a 🔒 lock icon in the browser address bar.
Your website is now serving securely with encryption.
Automatically Redirecting HTTP to HTTPS
It's recommended that when users access:
http://example.com
they're automatically redirected to:
https://example.com
Certbot asks during installation whether you want automatic redirection.
We recommend selecting automatic redirect for production servers.
Certificate Validity Period
Let's Encrypt certificates aren't permanent.
The validity period is 90 days.
But don't worry—automatic renewal can be set up for continuous use.
Testing Automatic Renewal
To verify that automatic renewal works properly, run:
sudo certbot renew --dry-run
This command tests renewal without actually performing it.
If completed successfully with no errors, automatic renewal is properly configured.
How Automatic Renewal Works
In Ubuntu, Certbot automatically handles the renewal process.
It periodically checks certificates and issues new ones when expiration approaches.
So unless there's a problem, you rarely need to manually renew them.
SSL Certificate Location
Certificates are stored in:
/etc/letsencrypt/
This folder contains:
Certificates
Private keys
Configuration files
Because this folder holds important security files, avoid modifying or deleting them.
Checking Certificate Information
To view currently installed certificates, use:
sudo certbot certificates
You can check information like:
Verified domains
Expiration date
Storage location
This command is frequently used during server operation.
Why HTTPS Matters
HTTPS isn't just about security—it offers additional benefits:
Protects personal information
Encrypts login credentials
Improves search engine SEO rankings
Increases browser trust ratings
Eliminates security warnings
Today, HTTPS has become a standard requirement for websites.
SSL Isn't Working? Troubleshooting
If SSL certificate issuance fails, check these items:
Whether your domain correctly points to the server
If DNS propagation is complete
If port 80 is open
If Nginx is running properly
If your domain name is spelled correctly
Checking these five items usually resolves most issues.
What We Learned Today
This session covered how to use Let's Encrypt for free SSL certificates and apply HTTPS, including setting up automatic renewal for a production server environment.
Your website is now equipped with modern security features as part of a complete web service setup.
In the next lesson, we'll build a Reverse Proxy to operate PHP, Node.js, Spring Boot, and Flask services together on a single server.
Key Takeaways
HTTPS encrypts data for secure transmission.
An SSL certificate is required to use HTTPS.
Let's Encrypt provides free SSL certificates.
Certbot makes it easy to issue SSL certificates.
Certificate validity is 90 days, with automatic renewal possible.
For production servers, automatically redirecting HTTP to HTTPS is recommended.
HTTPS improves security and SEO performance.
Next Lesson Preview
9. Building a Reverse Proxy (Connecting Node.js, Spring Boot, Flask Services)
In the next lesson, we'll use Nginx's Reverse Proxy feature to operate PHP, Node.js, Spring Boot, and Flask services simultaneously on a single Ubuntu Server.
FAQ
Why is HTTPS important for my website?
HTTPS encrypts data transmission, improves security, increases browser trust, and boosts search engine rankings.
How long does a Let's Encrypt certificate last?
Let's Encrypt certificates are valid for 90 days but can be automatically renewed without manual intervention.
Korean Source
This article is an English localization of a Korean-language report from BlogScore. Original: [Ubuntu 서버 구축] 8강. Let's Encrypt 무료 SSL 적용과 HTTPS 자동 갱신 설정하기