VPS

Installer un certificat SSL (HTTPS) avec Let’s Encrypt

Sécurisez votre site avec HTTPS gratuitement grâce à Let’s Encrypt.

Résumé

Ce tutoriel vous explique comment installer Certbot et activer HTTPS sur votre site avec Nginx.

Prérequis

Votre domaine doit pointer vers votre serveur (DNS configuré).

Nginx doit être installé et fonctionnel.

Les ports 80 et 443 doivent être ouverts.

Installer Certbot

Certbot permet d’obtenir gratuitement un certificat SSL avec Let’s Encrypt.

apt install -y certbot python3-certbot-nginx

Générer le certificat SSL

Remplacez votredomaine.fr par votre nom de domaine.

Certbot va automatiquement configurer Nginx.

certbot --nginx -d votredomaine.fr -d www.votredomaine.fr

Vérifier HTTPS

  1. Ouvrez votre site dans votre navigateur.
  2. Vérifiez que le cadenas sécurisé apparaît.
  3. Votre site doit être accessible en https://

Renouvellement automatique

Les certificats Let’s Encrypt expirent tous les 90 jours.

Un renouvellement automatique est déjà configuré.

certbot renew --dry-run

Forcer HTTPS (optionnel)

Certbot propose automatiquement de rediriger HTTP vers HTTPS.

Cela est recommandé pour la sécurité.

Important

Assurez-vous que votre domaine pointe bien vers votre serveur avant d’exécuter Certbot, sinon le certificat échouera.