Install Let's Encrypt SSL on Ubuntu with Certbot | InMotion Hosting (2024)

by InMotion Hosting Contributor

3 Minutes, 4 Seconds to Read

Install Let's Encrypt SSL on Ubuntu with Certbot | InMotion Hosting (1)

Let’s Encrypt provides free SSL certificates for your websites to use secure connections. Certbot is free open source software that allows you to easily create Let’s Encrypt SSLs on your unmanaged Linux server. Log into SSH as root to begin.

  • Install Certbot in Ubuntu 20.04
    • Install Certbot in Ubuntu with PIP
    • Install Certbot in Ubuntu with snapd
  • Create an SSL Certificate with Certbot
    • SSL Maintenance and Troubleshooting
    • SSL Improvements

Install Certbot in Ubuntu 20.04

Instead of the older python-certbot-apache package, Certbot now recommends using the snapd package manager to install Certbot in Ubuntu. InMotion Cloud Server Hosting is incompatible with snapd at this time, but Python Installs Packages (PIP) works just as well.

Install Certbot in Ubuntu with PIP

Cloud server users can install Certbot in Ubuntu with PIP.

  1. First, install PIP:
    sudo apt install python3 python3-venv libaugeas0
  2. Set up a virtual environment:
    sudo python3 -m venv /opt/certbot/
    sudo /opt/certbot/bin/pip install --upgrade pip
  3. Install Certbot on Apache (or NGINX):
    sudo /opt/certbot/bin/pip install certbot certbot-apache
    sudo /opt/certbot/bin/pip install certbot certbot-nginx
  4. Create a symlink to ensure Certbot runs:
    sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot

Install Certbot in Ubuntu with snapd

Our Dedicated Server Hosting users can use snapd.

  1. Install snapd:
    sudo apt install snapd
  2. Ensure you have the latest snapd version installed:
    sudo snap install core; sudo snap refresh core
  3. Install Certbot with snapd:
    sudo snap install --classic certbot
  4. Create a symlink to ensure Certbot runs:
    sudo ln -s /snap/bin/certbot /usr/bin/certbot

Create an SSL Certificate with Certbot

Run Certbot to create SSL certificates and modify your web server configuration file to automatically redirect HTTP requests to HTTPS. Or, add “certonly” to create the SSL certificates without modifying system files (recommended if hosting staging sites that should not be forced to use an SSL).

  1. Choose the best option for your needs.
    Create SSL certs for all domains and configure redirects in the web server:
    sudo certbot --apache
    sudo certbot --nginx

    Create SSL certs for a specified domain (recommended if you’re using your system hostname):
    sudo certbot --apache -d example.com -d www.example.com

    Only install SSL certs:
    sudo certbot certonly --apache
    sudo certbot certonly --nginx
  2. Enter an email address for renewal and security notices.
  3. Agree to the terms of service.
  4. Specify whether to receive emails from EFF.
  5. If prompted, choose whether to redirect HTTP traffic to HTTPS – 1 (no redirect, no further changes to the server) or 2 (redirect all HTTP requests to HTTPS).

SSL Maintenance and Troubleshooting

After you install a Let’s Encrypt certificate on your Ubuntu Certbot setup, you can test your website SSL status at https://WhyNoPadlock.com to identify mixed content errors.

The certificate files for each domain is stored in:

cd /etc/letsencrypt/live

Let’s Encrypt certificates expire after 90 days. To prevent SSLs from expiring, Certbot checks your SSL status twice a day and renews certificates expiring within thirty days. You can view settings with Systemd or cron.d.

systemctl show certbot.timer
cat /etc/cron.d/certbot

Ensure the renewal process works:

sudo certbot renew --dry-run

SSL Improvements

Having an SSL cert and 301 redirects to force HTTPS aren’t always enough to prevent hacks. Cyber attackers have found ways to bypass both security practices to infiltrate server communications.

HTTP Strict Transport Security (HSTS) is a security HTTP header that addresses this by telling web browsers to only serve your website when received with a valid SSL cert. If the browser receives an insecure connection, it rejects the data altogether to protect the user. It is easy to configure HSTS within your web server (e.g. Apache and NGINX).

Upgrade to VPS Hosting for Peak Performance

Upgrade to InMotion VPS Hosting today for top-notch performance, security, and flexibility, and save up to $2,412 – a faster, stronger hosting solution is just a click away!

Install Let's Encrypt SSL on Ubuntu with Certbot | InMotion Hosting (2)SSD Storage Install Let's Encrypt SSL on Ubuntu with Certbot | InMotion Hosting (3)High-Availability Install Let's Encrypt SSL on Ubuntu with Certbot | InMotion Hosting (4)Ironclad Security Install Let's Encrypt SSL on Ubuntu with Certbot | InMotion Hosting (5)Premium Support

VPS Hosting

Install Let's Encrypt SSL on Ubuntu with Certbot | InMotion Hosting (2024)
Top Articles
Binance Coin (BNB) Price Prediction 2023, 2024, 2025-2030 
'Nah, imagine working for Walmart for 35 years': Walmart worker shames employees who stay with the company for decades
The Blackening Showtimes Near Century Aurora And Xd
How Many Cc's Is A 96 Cubic Inch Engine
Es.cvs.com/Otchs/Devoted
Gabrielle Abbate Obituary
San Diego Terminal 2 Parking Promo Code
According To The Wall Street Journal Weegy
Paula Deen Italian Cream Cake
Waive Upgrade Fee
Weather In Moon Township 10 Days
Lesson 2 Homework 4.1
Mawal Gameroom Download
Job Shop Hearthside Schedule
Dump Trucks in Netherlands for sale - used and new - TrucksNL
2021 Lexus IS for sale - Richardson, TX - craigslist
Christina Khalil Forum
Hell's Kitchen Valley Center Photos Menu
Wizard Build Season 28
Download Center | Habasit
Kürtçe Doğum Günü Sözleri
Salem Oregon Costco Gas Prices
Jordan Poyer Wiki
Weldmotor Vehicle.com
Defending The Broken Isles
15 Primewire Alternatives for Viewing Free Streams (2024)
14 Top-Rated Attractions & Things to Do in Medford, OR
New Stores Coming To Canton Ohio 2022
Cylinder Head Bolt Torque Values
Mchoul Funeral Home Of Fishkill Inc. Services
Winterset Rants And Raves
Learn4Good Job Posting
Grays Anatomy Wiki
Www.craigslist.com Syracuse Ny
Bratislava | Location, Map, History, Culture, & Facts
Rocketpult Infinite Fuel
Tamilyogi Ponniyin Selvan
2008 Chevrolet Corvette for sale - Houston, TX - craigslist
Instafeet Login
Priscilla 2023 Showtimes Near Consolidated Theatres Ward With Titan Luxe
Arcane Bloodline Pathfinder
Disassemble Malm Bed Frame
Lucifer Morningstar Wiki
Gary Vandenheuvel Net Worth
15 Best Places to Visit in the Northeast During Summer
A rough Sunday for some of the NFL's best teams in 2023 led to the three biggest upsets: Analysis
Legs Gifs
Marine Forecast Sandy Hook To Manasquan Inlet
Craigslist Cars For Sale By Owner Memphis Tn
WHAT WE CAN DO | Arizona Tile
Salem witch trials - Hysteria, Accusations, Executions
Latest Posts
Article information

Author: Greg O'Connell

Last Updated:

Views: 6199

Rating: 4.1 / 5 (62 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Greg O'Connell

Birthday: 1992-01-10

Address: Suite 517 2436 Jefferey Pass, Shanitaside, UT 27519

Phone: +2614651609714

Job: Education Developer

Hobby: Cooking, Gambling, Pottery, Shooting, Baseball, Singing, Snowboarding

Introduction: My name is Greg O'Connell, I am a delightful, colorful, talented, kind, lively, modern, tender person who loves writing and wants to share my knowledge and understanding with you.