Close Menu
  • Home
  • Life style
    • Beauty tips
    • Exercise & Training
    • Fashion
    • Healthline
  • Exploration
    • Celebrities
    • Business
    • Travel guides
    • Technology
  • Web tutorials
    • Hosting & Servers
    • Blogger guides
    • WordPress guides
  • English
    • Tiếng Việt
    • Hmong
    • English
Facebook YouTube X (Twitter) Instagram
Trending
  • Search Profile or Preferred Sources: Choose the Right Tool for Your Website
  • Set Up Brevo for WordPress: Verify Senders and Test SMTP Email
  • Samsung Galaxy S27 Ultra: 5,700mAh Battery, 60W Charging and Open Questions
  • How to Create a Better-Looking Blogger Comment Box with CSS
  • Amazfit’s Lactate Threshold Update: Use the Data to Run at the Right Effort
  • How to Check Whether Yandex Has Indexed an Article
  • Set Yandex Site Region and Check How Your Website Appears
  • What to Prepare Before Connecting a Website to Yandex Webmaster
Facebook YouTube X (Twitter) Instagram
SaibABCSaibABC
Chú thích cho quảng cáo
  • Home
  • Life style
    1. Beauty tips
    2. Exercise & Training
    3. Fashion
    4. Healthline
    5. View All

    Build a Simple Skincare Routine Without Buying Too Many Products

    30/08/2026

    How to choose mineral sunscreen that does not leave a white cast

    30/08/2026

    What Does PDRN in Cosmetics Do? How to Read Advertising

    30/08/2026

    Skincare While Losing Weight: Keep Skin More Hydrated, Healthy, and Firm

    30/08/2026

    Running in Hot Weather: Read WBGT and Know When to Stop

    19/09/2026

    Exercise With Atrial Fibrillation: How to Start and Progress Safely

    19/09/2026

    Five-Minute Office Exercises: A Snack-Sized Movement Schedule

    30/08/2026

    Strengthen Your Core with 12 Exercises from Beginner to Advanced

    30/08/2026

    Fashion Digital Product Passport: What Can You Read?

    30/08/2026

    Build a Minimalist Wardrobe in 2026: Buy Less, Wear Longer

    30/08/2026

    Winter Travel Fashion: Stylish Outfits for Men and Women

    22/12/2023

    Amazfit’s Lactate Threshold Update: Use the Data to Run at the Right Effort

    28/09/2026

    Running in Hot Weather: Read WBGT and Know When to Stop

    19/09/2026

    Exercise With Atrial Fibrillation: How to Start and Progress Safely

    19/09/2026

    Suunto Run Heart-Rate Tracking After an Update: Check Your Zones Before Running

    19/09/2026

    Amazfit’s Lactate Threshold Update: Use the Data to Run at the Right Effort

    28/09/2026

    Running in Hot Weather: Read WBGT and Know When to Stop

    19/09/2026

    Exercise With Atrial Fibrillation: How to Start and Progress Safely

    19/09/2026

    Suunto Run Heart-Rate Tracking After an Update: Check Your Zones Before Running

    19/09/2026
  • Exploration
    1. Celebrities
    2. Business
    3. Travel guides
    4. Technology
    Featured

    Samsung Galaxy S27 Ultra: 5,700mAh Battery, 60W Charging and Open Questions

    By Nuj Coom29/09/2026
    Recent

    Samsung Galaxy S27 Ultra: 5,700mAh Battery, 60W Charging and Open Questions

    29/09/2026

    Samsung Galaxy S26 Ultra Review: What Makes It Worth Buying—and What Doesn’t

    16/09/2026

    iPhone 18 Pro Max vs Galaxy S26 Ultra: Which One Should You Choose?

    16/09/2026
  • Web tutorials
    1. Hosting & Servers
    2. Blogger guides
    3. WordPress guides
    4. View All

    Let’s Encrypt on Vultr: Enable HTTPS and Automatic Renewal

    09/09/2026

    Install WordPress on Vultr Manually: From Ubuntu to HTTPS

    08/09/2026

    Point Your Domain to a Vultr VPS and Verify the DNS Connection

    08/09/2026

    Set Up an Ubuntu VPS on Vultr: From Account Creation to SSH

    07/09/2026

    How to Create a Better-Looking Blogger Comment Box with CSS

    28/09/2026

    A 90-Day Blog Growth Plan: Write, Measure, and Improve

    26/09/2026

    Blogspot Maintenance: Fix Broken Links, Images, and Slow Pages

    26/09/2026

    How Does Google Find a Blog? The 3 Key Stages Explained

    26/09/2026

    Set Up Brevo for WordPress: Verify Senders and Test SMTP Email

    29/09/2026

    How to Check Whether Yandex Has Indexed an Article

    26/09/2026

    Set Yandex Site Region and Check How Your Website Appears

    26/09/2026

    What to Prepare Before Connecting a Website to Yandex Webmaster

    26/09/2026

    Search Profile or Preferred Sources: Choose the Right Tool for Your Website

    14/10/2026

    Set Up Brevo for WordPress: Verify Senders and Test SMTP Email

    29/09/2026

    How to Create a Better-Looking Blogger Comment Box with CSS

    28/09/2026

    How to Check Whether Yandex Has Indexed an Article

    26/09/2026
  • English
    • Tiếng Việt
    • Hmong
    • English
SaibABCSaibABC
Home»Web tutorials»Hosting & Servers»Configure HTTPS for Apache with Let’s Encrypt on Ubuntu
Hosting & Servers 7 Mins ReadNo Comments

Configure HTTPS for Apache with Let’s Encrypt on Ubuntu

Nuj CoomBy Nuj CoomUpdated:11/09/2026
Facebook Twitter Pinterest LinkedIn Tumblr Email
Chú thích cho quảng cáo

Contents

  1. Introduction
  2. Prerequisites
  3. Step 1 — Install Certbot
  4. Step 2 — Check Apache VirtualHost Configuration
  5. Step 3 — Open HTTP and HTTPS on the Firewall
  6. Step 4 — Issue and install a TLS certificate
  7. Step 5 — Check Certbot automatic renewal
  8. Conclusion
  9. Reference source

Introduction

Let’s Encrypt is a free, automated Certificate Authority (CA) that issues TLS certificates to authenticate servers and encrypt connections between browsers and web servers. Certbot is an ACME client used to request, install, and automatically renew certificates. With the Apache plugin, Certbot can identify the appropriate VirtualHost, add the TLS configuration, and reload Apache after installation (according to ubuntu.com).

In this guide, you will use Certbot to obtain a certificate for Apache on Ubuntu 22.04 or Ubuntu 24.04, enable HTTPS, and verify automatic renewal.

This article uses a separate VirtualHost file for the website rather than modifying Apache’s default configuration. This approach gives each domain an independent configuration and makes the server easier to manage when it hosts multiple websites.

Prerequisites

To follow this guide, you need:

  • An Ubuntu 22.04 or Ubuntu 24.04 server with a non- rootuser, administrative access through sudo , and a configured firewall. You can refer to the Ubuntu server setup guide.
  • A registered domain. In this article, the example domain is your_domain.
  • The domain’s DNS records must point to the server’s public IP address. If you want one certificate to cover both names, create:
    • An A or AAAA record for your_domain, depending on the type of address used by the server.
    • An A or AAAA record for www.your_domain, if the website uses this name.
  • Apache installed with a VirtualHost for the domain, such as /etc/apache2/sites-available/your_domain.conf. See also how to install Apache on Ubuntu.
  • TCP port 80 must be reachable from the Internet when using the HTTP-01 challenge; TCP port 443 must be open so users can access HTTPS (according to the Ubuntu Server documentation).

Step 1 — Install Certbot

Current Ubuntu documentation recommends installing Certbot from the Snap Store. This keeps Certbot updated independently of Ubuntu’s APT package release cycle.

Chú thích cho quảng cáo

If Snap is not yet installed on the server, install snapdit:

sudo apt update
sudo apt install snapd

Then install Certbot:

sudo snap install core
sudo snap refresh core
sudo snap install --classic certbot

If the command certbot is not found after installation, create a link to the executable:

sudo ln -s /snap/bin/certbot /usr/bin/certbot

If the server already has Certbot installed through APT, check the existing package before switching to Snap. Avoid installing two Certbot versions at the same time unless you are sure they use the same renewal mechanism. You can list related packages with:

apt list --installed 2>/dev/null | grep -E 'certbot|python3-certbot'

Check the installed version:

certbot --version

Step 2 — Check Apache VirtualHost Configuration

To automatically obtain and install a certificate, Certbot must find the correct VirtualHost in the Apache configuration. The domain name is taken from the ServerName and ServerAlias. The VirtualHost in use should be enabled in the /etc/apache2/sites-enabled/block.

Open the domain’s VirtualHost file:

sudo nano /etc/apache2/sites-available/your_domain.conf

Make sure the file contains similar lines:

<VirtualHost *:80>
    ServerName your_domain
    ServerAlias www.your_domain
    DocumentRoot /var/www/your_domain
</VirtualHost>

If the website is not enabled, enable the VirtualHost and then check the syntax:

sudo a2ensite your_domain.conf
sudo apache2ctl configtest

The expected result is Syntax OK. If there are no errors, reload Apache and display the VirtualHost list:

sudo systemctl reload apache2
sudo apache2ctl -S

Step 3 — Open HTTP and HTTPS on the Firewall

If you use UFW, allow SSH, HTTP, and HTTPS. Do not close port 80 before completing certificate issuance, because the HTTP-01 challenge verifies control of the domain by sending an HTTP request to the server through this port (according to ubuntu.com).

sudo ufw status
sudo ufw allow OpenSSH
sudo ufw allow 'Apache Full'

If the profile Apache Full does not exist, list the available profiles or open the two web ports directly:

sudo ufw app list
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw status

If you previously allowed a profile intended only for HTTP, you can remove the old rule after confirming that the HTTPS rule works:

sudo ufw delete allow 'Apache'

In addition to UFW, check the firewall provided by your VPS provider, as well as any security group, router, or load balancer. These network layers must also allow incoming traffic on ports 80 and 443.

Step 4 — Issue and install a TLS certificate

Run Certbot with the Apache plugin and specify all domains that need protection:

sudo certbot --apache -d your_domain -d www.your_domain

Certbot will request an email address for alerts, ask you to accept the Terms of Service, and ask whether you want to redirect HTTP to HTTPS. For a public website, redirecting all HTTP traffic to HTTPS is generally appropriate, provided the application does not need to keep HTTP available separately.

Each -d option adds a domain name to the certificate as a Subject Alternative Name (SAN). Therefore, list every domain the certificate must cover in the same command.

After completion, the certificate files are typically located at:

/etc/letsencrypt/live/your_domain/fullchain.pem
/etc/letsencrypt/live/your_domain/privkey.pem

fullchain.pem contains the server certificate and the intermediate certificate chain; privkey.pem is the private key. Do not share the private key or grant read access to users who do not need it. Certbot typically uses paths under the live directory to configure the service.

Certbot will create or update Apache’s HTTPS configuration and then reload the service. Open both https://your_domain and https://www.your_domain to confirm the correct domains, certificate, and redirect settings.

You can use SSL Labs Server Test to check the certificate and TLS configuration through an external service.

Step 5 — Check Certbot automatic renewal

Let’s Encrypt certificates issued under the current default profile still have a 90-day validity period. Let’s Encrypt is rolling out shorter-lived profiles: the tlsserver profile may issue 45-day certificates from May 13, 2026, while the default classic profile is expected to move to 64 days on February 10, 2027, and to 45 days on February 16, 2028. Most users with automatic renewal will not need to make immediate changes, but they should ensure that the renewal schedule does not rely on an excessively long fixed interval (according to Let’s Encrypt.

The Certbot version installed from Snap sets up a systemd timer to attempt renewal twice a day. Check the timer with the command:

sudo systemctl status snap.certbot.renew.timer

Run a test of the renewal process without changing the certificate currently in use:

sudo certbot renew --dry-run

If the result reports that the simulated renewal succeeded, the basic configuration is ready. When the certificate approaches expiration, Certbot will renew it automatically; for certificates installed through the Apache plugin, Apache is reloaded after a successful renewal (according to ubuntu.com).

If the website uses a reverse proxy, load balancer, or network firewall, check its reachability from the Internet and review the logs when the command --dry-run fails. For domains that cannot serve HTTP-01 over port 80, or when a wildcard certificate such as *.example.comis required, you can use the DNS-01 challenge with the corresponding DNS plugin.

Conclusion

You have installed Certbot, checked the Apache VirtualHost, opened the necessary web ports, issued a Let’s Encrypt TLS certificate, and verified the automatic renewal mechanism. After enabling HTTPS, check both the primary domain and the domain www, monitor renewal logs, and address any warnings promptly to prevent the certificate from expiring.

Related reading: Let’s Encrypt on Vultr: Enable HTTPS and Automatic Renewal.

Reference source

  • Obtain TLS certificates
  • Ubuntu Server — Firewall và UFW
  • How to install Apache2
  • Decreasing Certificate Lifetimes to 45 Days
  • Best Practice – Keep Port 80 Open

Chú thích cho quảng cáo
Apache Certbot HTTPS Let’s Encrypt Linux SSL Ubuntu
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Previous ArticleWhat Does Each AI Writing Tool Do Best? 12 Options for Bloggers in 2026
Next Article How to Install the LAMP Stack on Ubuntu: Linux, Apache, MySQL and PHP
Nuj Coom
  • Website
  • Facebook
  • X (Twitter)
  • Instagram

I'm a doctor, for sure. But I also love writing and sharing knowledge, life experiences, web tricks, and useful lectures. Let's cheer for your passion.

Related Posts

Connect a Custom Domain to Blogger and Verify HTTPS Correctly

23/09/2026

Fix Blogger Custom-Domain Errors Before Changing DNS or HTTPS

23/09/2026

WordPress Security for Beginners: Protect Accounts, Data, and Access

17/09/2026
Add A Comment
Leave A Reply Cancel Reply

Latest posts

How to Find Your WordPress Sitemap and Submit It to Yandex Webmaster

How to Read Bing Webmaster Tools Reports and Prioritize the Right SEO Work

Yandex Recrawling: When Should You Use IndexNow?

Repurposing Blog Content: Turn One Article into 5 Formats

Connect Blogger to Search Console: Choose the Right Property

Advertisement
Chú thích cho quảng cáo

SUBSCRIBE TO UPDATES

Get the latest creative news from SaibABC.Com on web tips, design, and business.

Copyright © 2024. Designed by NujCoom.
  • Home
  • Contact
  • Privacy
  • Tiếng Việt
  • Hmong

Type above and press Enter to search. Press Esc to cancel.