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»Install Let’s Encrypt SSL on Ubuntu with OpenLiteSpeed and Auto-Renewal
Hosting & Servers 9 Mins ReadNo Comments

Install Let’s Encrypt SSL on Ubuntu with OpenLiteSpeed and Auto-Renewal

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

Contents

  1. What you will complete
  2. Prerequisites and values to replace
  3. Install Certbot on Ubuntu
  4. Choose the validation method
    1. Recommended: webroot validation
    2. Alternative: standalone validation
  5. Configure the certificate in OpenLiteSpeed
  6. Confirm the HTTPS listener and redirect HTTP
  7. Configure automatic renewal and reload OpenLiteSpeed
  8. Test renewal before relying on it
  9. Verify the complete HTTPS setup
  10. Common failures and safe fixes
    1. HTTP-01 validation fails
    2. The certificate renewed but the browser shows the old certificate
    3. The deploy hook fails
  11. Rollback plan
  12. When to use OpenLiteSpeed’s native ACME instead
  13. Reference source

Quick answer: For an existing OpenLiteSpeed site, use Certbot’s webroot authenticator so the site stays online, point OpenLiteSpeed to Let’s Encrypt’s fullchain.pem and privkey.pem, then add a Certbot deploy hook that gracefully restarts OpenLiteSpeed after a successful renewal. You need a public DNS record, an HTTP listener on port 80, an HTTPS listener on port 443, and the correct document root.

This route obtains a certificate but does not automatically edit OpenLiteSpeed’s configuration. OpenLiteSpeed also includes a native ACME feature that can issue and renew certificates from the server itself; choose one certificate-management method for each site rather than configuring both for the same certificate.

What you will complete

  • Install the current Certbot snap on Ubuntu.
  • Request a certificate for example.com and, optionally, www.example.com.
  • Configure OpenLiteSpeed to use the certificate and private key.
  • Redirect ordinary HTTP requests to HTTPS.
  • Make renewal reload OpenLiteSpeed without manual intervention.
  • Verify the certificate, renewal timer, HTTP challenge path, and rollback path.

Prerequisites and values to replace

Use a shell on the Ubuntu server, either through SSH or the provider’s console. Replace every placeholder in the commands below before running them.

  • example.com: your domain name.
  • www.example.com: an optional second hostname that resolves to the same server.
  • admin@example.com: an email address for Certbot account notices.
  • /var/www/example.com: the document root actually used by the OpenLiteSpeed virtual host.

Before continuing, confirm that the domain’s A or AAAA record points to this server, the site is reachable over HTTP, and the server can receive inbound TCP connections on ports 80 and 443. HTTP-01 validation places a temporary token under /.well-known/acme-challenge/ and can only use port 80 (according to letsencrypt.org).

Find the OpenLiteSpeed document root in WebAdmin under Virtual Hosts → your virtual host → General → Document Root. If you use a hosting panel, use the panel’s displayed document root instead of guessing it.

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

Install Certbot on Ubuntu

Run these commands in the Ubuntu shell. The Snap package is the recommended Certbot installation method in the Ubuntu documentation (according to ubuntu.com).

sudo apt update
sudo apt install -y snapd
sudo snap install core
sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/local/bin/certbot

If the last command reports that the link already exists, inspect it instead of replacing it:

ls -l /usr/local/bin/certbot
certbot --version

Do not install the obsolete certbot-auto. If an older Ubuntu package is installed and you deliberately want Certbot to be managed by Snap, remove only the old package after checking what depends on it:

apt-cache policy certbot
sudo apt remove certbot

Choose the validation method

For a public OpenLiteSpeed website, the webroot method is normally the least disruptive because it keeps the web server running. Certbot writes a temporary file into the site’s document root, and Let’s Encrypt retrieves it through HTTP.

Recommended: webroot validation

First test that OpenLiteSpeed serves files from the expected document root:

sudo mkdir -p /var/www/example.com/.well-known/acme-challenge
printf 'acme-test\n' | sudo tee /var/www/example.com/.well-known/acme-challenge/test.txt
curl -i http://example.com/.well-known/acme-challenge/test.txt

Expected result: an HTTP 200 response containing acme-test. If the response is 301, 403, or 404, fix the OpenLiteSpeed virtual-host mapping, rewrite rules, permissions, or firewall before requesting the certificate.

Request the certificate. Run one command with each domain that should appear on the certificate:

sudo certbot certonly --webroot \
  -w /var/www/example.com \
  -d example.com \
  -d www.example.com \
  --email admin@example.com \
  --agree-tos \
  --no-eff-email

For a site that does not use www, omit -d www.example.com. A successful request reports the certificate and key locations, normally under:

/etc/letsencrypt/live/example.com/fullchain.pem
/etc/letsencrypt/live/example.com/privkey.pem

The privkey.pem file is sensitive. Do not publish it, paste it into a ticket, or make it downloadable from the website.

Alternative: standalone validation

Use standalone mode only when you can briefly stop every service using port 80. Stop OpenLiteSpeed, request the certificate, and start it again:

sudo systemctl stop lsws
sudo certbot certonly --standalone \
  -d example.com \
  -d www.example.com \
  --email admin@example.com \
  --agree-tos \
  --no-eff-email
sudo systemctl start lsws

This method is unsuitable for unattended renewal unless the renewal configuration includes pre- and post-hooks that stop and start OpenLiteSpeed. For an always-on website, prefer webroot validation or OpenLiteSpeed’s native ACME feature.

Configure the certificate in OpenLiteSpeed

Open the OpenLiteSpeed WebAdmin console, commonly at https://SERVER_IP:7080, then select the virtual host that serves your domain.

  1. Open Virtual Hosts → your virtual host → SSL.
  2. Set Private Key File to /etc/letsencrypt/live/example.com/privkey.pem.
  3. Set Certificate File to /etc/letsencrypt/live/example.com/fullchain.pem.
  4. Set the certificate chain option to Yes or Chained Certificate: Yes, depending on the WebAdmin version.
  5. Save the configuration and perform a graceful restart.

OpenLiteSpeed’s documented manual configuration uses the Let’s Encrypt fullchain.pem and privkey.pem paths, with the certificate chain enabled (according to docs.openlitespeed.org).

sudo systemctl restart lsws

The command above is OpenLiteSpeed’s documented service restart command. Check the configuration and service status if the restart fails:

sudo /usr/local/lsws/bin/openlitespeed -t
sudo systemctl status lsws --no-pager

Confirm the HTTPS listener and redirect HTTP

OpenLiteSpeed must have a listener on port 443 mapped to the virtual host. In WebAdmin, check Listeners → the HTTPS listener:

  • Port: 443
  • Secure: Yes
  • Virtual Host Mappings: include example.com and any aliases such as www.example.com

Keep an HTTP listener on port 80 if you use HTTP-01 validation. Configure the port-80 virtual host to redirect to the HTTPS hostname. In the virtual host’s Rewrite settings, enable rewriting and add a rule equivalent to:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]

Apply the rule only to the HTTP virtual host. Do not add the same redirect to the HTTPS virtual host, or the site may redirect to itself. Keeping port 80 available for redirects is also recommended for general web servers and helps HTTP-01 validation continue to work (according to letsencrypt.org).

Restart OpenLiteSpeed after changing listener or rewrite settings:

sudo systemctl restart lsws

Configure automatic renewal and reload OpenLiteSpeed

Certbot installations normally include a scheduled renewal task. Certbot reuses the authenticator and options saved for the certificate, but renewing the files is not the same as making a running web server reload them. Add a deploy hook so OpenLiteSpeed reads the renewed certificate after a successful renewal (according to eff-certbot.readthedocs.io).

Create the hook in the root shell:

sudo install -d -m 755 /etc/letsencrypt/renewal-hooks/deploy
sudo tee /etc/letsencrypt/renewal-hooks/deploy/restart-openlitespeed.sh > /dev/null <<'EOF'
#!/bin/sh
systemctl reload lsws 2>/dev/null || systemctl restart lsws
EOF
sudo chmod 755 /etc/letsencrypt/renewal-hooks/deploy/restart-openlitespeed.sh

The hook first attempts a reload and falls back to a restart if the service does not support the requested reload operation. If your server uses a custom service name, replace lsws with that service name.

Check that Certbot has a scheduled task and that the hook is executable:

systemctl list-timers --all | grep -i certbot || true
sudo ls -l /etc/letsencrypt/renewal-hooks/deploy/restart-openlitespeed.sh
sudo certbot certificates

Test renewal before relying on it

Run a staging renewal test. The --dry-run option checks the renewal process without replacing the live certificate (according to eff-certbot.readthedocs.io).

sudo certbot renew --dry-run

Expected result: Certbot completes the renewal simulation without an error and runs the deploy hook. A dry run is not proof that future renewal will always succeed; DNS, firewall, document-root, and OpenLiteSpeed configuration changes can still affect it.

Inspect the saved renewal configuration without editing it first:

sudo sed -n '1,220p' /etc/letsencrypt/renewal/example.com.conf

Do not routinely edit files under /etc/letsencrypt/renewal/ by hand. If the document root changes, use Certbot’s certificate-specific options, test with --dry-run, and only then perform a live renewal.

Verify the complete HTTPS setup

Run these checks from the server or another machine that can reach the public site:

curl -I http://example.com
curl -I https://example.com
sudo ss -ltnp | grep -E ':(80|443)\b'
sudo certbot certificates
  • http://example.com should return a redirect to the HTTPS URL.
  • https://example.com should return a successful response without a certificate warning.
  • The socket check should show OpenLiteSpeed listening on the ports that your configuration uses.
  • certbot certificates should show the certificate name, domains, and expiry date.

In a browser, open the HTTPS URL and inspect the certificate details. Confirm that the certificate covers every hostname visitors use and that the browser connects to the intended server IP.

Common failures and safe fixes

HTTP-01 validation fails

Check DNS, port 80, the HTTP listener, and the challenge file directly:

curl -i http://example.com/.well-known/acme-challenge/test.txt
sudo ufw status verbose
sudo ss -ltnp | grep ':80\b'

A 404 usually means the webroot is wrong or the request reaches another virtual host. A 403 commonly indicates permissions or an access rule blocking hidden directories. A timeout usually points to DNS, cloud-firewall, host-firewall, or listener problems.

The certificate renewed but the browser shows the old certificate

Check the certificate files and reload OpenLiteSpeed:

sudo ls -l /etc/letsencrypt/live/example.com/
sudo systemctl restart lsws
openssl s_client -connect example.com:443 -servername example.com < /dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates

If the files have a new expiry date but the browser does not, verify that the HTTPS listener points to the live paths, not an old copied certificate under /usr/local/lsws/ or another directory.

The deploy hook fails

Run the hook manually and inspect the service:

sudo /etc/letsencrypt/renewal-hooks/deploy/restart-openlitespeed.sh
sudo systemctl status lsws --no-pager
sudo tail -n 100 /usr/local/lsws/logs/error.log

Correct the service name, executable permission, or OpenLiteSpeed configuration error, then repeat sudo certbot renew --dry-run.

Rollback plan

If the new OpenLiteSpeed configuration prevents the service from starting, restore the previous certificate paths or temporarily disable the changed listener mapping in WebAdmin, validate the configuration, and restart the service:

sudo cp -a /usr/local/lsws/conf /usr/local/lsws/conf.backup-before-letsencrypt
sudo /usr/local/lsws/bin/openlitespeed -t
sudo systemctl restart lsws

If you created the deploy hook and need to stop automatic reloads while investigating, rename it rather than deleting it:

sudo mv /etc/letsencrypt/renewal-hooks/deploy/restart-openlitespeed.sh \
  /etc/letsencrypt/renewal-hooks/deploy/restart-openlitespeed.sh.disabled

Do not delete the live certificate or private key while diagnosing the issue. Once the listener, certificate paths, and hook are corrected, restore the hook name and run the dry-run renewal test again.

When to use OpenLiteSpeed’s native ACME instead

For a new OpenLiteSpeed-only deployment, native ACME may reduce manual certificate-path management. It requires OpenLiteSpeed to run as root, public access to the validation ports, and configuration of the ACME facility in WebAdmin. OpenLiteSpeed documents daily checks and renewal when a certificate is within 30 days of expiration (according to docs.openlitespeed.org).

Use either native ACME or Certbot for a particular certificate. If you switch methods, record the existing certificate name and configuration first, remove the old renewal path only after the new method has passed its verification test, and keep a rollback copy of the OpenLiteSpeed configuration.

Reference source

  • Obtain TLS certificates— Ubuntu Server documentation.
  • Get Certbot— Certbot documentation.
  • User Guide— Certbot documentation.
  • certbot — Certbot 5.8.0 documentation— Certbot documentation.
  • Challenge Types— Let’s Encrypt.
  • Best Practice – Keep Port 80 Open— Let’s Encrypt.
  • Configuration— OpenLiteSpeed Documentation.
  • Automatic SSL Certificates (ACME)— OpenLiteSpeed Documentation.

Chú thích cho quảng cáo
Certbot HTTPS Let’s Encrypt OpenLiteSpeed Server Administration SSL TLS Ubuntu
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Previous ArticleHow to Use ChatGPT: Features, Customization and ChatGPT Plus
Next Article How To Install WordPress on Ubuntu with a LAMP Stack
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

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
Add A Comment
Leave A Reply Cancel Reply

Latest posts

Create a Draggable Desktop PWA Title Bar with `window-drag`

How to Keep CI/CD Running Through a GitHub Actions Outage

Safe AI Agent Governance for Small Businesses

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

Why Your Website Isn’t Appearing on Bing: Diagnose the URL

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.