
For an application running in a container to show the padlock, you need a domain pointing at the VPS and a certificate. The most common route is nginx in front of the container (here is how to set it up) and certbot asking Let’s Encrypt for a free certificate and renewing it. On a VPS running Ubuntu and Docker there is no cPanel AutoSSL: the certificate and its renewal are yours.
With nginx and certbot
|
|
|
|
|
|
Other ways to get HTTPS
| Option | How it works | Worth knowing |
| nginx + certbot on the server | Certbot runs on the VPS and edits nginx. | The most common and best documented. Renewal is a system timer. |
| Caddy | A web server that obtains and renews certificates by itself. | Less configuration, but one more program to learn and maintain. |
| Traefik | A proxy that reads your containers and handles certificates. | Built for many containers. The configuration is yours. |
| Cloudflare in front | The visitor speaks HTTPS to Cloudflare. | You still need HTTPS between Cloudflare and the VPS: see SSL at Cloudflare. |
| If validation fails, do not retry in a loop. Let’s Encrypt limits failed attempts. Fix the cause (DNS not propagated yet, port 80 closed, another service using 80 or 443) and, while you rehearse, use --dry-run, which does not spend your allowance. A domain you have only just pointed can take a while to propagate: how long DNS changes take to propagate. |
| A container listening on 80 or 443 breaks nginx. If nginx will not start with “address already in use”, another program has that port. Find out who: sudo ss -tlnp. And if your main site at yourcompany.com lives somewhere else, do not touch the nameservers of the whole domain: create just the subdomain, as in domain with us, site somewhere else. |
|
Domain with us and the A record does not seem to work? Tell us the name and the VPS IP, and we will check the DNS. Open a support ticket |
|
SEE ALSO Nginx as a reverse proxy in front of a container DNS records explained: A, CNAME, MX, TXT and TTL |
RECOMMENDED PRODUCT Register your .com domain Secure your company name before someone else registers it. from $17.00/yr Search a domain |
- 0 Users Found This Useful











