Skip to content
In-house anti-DDoS, included on VPS, game servers and web hosting · hosted in France · cancel anytime See our plans
CloudFive
Log in

01

Before you start

Let's Encrypt is a free certificate authority. Before issuing a certificate, it checks that you really control the domain: this is the challenge. The most common one, HTTP-01, consists of publishing a small file on your site, which Let's Encrypt reads on port 80. Certbot handles all of this for you.

  • A domain name pointing to the VPS: an A record to its IPv4 address (and AAAA to its IPv6, if you declare one, since Let's Encrypt may use it). Check with dig +short www.example.com.
  • Port 80 open for the HTTP-01 challenge, even if the site then only serves HTTPS, and port 443 for the site itself: sudo ufw allow 80/tcp and sudo ufw allow 443/tcp.
  • A web server already answering for this domain, with the right server_name (Nginx) or ServerName (Apache) directive. The guide hosting a website on a VPS explains this step.

Do the basic settings from securing a Linux VPS first. If you already use a proxy such as Caddy, which gets its certificates on its own (as in the guides installing Vaultwarden and Uptime Kuma), you do not need Certbot.

02

Install Certbot

With the distribution package (Debian, Ubuntu): the simplest option, and updates follow the system's. Install Certbot with the module for your web server:

sudo apt update
sudo apt install -y certbot python3-certbot-nginx
# or, for Apache:
sudo apt install -y certbot python3-certbot-apache

With snap: the method the Certbot team recommends, as it always gives the latest version. First remove any certbot package installed with apt, then:

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

Snap does not always work in a container VPS (LXC): in that case, the distribution package is the right choice. On other distributions, follow the instructions on the official Certbot site, which gives the command for your system and web server.

Check the installation with certbot --version.

03

Get a certificate for Nginx or Apache

With the Nginx module, Certbot reads your configuration, obtains the certificate, adds it to the domain's server block and offers to redirect HTTP to HTTPS:

sudo certbot --nginx -d example.com -d www.example.com

For Apache, it is the same command with --apache:

sudo certbot --apache -d example.com -d www.example.com
  • Each -d adds a name to the certificate. The bare domain and www are two different names: include both if both should answer.
  • On first use, Certbot asks you to accept the Let's Encrypt terms and offers to take an email address.
  • If you prefer to edit the configuration yourself, sudo certbot certonly --nginx -d example.com obtains the certificate without touching the web server's files.

The files are stored in /etc/letsencrypt/live/example.com/: fullchain.pem (the certificate with the intermediate chain) and privkey.pem (the private key, never to be shared). These are the two paths to give to other software. The command sudo certbot certificates lists your certificates, their names and their expiry date.

While testing, add --test-cert: Certbot then uses the Let's Encrypt staging environment, which issues certificates browsers do not trust but avoids hitting the production service's rate limits.

04

Webroot and standalone modes, wildcard certificates

Webroot mode is for when the Nginx or Apache module does not fit (complex configuration, another web server, an application in a container serving a folder). Certbot puts the challenge file in the site's public folder, without touching the web server:

sudo certbot certonly --webroot -w /var/www/example -d example.com -d www.example.com

The web server must serve that directory's /.well-known/acme-challenge/ folder over HTTP. You then add the certificate paths to its configuration yourself.

Standalone mode is for when no web server is running, for example for software that only needs the certificate files. Certbot then starts its own small server on port 80, which must be free:

sudo certbot certonly --standalone -d dns.example.com

If a program uses port 80 at renewal time, renewal fails. The --pre-hook and --post-hook options let you stop it and start it again around the renewal.

A wildcard certificate (*.example.com) covers all subdomains one level deep: a.example.com, but not example.com itself nor x.a.example.com. Let's Encrypt only issues it with the DNS challenge (DNS-01): you prove control of the domain by creating a TXT record _acme-challenge.example.com.

sudo certbot certonly --manual --preferred-challenges dns -d example.com -d '*.example.com'

Certbot shows the TXT value to create and waits for your confirmation. This manual mode does not renew on its own, since the record has to be recreated each time. To automate it, use a Certbot DNS module (the certbot-dns-… packages) for your DNS provider, which creates the record through its API, or the RFC 2136 module if you run your own DNS server.

05

Automatic renewal

Let's Encrypt certificates are valid for 90 days. Certbot installs a task that checks your certificates several times a day and renews those nearing expiry: a systemd timer with the distribution package, or the task provided by the snap package. Check that it is scheduled:

systemctl list-timers | grep certbot

Then simulate a full renewal, without changing your certificates:

sudo certbot renew --dry-run

If the simulation succeeds, the real renewal will succeed too under the same conditions. With the Nginx and Apache modules, Certbot reloads the web server after each renewal. For other software (webroot or standalone mode), put a script in /etc/letsencrypt/renewal-hooks/deploy/: it runs after each successful renewal. For example, /etc/letsencrypt/renewal-hooks/deploy/recharger.sh:

#!/bin/sh
systemctl reload nginx

Make it executable with sudo chmod +x. Let's Encrypt no longer sends an email before a certificate expires: run a --dry-run again after every configuration change, and monitor your sites' expiry dates, for example with Uptime Kuma, which warns before the deadline.

06

On CloudFive

CloudFive does not manage your certificates on a VPS: you install Certbot yourself, with root access. The Ryzen VPS, from €5.99 per month, suits one or several sites:

  • an AMD Ryzen 9 9950X, with DDR5 memory and NVMe storage;
  • a dedicated IPv4 address to point your domains to, and basic anti-DDoS protection included;
  • an emergency console in the customer area, useful if a firewall setting cuts off your SSH access.

The servers are in France, on our own network, monthly with no commitment, with support in French 7 days a week by ticket, on Discord and by phone. To compare tiers, see the VPS page and the guide choosing a VPS.

07

Frequently asked questions

How do I install a Let's Encrypt certificate with Certbot?

Install Certbot with your web server's module (python3-certbot-nginx or python3-certbot-apache), check that the domain points to the VPS and that ports 80 and 443 are open, then run sudo certbot --nginx -d yourdomain. Certbot obtains the certificate and configures HTTPS.

How long does a Let's Encrypt certificate last?

A Let's Encrypt certificate is valid for 90 days. Certbot renews it automatically before expiry through a scheduled task; check that it works with sudo certbot renew --dry-run.

How do I check Certbot's automatic renewal?

Run systemctl list-timers | grep certbot to see the scheduled task, then sudo certbot renew --dry-run to simulate a renewal. If the simulation succeeds, the real renewal will work under the same conditions.

How do I get a wildcard certificate with Certbot?

A *.example.com certificate requires the DNS challenge: Let's Encrypt checks an _acme-challenge TXT record. Use --preferred-challenges dns in manual mode for a test, or a Certbot DNS module so that renewal is automatic.

What is the difference between webroot and standalone modes?

Webroot mode puts the challenge file in the public folder of a web server that is already running. Standalone mode starts a temporary server on port 80, which must therefore be free: it suits cases where no web server is installed.

Support CloudFive AI

An answer right away, a real team behind it.

CloudFive AI answers you at any hour, in seconds. When it doesn’t know, or as soon as you ask, the team that runs the machines takes over. No offshore call centre.

  • TicketThe team replies in under 2 hours, 7 days a week.
  • CloudFive AIAt any hour, on ia.cloudfive.fr, Discord and in your customer area.
  • DiscordThe team, the AI and other customers, in the help channel.
  • Your data stays with usAI runs on our servers in France; e-mails, IPs and passwords are masked.
A ticket in the customer area: a customer’s question about a Minecraft plugin, and the CloudFive team’s reply
A real ticket in the customer area, answered by the team (demo account; shown in French).
CUSTOMER AREA · APP

Your servers.
At your fingertips.

Restart a server, watch its resources live, pay an invoice or open a ticket — and get an alert when something goes wrong.

  • The status of all your services at a glance
  • Blocked attacks, filtered traffic, monthly peak
  • A notification when a server goes down or an invoice is due

App coming soon · in the meantime, everything works in your browser at manager.cloudfive.fr

The CloudFive app: the list of your services, with their status
The CloudFive app: the home screen, your services’ status, blocked attacks and an invoice to pay