Sr Technical Writer

Managing SSL certificates manually is a common pain point for teams running production applications. If you’re currently using Let’s Encrypt with cron jobs on Droplets, you know the frustration of certificate expiration alerts, failed renewals, and the constant maintenance overhead.
In this tutorial you will learn how to automate SSL certificates and HTTPS renewals across DigitalOcean: fully managed SSL on Load Balancers and App Platform, with no manual certbot on servers.
You’ll also learn how to enable automatic HTTPS on DigitalOcean, how automated HTTPS certificate management works for both products, and when to choose managed SSL vs Let’s Encrypt on Droplets. By the end, you’ll understand how to eliminate certificate renewal failures and reduce operational overhead.
Manually renewing SSL/TLS certificates can result in:
Automating SSL certificate renewals delivers these benefits:
This tutorial explains how to achieve SSL automation on both Load Balancers and App Platform with minimal effort.
Learn more in our load balancing and network load balancing resources.
Before you begin, ensure you have:
Transport Layer Security (TLS) encrypts data between clients and servers; SSL certificates (technically TLS certificate / X.509 certificate) prove your server’s identity and enable encrypted connections. Let’s Encrypt issues free server certificates valid for 90 days, requiring renewal before expiration.
DigitalOcean provisions certificates (via Let’s Encrypt), validates domain ownership, and renews them automatically before expiry, no certbot, no cron job is needed.
DigitalOcean offers three approaches:
The following sections focus on automating SSL on DigitalOcean Load Balancers and automating SSL on App Platform, with fully managed renewal and no manual certbot.
This section demonstrates the traditional DIY approach using Let’s Encrypt and certbot. While this method works, it requires more maintenance than DigitalOcean managed solutions like Load balancers and App Platform.
First, update your system and install certbot:
sudo apt update
sudo apt install certbot python3-certbot-nginx -y
The python3-certbot-nginx package includes the Nginx plugin, which automatically configures Nginx for SSL. If you haven’t installed Nginx yet, see How To Install Nginx on Ubuntu first.
Before requesting a certificate, ensure your domain points to your Droplet’s IP address. Create an A record in your DNS settings pointing your domain to the Droplet’s public IP. If you’re using DigitalOcean’s nameservers, see our guide on How to Manage DNS Records.
Request a certificate for your domain:
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
Certbot will:
After successful certificate generation, certbot creates a systemd timer that attempts renewal twice daily. However, you should verify this is working correctly.
Test the renewal process with a dry run:
sudo certbot renew --dry-run
If this succeeds, your automatic renewal is configured correctly. Certbot’s systemd timer runs certbot renew twice daily, but only renews certificates that are within 30 days of expiration.
You can check the timer status:
sudo systemctl status certbot.timer
Several problems can occur with manual certificate management:
dig or online DNS checkersDigitalOcean Load Balancers simplify SSL certificate automation by handling SSL termination and automatic renewal.
This approach is ideal when you have multiple backend servers or want to offload SSL processing from your application servers. Load balancers distribute traffic across multiple Droplets and provide high availability; see network load balancing for more context.
Navigate to the DigitalOcean Control Panel and create a new Load Balancer. For detailed setup instructions, see How to Create a Regional Load Balancer:
Go to Networking > Load Balancers > Create Load Balancer

Choose the region you want to deploy your load balancer to(Choose the same datacenter as the Droplets you plan to load balance).

Select your Droplet pool (or anytime after the Load Balancer is created.). Learn about adding Droplets to a load balancer
Add forwarding rules: Forwarding rules define how traffic is routed from the load balancer to its backend Droplets. You need at least one rule.
The default route is HTTP port 80 on the load balancer to HTTP port 80 on the backend Droplets. You can create new rules during creation with the New Rule drop-down. After creation, you can modify a load balancer’s rules at any time on its Settings page.

You have the option to create a forwarding rule that requires a Let’s Encrypt certificate or you can bring your own certificate. If you bring your own certificate, you need to upload the certificate and private key files to DigitalOcean.
If you manage your domain with DigitalOcean DNS, you can choose the Let’s Encrypt option to create a new, fully-managed SSL certificate. DigitalOcean will create and automatically renew this certificate for you.

The Create DNS records for all the new Let’s Encrypt certificates box is checked by default. If you want to manage your own DNS records for your Let’S Encrypt certificate, uncheck the box to opt out of creating any records when creating the forwarding rule.

You can update this selection when adding or updating forwarding rules at a later time. However, the updated selection applies only to the new rules going forward, existing DNS records are not updated.
You can refer to this documentation on Adding an SSL certificate to a load balancer for more details.
Under Advanced settings, choose Redirect HTTP to HTTPS.

DigitalOcean automatically:
The load balancer handles SSL decryption and forwards unencrypted traffic to your backend Droplets over the private network. This reduces CPU load on your application servers and simplifies cloud load balancer certificate management. Certificates live only on the load balancer, not each backend server.
DigitalOcean renews managed SSL certificates on the load balancer automatically before expiration. No cron jobs or certbot are required; renewal is fully managed.
For detailed configuration steps, see the DigitalOcean documentation on SSL termination.
Note: If you need end-to-end encryption (for compliance or security requirements), use SSL passthrough instead of termination.
SSL passthrough requires managing certificates on your backend servers, but provides stronger security for sensitive applications. See the SSL passthrough documentation for setup details.
DigitalOcean App Platform provides the simplest automated HTTPS certificate management for managed application SSL certificates. When you add a custom domain, DigitalOcean automatically provisions and renews SSL certificates with zero configuration. This includes Platform-as-a-Service SSL automation and container platform certificate renewal with no certbot or manual steps.
To use App Platform’s automatic HTTPS and cloud platform HTTPS automation, first deploy your application. See How to Deploy a Static Site to App Platform or How to Deploy a Containerized Application to App Platform for deployment guides:
Once you have deployed your application to App Platform, go to Networking tab > Domains.

Here are the steps on how to set up a custom domain and SSL with the DigitalOcean App Platform:
Note: It can take a few minutes for SSL to be active after DNS propagation. If you don’t see HTTPS immediately, check your DNS settings, refresh the DigitalOcean App Platform dashboard, and wait for the changes to propagate.
https:// followed by your custom domain.Once your custom domain is properly configured on DigitalOcean’s App Platform, SSL/TLS is automatically provisioned via Let’s Encrypt. This means you don’t have to manually acquire or install an SSL certificate and DigitalOcean handles it for you.
Additionally, App Platform automatically upgrades all incoming HTTP requests to HTTPS, meaning any traffic sent over HTTP will be redirected to HTTPS, ensuring secure connections for all users.
You’ll know SSL is active when:
https, such as https://www.myapp.com.App Platform automatically:
No manual certificate management is required. DigitalOcean handles all certificate lifecycle operations.
App Platform monitors certificate expiration and renews them automatically, typically 30 days before expiration. You don’t need to configure cron jobs, systemd timers, or renewal scripts.
For more information on App Platform SSL management, check out our tutorial on How to Configure Custom Domain, SSL, and CDN on App Platform and our official documentation on How to Manage SSL Certificates on DigitalOcean Teams and How do I generate my app’s SSL certificate?.
With managed SSL on Load Balancers and App Platform, DigitalOcean handles the full renewal lifecycle:
| Phase | What happens |
|---|---|
| Provisioning | Domain validation (DNS or HTTP), then certificate issuance (Let’s Encrypt). |
| Active | Certificate is used for TLS; HTTPS listener serves traffic. |
| Renewal | DigitalOcean renews automatically before expiry (e.g. ~30 days for 90-day certs). |
| Post-renewal | New certificate is deployed with no downtime; no action required from you. |
Both Load Balancer and App Platform managed SSL certificates are issued via Let’s Encrypt; renewal is automatic and you never run certbot. This is the main difference between managed SSL vs Let’s Encrypt on Droplets: on Droplets you manage certbot yourself; on Load Balancers and App Platform, DigitalOcean does it for you.
| Issue | Likely cause | What to do |
|---|---|---|
| Certificate not activating | DNS not pointing to the load balancer or app | Verify A/CNAME records; allow 24–48 hours for propagation. |
| "Certificate pending" or validation fails | Wrong DNS records or domain not reachable | Double-check the exact host and value in Control Panel; ensure port 80 (HTTP) is reachable if using HTTP validation. |
| Mixed content or insecure warnings | Page loads over HTTPS but assets over HTTP | Use relative URLs or https:// for all resources; enable "HTTPS only" where available. |
| Renewal failed (DIY certbot) | Port 80 blocked, or Nginx not reloaded | Open port 80 for Let’s Encrypt; run sudo certbot renew and sudo systemctl reload nginx. See How To Secure Nginx with Let’s Encrypt on Ubuntu 20.04. |
| What happens if an SSL certificate expires? | Browsers show security errors; traffic may be rejected | With managed SSL, renewal is automatic. If you use DIY certbot, set alerts and fix renewal (timer, cron, or migrate to managed). |
For load balancer SSL vs App Platform SSL: both use managed certificates and auto-renewal; choose Load Balancer for custom backends (Droplets) and App Platform for PaaS apps.
Regardless of which SSL method you choose (load balancer SSL, App Platform SSL, or DIY), implement these security and performance practices.
Ensure all HTTP traffic redirects to HTTPS. For Load Balancers, use forwarding rules as described above. For Droplets with Nginx, add this to your server block:
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
return 301 https://$host$request_uri;
}
This redirects all HTTP requests to HTTPS with a 301 permanent redirect.
HTTP Strict Transport Security (HSTS) is a web security policy mechanism that instructs browsers to always use HTTPS instead of HTTP when connecting to your site. By enabling HSTS, you protect users from downgrade attacks and cookie hijacking.
To enable HSTS in Nginx on Droplets, you should add the following directive to your HTTPS server block (i.e., the block that listens on port 443, usually in your /etc/nginx/sites-available/yourdomain.conf file):
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
max-age=31536000 tells browsers to only use HTTPS for one year (specified in seconds).includeSubDomains applies the policy to all subdomains as well.preload requests inclusion in browser preload lists, which further enforces HTTPS-only access.Example:
Place this add_header line in the HTTPS (listen 443 ssl;) server block in your Nginx configuration file for your domain, then reload Nginx for the changes to take effect.
server {
listen 443 ssl;
server_name yourdomain.com www.yourdomain.com;
# ...other SSL configuration...
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
# ...other settings...
}
This will instruct browsers visiting your site to always prefer HTTPS and improve your overall security.
It’s a good practice to add security headers in your server configuration to help block common web attacks. For example, in Nginx you can add:
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
Here’s what each header does:
Add these lines to your server (e.g., inside your Nginx server block) to let browsers know to enforce these protections for every response.
These headers help strengthen your site’s defenses with just a few lines of configuration.
Even with automated renewal, monitor certificate expiration dates to catch issues early. Set up alerts to notify you if certificates approach expiration.
For certificates on Droplets, check expiration with:
sudo certbot certificates
OutputSaving debug log to /var/log/letsencrypt/letsencrypt.log
Found the following certs:
Certificate Name: yourdomain.com
Domains: yourdomain.com www.yourdomain.com
Expiry Date: 2026-05-10 10:35:03+00:00 (VALID: 87 days)
Certificate Path: /etc/letsencrypt/live/yourdomain.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/yourdomain.com/privkey.pem
This shows all certificates, their expiration dates, and file paths.
Create a monitoring script that checks certificate expiration:
#!/bin/bash
DOMAIN="yourdomain.com"
EXPIRY_DATE=$(echo | openssl s_client -servername "$DOMAIN" -connect "$DOMAIN:443" 2>/dev/null | openssl x509 -noout -dates | grep notAfter | cut -d= -f2)
EXPIRY_EPOCH=$(date -d "$EXPIRY_DATE" +%s)
CURRENT_EPOCH=$(date +%s)
DAYS_LEFT=$(( ($EXPIRY_EPOCH - $CURRENT_EPOCH) / 86400 ))
if [ "$DAYS_LEFT" -lt 30 ]; then
echo "WARNING: Certificate for $DOMAIN expires in $DAYS_LEFT days"
# Send alert via email, Slack, or monitoring service
fi
Schedule this script to run daily with cron:
0 9 * * * /path/to/check-cert-expiry.sh
Services like UptimeRobot, Pingdom, or DigitalOcean’s monitoring can alert you to certificate issues. Configure SSL certificate monitoring to receive notifications when certificates are about to expire or have validation problems. Learn how to set up monitoring alerts for your infrastructure.
Use this decision framework to choose between managed SSL (Load Balancer or App Platform) and custom/Let’s Encrypt on Droplets:
Choose DIY on Droplets if:
Choose Load Balancer Managed SSL if:
Choose App Platform Automatic SSL if:
If you’re currently using DIY certificates on Droplets, here’s a migration path:
Both migrations eliminate manual certificate management while maintaining or improving your application’s security posture.
You can automate SSL certificates on DigitalOcean in two main ways without running certbot yourself:
Yes. For managed SSL on Load Balancers and App Platform, DigitalOcean automatically renews SSL certificates before they expire. You don’t configure cron jobs or certbot. For DIY Let’s Encrypt on Droplets, you must set up certbot’s renewal timer or cron yourself.
When you add a custom domain in Settings > Domains, App Platform validates ownership, provisions an SSL certificate (via Let’s Encrypt), and enables HTTPS and HTTP→HTTPS redirect. Renewal is automatic. No load balancer configuration or certificate upload is required, SSL certificate automation is built in.
Yes. On Load Balancers you can upload a custom certificate (e.g. from a commercial CA) instead of using Let’s Encrypt. On App Platform, managed certificates are provided when you add a domain. On Droplets, you can use any certificate (Let’s Encrypt or custom) with Nginx/Apache. Please refer to our tutorial on How To Secure Nginx with Let’s Encrypt on Ubuntu for more details.
Browsers will show security warnings and may block access. With managed SSL on Load Balancers and App Platform, renewal is automatic so expiry is avoided. If you use DIY certbot, set up monitoring and fix renewal (e.g. certbot renew) or migrate to managed SSL.
Yes. Both Load Balancer and App Platform managed SSL certificates are issued by Let’s Encrypt. DigitalOcean handles validation, issuance, and renewal; you don’t interact with Let’s Encrypt directly.
For Load Balancers and App Platform, once DNS points correctly to the resource, certificate provisioning usually completes within minutes. Full activation can take up to 24–48 hours depending on DNS propagation and validation.
Managing SSL certificates doesn’t have to be a constant source of operational overhead. While the DIY approach with Let’s Encrypt and cron jobs works for simple deployments, DigitalOcean’s managed solutions provide better reliability and less maintenance.
Load Balancers with managed SSL certificates eliminate renewal complexity for multi-server deployments, while App Platform offers the simplest path with zero-configuration SSL management. Both approaches handle certificate provisioning, validation, and renewal automatically.
The key is choosing the right approach for your infrastructure. Single-server applications may work fine with DIY certificates, but as you scale or prioritize operational simplicity, managed solutions become increasingly valuable. Implement proper security hardening with HTTPS redirects and HSTS headers regardless of which method you choose.
Monitor certificate expiration even with automated renewal to catch edge cases early. Set up alerts and regularly verify your SSL configuration to ensure your applications remain secure and accessible.
Now that you understand the different approaches to SSL certificate management on DigitalOcean, explore these related resources:
Ready to simplify your SSL certificate management? Create a DigitalOcean Load Balancer or deploy your first App Platform application to experience automated certificate management today.
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
I help Businesses scale with AI x SEO x (authentic) Content that revives traffic and keeps leads flowing | 3,000,000+ Average monthly readers on Medium | Sr Technical Writer @ DigitalOcean | Ex-Cloud Consultant @ AMEX | Ex-Site Reliability Engineer(DevOps)@Nutanix
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.