Networking, Domains & DNS

How can we help?

Guides and technical documentation for your Server4You dedicated server or VPS.

Let's Encrypt with Nginx

This guide explains how to install a free Let's Encrypt SSL certificate with Certbot on a Linux server running Nginx (Debian, Ubuntu, AlmaLinux or Rocky Linux) and how to check the automatic renewal.

Prerequisites: Nginx must be installed and running. The A record of your domain must point to your server's IP. Ports 80 and 443 must be open in the firewall.

Step 1: Install Certbot

Install Certbot and the Nginx plugin via the package manager.

Debian / Ubuntu

Terminal
apt update apt install certbot python3-certbot-nginx

AlmaLinux / Rocky Linux

Terminal
dnf install epel-release dnf install certbot python3-certbot-nginx

Step 2: Issue the certificate

Certbot issues the certificate and configures Nginx automatically.

Replace your-domain.com with your actual domain name. Add further -d parameters for multiple domains:

Terminal
certbot --nginx -d your-domain.com -d www.your-domain.com

On the first run, Certbot asks for an email address and for your agreement to the terms of service. It then sets up the redirect from HTTP to HTTPS automatically — the right choice for most websites. If you do not want a redirect, add --no-redirect.

Step 3: Verify the installation

Test the Nginx configuration and reload.
Terminal
nginx -t systemctl reload nginx

Open your domain in a browser — you should see https:// and the padlock icon. For a detailed check you can use SSL Labs.

Step 4: Verify automatic renewal

Let's Encrypt certificates are currently valid for 90 days — Certbot renews them automatically.

Certbot automatically sets up a systemd timer or cron job during installation. Check that the timer is active:

Terminal
systemctl status certbot.timer

Test the renewal process with a dry run — no real certificate is issued:

Terminal
certbot renew --dry-run

If --dry-run succeeds, automatic renewal is working correctly. No further steps needed.

Manually renew the certificate

If a manual renewal is needed.
Terminal
certbot renew systemctl reload nginx

Common error messages

ErrorCause & fix
Connection refused on port 80Port 80 is blocked by the firewall. Open it in iptables or nftables.
DNS problem: NXDOMAINThe domain's A record does not point to this server. Check DNS and wait for propagation if needed.
too many certificates already issuedLet's Encrypt issues at most 5 certificates for the exact same set of domain names per week (50 per registered domain). Wait, or use the staging environment (--staging) for tests.
nginx: configuration file test failedCertbot modified the Nginx config incorrectly. Check with nginx -t and fix manually if needed.

Further Documentation

The full Certbot documentation is available on the official website.