Skip to content
Browse docs

Docker Domains: Put Your App on a Domain with HTTPS

The Domains tab puts a container on your own domain with a free HTTPS certificate. CtrlOps sets up nginx or Traefik, checks your DNS, gets a Let's Encrypt certificate, and renews it for you. Your existing sites stay up.

Open in
Updated

The Domains tab puts your app on your own domain, with a free HTTPS certificate. You do not write any web server config or certificate commands.

Each domain shows its certificate status and the container it points to.

Find what you need

I want toInstead of doingGo to
Put my app on a domainWrite an nginx file, run certbot, set up renewalPut your app on a domain
Choose nginx or TraefikRead both sets of docsChoose a web server
Check my certificateopenssl s_client, certbot certificatesRead the domain list
Check my DNSdig app.example.comVerify DNS
Send one domain to anotherWrite a redirect by handRedirect a domain
Run several copies behind one domainWrite an upstream blockLoad balancer
Fix a failed certificateRead certbot logsTroubleshooting

Put your app on a domain

Point DNS at your server

At your DNS provider, add an A record for your host name, such as app.example.com, that points to the public IP address of your server. The change can take a few minutes to reach everyone.

Also check that ports 80 and 443 are open. On a cloud server, that often means the cloud firewall or security group as well.

Prepare a web server

You only do this once for each server. A web server receives visitors on ports 80 and 443, and sends them to the right container.

If the chip at the top says Set up a web server, click it. If it already shows nginx or Traefik, skip this step.

The chip reads Set up a web server until the server has one.

Choose nginx or Traefik, and confirm.

The dialog shows what stays on the server before anything is installed.

Add the domain

Click Add Domain at the top right. On a server with no domains yet, the same button is also in the middle of the tab.

Add Domain is at the top right, and in the middle while the list is empty.

Fill in the form:

FieldWhat to enter
Domain nameThe full host name, such as app.example.com
LabelOptional. A note for yourself
TargetThe container and the port your app listens on inside it, such as web:3000. For a stack, use stack/service:3000
Enable SSLLeave it on. It gets a free Let's Encrypt certificate and redirects visitors from HTTP to HTTPS
Auto-renewLeave it on, so the certificate renews before it expires

The form shows the exact route CtrlOps will write. If the server has no web server yet, it says No route. CtrlOps does not change the web server., so prepare a web server first. Click Add domain.

This server has no web server yet, so the preview says No route. With one, it shows the route CtrlOps will write.

Check the certificate

The ssl column shows requested while CtrlOps gets the certificate, then valid. This can take a few minutes. Then open your domain in a browser.

If DNS is not ready, the status stays on pending, and CtrlOps asks for the certificate once DNS points here. Keep CtrlOps open, or open it again after DNS is ready.

Choose a web server

nginxTraefik
Best forMost servers. This is the recommended choiceServers where you want everything in containers
Runs asA service on the serverA container named ctrlops-proxy
Certificatescertbot gets them and renews them 30 days before expiryTraefik gets and renews them by itself
Works with DeploymentsYes, Deployments uses the same nginxNo
NeedsRoot or sudoDocker with root access

A server uses one web server for all its domains. If nginx already runs on the server, CtrlOps uses it, and you do not choose.

What stays on your server

CtrlOps lists this before it installs anything, and Show commands shows the exact commands.

  • With nginx: the nginx service, a way to renew certificates (the server's certbot timer, or one root cron line that runs twice a day), and domain files in /var/lib/ctrlops/domains.
  • With Traefik: the ctrlops-proxy container, which restarts with Docker, and the same domain files.
  • Firewall: if the server uses ufw or firewalld, you can choose to open ports 80 and 443.

Deleting a domain removes its files. For Traefik, Remove proxy removes the container once no domain uses it.

Read the domain list

The top shows how many domains are healthy and how many need attention. The chip next to them shows your web server and whether renewal is on.

ssl statusWhat it meansWhat to do
validThe certificate is goodNothing
requestedCtrlOps is getting a certificateWait a minute
pendingWaiting for DNS to point hereCheck your A record
expiringIt is close to its end dateCheck that renewal is on. It should renew by itself
expiredThe certificate has ended, and visitors see a warningChoose Issue certificate
failedCtrlOps could not get oneOpen the domain, read why, and choose Retry
wrong certThe certificate on the site is for another nameChoose Issue certificate
noneSSL is off for this domainChoose Issue certificate if you want HTTPS

The target column shows where traffic goes, with a dot for the state of the container. Not managed here marks a site from another file on the server. CtrlOps shows it so you know the name is taken, but it does not change it.

Manage a domain

Click a row to see its details, or open its menu:

ActionWhat it does
Edit domainChanges the target or the settings
Verify DNSChecks that the name points to this server
Issue certificateAsks for a certificate
Disable SSLTurns off HTTPS for this domain
Turn auto-renew offStops renewal for this domain. Not available with Traefik, which renews by itself
Open linkOpens the domain in your browser
Apply againWrites the route again, if it went missing
Delete domainRemoves the route. You can tick Also delete the certificate

The details also have Add an expiry alert, which opens Alerts so you get a message before a certificate runs out.

Redirect a domain to another

In Target, type 301 → app.example.com to send visitors from this domain to another, keeping the path. Use 302 for a temporary redirect, or a full https:// address to send them to one page. You can type -> in place of the arrow.

Add a domain from a container

Open the container, go to its Domain tab, and click Add domain. Type the Domain name and the Port, keep HTTPS on, and click Add. The tab also shows the IP address of the server, with Copy IP, for your A record.

The Domain tab shows only the domains of this container.

Add a domain when you create a container

When you create a container or deploy a stack, click Link in the domain column of the Container stack table. CtrlOps adds the domain after the container starts.

Besides the domain name and HTTPS, the panel has Verify DNS, Redirect HTTP → HTTPS, and Auto-renew. If the server has no web server yet, CtrlOps asks to install one when you create.

Load balancer runs several copies of a service behind one domain. Set the Replicas and how to share visitors: round robin, least connections, or ip hash / sticky. Replicas need a Compose stack, and the service cannot have a fixed container name.

Tips

  • Set up DNS before you add the domain. It saves you from failed checks and the Let's Encrypt limit.
  • Use nginx if you also use Deployments. Both share one web server, so nothing fights over ports 80 and 443.
  • Add an expiry alert. Renewal is automatic, but an alert tells you if it ever stops.

Troubleshooting

Most failures show Show details with the Likely cause, Retry where it helps, and Copy report. Send that report with any support question.

The domain does not reach this server on port 80.

Either DNS points to another server, a cloud firewall or security group closes port 80, or another server answered. Let's Encrypt needs port 80 to check your domain, so open it, then choose Retry.

No A record, or DNS points to another server

Add or change the A record at your DNS provider, then choose Verify DNS again. If you also have an AAAA record, make sure it points here too, because Let's Encrypt tries IPv6 first.

The domain is behind the Cloudflare proxy.

CtrlOps cannot see the server behind Cloudflare, so it cannot confirm your DNS. If the certificate fails, set the record to DNS only until the certificate is ready.

Let's Encrypt refused: too many requests for this name.

Let's Encrypt limits requests, and allows only 5 failed checks per hour for a name. Fix the cause, wait, and try again later.

Let's Encrypt could not read the test file on this domain.

Something other than this web server answered, such as another server or a CDN. Check your DNS and any proxy in front of the server.

No certificate after 3 minutes.

With Traefik, it keeps trying by itself every few minutes. Check DNS and port 80, then read the details on the domain.

Another program uses ports 80 and 443.

Only one program can use these ports. CtrlOps adds Docker domains through nginx or Traefik only, so it cannot use Apache, another proxy container, or a PM2 app on port 80. Stop that program, or move it to another port.

This nginx does not read /etc/nginx/conf.d.

CtrlOps adds routes as files in that folder. Add an include line for conf.d to your nginx config, then click Read again.

nginx did not accept the new file. CtrlOps put the old file back.

Your sites stayed up. Open Show details to read the error. If the message is The nginx configuration of this server has an error now. CtrlOps changed nothing., fix that error first, and then try again.

SELinux stops nginx from connecting to the container.

Turn on the option Allow nginx to connect to local ports (SELinux) when you set up the web server.

The route is ready, but the container does not answer.

The domain works, but the app does not reply. Check that the container runs, and that the port in the target is the one the app listens on. The logs usually show why.

Target not found

CtrlOps cannot find that container. It may have been renamed or deleted. Choose Edit domain and set the target again.

This container has no port on the host.

A container on the none network, or on a macvlan or ipvlan network, has no port the web server can reach. Move it to a bridge network.

Certificates do not renew on this server.

The renewal timer or cron line stopped. Click Start renewal. Your certificates keep working until they expire, so fix this soon.

Traefik needs Docker with root access.

This Docker runs without root, so Traefik cannot use ports 80 and 443. Choose nginx instead.

Frequently Asked Questions

Do I need to keep CtrlOps open for certificates to renew?

No. Renewal runs on the server. With nginx, certbot renews a certificate 30 days before it expires. Traefik renews certificates by itself. You only need CtrlOps to set things up or check on them.

Should I choose nginx or Traefik?

Choose nginx unless you have a reason not to. It is the recommended choice, and the Deployments tab uses the same nginx. Traefik runs in a container and needs Docker with root access.

Will adding a domain break my existing sites?

No. With nginx, CtrlOps writes one new file, tests it, and reloads nginx, so the sites that run now stay up. If nginx does not accept the file, CtrlOps puts the old one back.

Can I use a wildcard domain or an IP address?

No. CtrlOps needs a full host name, such as app.example.com. It does not support wildcard names, and it does not add a domain for an IP address.

Does a container need a published port to use a domain?

Yes. The web server reaches the container through a port on the server. If the port is not published, CtrlOps offers to publish it on 127.0.0.1 only, so the app is reachable through your domain and not through the port. This restarts the container.

Ask AI

Your privacy preferences. We use product analytics to improve CtrlOps. Google measurement runs without analytics cookies. Live chat stays off until you allow it. Cookie policy