انتقل إلى المحتوى

الدروس الأمان متوسط1 دقائق قراءة

How to Install a Free Let's Encrypt SSL Certificate with Certbot

Secure an Nginx or Apache site on your VPS with a free Let's Encrypt certificate using Certbot, including automatic renewal and HTTPS redirects.

بواسطة فريق تحرير ZSOLNET آخر تحديث

هذه الصفحة غير متاحة بالعربية بعد، لذا تُعرض بالإنجليزية.

أهم النقاط

  • Certbot obtains, installs and renews Let's Encrypt certificates automatically.
  • DNS must point at the server before you request a certificate.
  • Certificates last 90 days; renewal runs on a timer.

Before you start

  • Your domain’s A records (both example.com and www) point to the server.
  • Ports 80 and 443 are open: sudo ufw allow 'Nginx Full' or sudo ufw allow 'Apache Full'.
  • The web server has a site configured for the domain.

1. Install Certbot

The Certbot project recommends the snap package:

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

2. Request and install the certificate

For Nginx:

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

For Apache, use --apache instead. Enter an email for expiry notices and agree to the terms. Certbot edits your configuration and sets up the HTTP-to-HTTPS redirect.

3. Confirm renewal works

sudo certbot renew --dry-run
systemctl list-timers | grep certbot

4. Verify

Run the SSL checker on your domain. It should show a valid certificate, the full chain and TLS 1.2/1.3.

الأسئلة الشائعة

Why does Certbot fail with a challenge error?

Let's Encrypt couldn't reach your server over HTTP on port 80 for that hostname. Check the A record, open port 80 in the firewall, and make sure no CDN or redirect is interfering.

Can I get a wildcard certificate?

Yes, but wildcards require the DNS-01 challenge, which means adding a TXT record — manually or with a DNS provider plugin.

شارك X LinkedIn Facebook

الدخول إلى حسابك

أدِر نطاقاتك واستضافتك وفواتيرك من مكان واحد.

اتصال آمن مباشرة مع منطقة العملاء في ZSOLNET.

ليس لديك حساب؟