Generate Free Let’s Encrypt SSL on Ubuntu 24.04
Generate a free Let’s Encrypt SSL certificate on Ubuntu 24.04 by installing Certbot with sudo apt install certbot, then running sudo certbot certonly –webroot -w /var/www/html -d srv1.example.com with your own domain. Confirm the domain’s DNS A record points to your server and port 80 is open first. Your web server keeps running during the process.
Install Certbot Client
The Certbot client is a tool that automates the certificate process for Let’s Encrypt on Linux systems. It proves to Let’s Encrypt that you control the domain, downloads the certificate and saves it on your server. It also sets up the renewal job for you. Run the command below to install it. You need a user account with sudo rights, and the server needs internet access to download the package.sudo apt update sudo apt install certbot
Generate a certificate with a web server
You can generate a Let’s Encrypt SSL certificate on Ubuntu 24.04 while an active web server such as Apache or Nginx is running. This is the webroot method. Certbot places a small validation file in your site’s web folder, and Let’s Encrypt fetches it over port 80 to confirm you own the domain. Your web server is not stopped, so there is no downtime. The short version is to make sure your server is reachable from the internet on port 80, then run sudo certbot certonly –webroot -w /var/www/html -d srv1.example.com, replacing the domain with your own. The sections below explain each part. You must ensure that the server is accessible via port 80 for Let’s Encrypt verification from the Internet. Check these three things before you continue:- Confirm that any firewall on the server allows inbound traffic on port 80.
- If the server is in a cloud platform, confirm that the provider’s security group or network firewall also allows port 80.
- Confirm that your web server is running and answering on the domain you want to secure.
sudo certbot certonly --webroot -w /var/www/html -d srv1.example.com
-
- –webroot ==>[use a directory under webroot] .
-
- -w /var/www/html ==>[working directory] .
-
- -d ==> srv1.example.com[fully qualify server hostname] .
- Enter an email address when asked. Let’s Encrypt uses it for expiry warnings and important account notices.
- Read and agree to the terms of service.
- Choose whether to share your email with the Electronic Frontier Foundation. This is optional, and you can decline.
Saving debug log to /var/log/letsencrypt/letsencrypt.log Enter email address (used for urgent renewal and security notices) # for only initial using, register your email address and agree to terms of use # specify valid email address (Enter 'c' to cancel): admin@example.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please read the Terms of Service at agree in order to register with the ACME server. Do you agree? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # agree to the terms of use (Y)es/(N)o: A - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Would you be willing, once your first certificate is successfully issued, to EFF news, campaigns, and ways to support digital freedom. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: A Account registered. Requesting a certificate for srv1.example.com Successfully received certificate. Certificate is saved at: /etc/letsencrypt/live/srv1.example.com/fullchain.pem Key is saved at: /etc/letsencrypt/live/srv1.example.com/privkey.pem This certificate expires on 2025-03-10. These files will be updated when the certificate renews. Certbot has set up a scheduled task to automatically renew this certificate in the background. ........... ...........
/etc/letsencrypt/live//]
That folder holds the certificate chain (fullchain.pem) and the private key (privkey.pem). Keep the private key secret and never share it or post it publicly. Because we used certonly, Certbot only fetched the certificate. It did not change your web server’s configuration, so you still need to point Apache or Nginx at these files and reload the service.
Generate a certificate without a web server
You can generate a Let’s Encrypt SSL certificate on Ubuntu 24.04 without running a web server by using standalone mode. Certbot starts a temporary web server of its own to answer the validation request, then shuts it down.- Stop any service that is using port 80, such as Apache or Nginx. Certbot cannot start its temporary server if the port is already taken.
- Run sudo certbot certonly –standalone -d srv1.example.com, replacing the domain with your actual server address.
- Start your web service again once Certbot has finished.
sudo certbot certonly --standalone -d srv1.example.com
-
- –standalone ==>[use web server features] .
-
- -d ==> srv1.example.com[fully qualify server hostname] .
Saving debug log to /var/log/letsencrypt/letsencrypt.log Requesting a certificate for srv1.example.com Successfully received certificate. Certificate is saved at: /etc/letsencrypt/live/srv1.example.com/fullchain.pem Key is saved at: /etc/letsencrypt/live/srv1.example.com/privkey.pem This certificate expires on 2025-03-10. These files will be updated when the certificate renews. Certbot has set up a scheduled task to automatically renew this certificate in the background. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Renewal
Let’s Encrypt SSL certificates on Ubuntu 24.04 renew automatically because Certbot installs a background timer during setup. You do not need to perform manual renewals for your domains. Certbot checks regularly and only renews certificates that are close to expiry, so most of its runs do nothing. To verify that the timer is active, run the command systemctl status certbot.timer in your terminal and check the schedule it shows. There’s nothing to do, it should automatically renew your certificates. One thing to watch: a certificate issued in standalone mode needs port 80 free when it renews. If your web server uses that port, the renewal can fail, so plan for that if you chose the standalone method on a server that also runs a web service. Run the command below to check the timer’s status.systemctl status certbot.timer
* certbot.timer - Run certbot twice daily
Loaded: loaded (/usr/lib/systemd/system/certbot.timer; enabled; preset: en>
Active: active (waiting) since Mon 2025-03-10 10:13:26 UTC; 1min 17s ago
Trigger: Tue 2025-03-20 10:21:37 UTC; 14h left
Triggers: * certbot.servicesudo certbot renew
sudo openssl pkcs12 -export -in fullchain.pem -inkey privkey.pem -out srv1.example.com.pfx
-
- Free Service: Let’s Encrypt provides cost-free SSL/TLS certificates to improve internet security.
-
- Automated Renewal: Certbot automates the certificate renewal process, ensuring your site remains secure without manual intervention.
-
- Flexible Options: Certificates can be generated with or without an existing web server, offering flexibility based on your server setup.
-
- Scheduled Tasks: Certbot creates system timers to manage the automatic renewal of certificates with minimal user input.
-
- PKCS12 Conversion: Certificates can be converted to different formats, such as PKCS12 (PFX), for wider compatibility across various systems.
Frequently asked questions
How generate ca signed ssl certificate with let's encrypt on Ubuntu24?
Install Certbot with sudo apt install certbot, then run sudo certbot --nginx -d yourdomain.com if you use Nginx. Certbot requests a certificate from Let's Encrypt, a free certificate authority, and installs it for you. Your domain's DNS record must point to the server, and ports 80 and 443 must be open. Certificates last 90 days and renew automatically.
How to get free ssl lets encrypt Ubuntu?
You get a free certificate from Let's Encrypt by installing Certbot and running it with your domain name. Let's Encrypt charges nothing, but it checks that you control the domain first, usually by reaching your server on port 80. Certbot then downloads the certificate and can install it into Nginx or Apache. Certbot renews it automatically before it expires.
How to set up ssl certificate on Ubuntu using letsencrypt?
Install Certbot, then run sudo certbot --nginx -d yourdomain.com, replacing the domain with yours and using --apache if Apache is your web server. Certbot proves you control the domain, downloads the certificate, and updates your site settings. When asked, choose the option to redirect HTTP to HTTPS. Finally, run sudo certbot renew --dry-run to confirm automatic renewal works.
How to install certbot Ubuntu?
Run sudo apt update to refresh the package list, then run sudo apt install certbot. Enter your password when asked, and type Y to confirm if prompted. Certbot is the official command-line tool for getting Let's Encrypt certificates. Check the install by running certbot --version, which prints the installed version number.
How to install aider chat inside Ubuntu 18.04 container?
Ubuntu 18.04 ships with Python 3.6, which is too old for aider-chat. Install a newer Python, such as 3.10 from the deadsnakes PPA, then run python3.10 -m venv aider-env and pip install aider-chat inside that environment. The simpler route is a container based on Ubuntu 22.04 or 24.04, where the default Python works.
Still have a question?
Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.
Did this guide fix your problem?
About the Author
Richard
Tech Writer, IT Professional
Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.
[…] you have already generated a SSL certificate, you can copy the certificates to the NetData directory specified in the config file […]
[…] Generate a free Let’s Encrypt SSL certificate […]