Use your own domain on a container, with HTTPS
Point a subdomain at your container, check DNS, and get an HTTPS certificate automatically.
Every container already has an address like https://name.ct.pgbhub.app, with HTTPS included. When you are ready for production you can serve it from your own domain, such as api.yourdomain.com.
What you need
- A domain you control, and access to its DNS settings.
- A subdomain, such as
app.yourdomain.com. A bare root domain such asyourdomain.comcannot be used, because a root domain cannot use the kind of DNS record this needs. The Console tells you to use a subdomain instead. - A deployed container. See Deploy a container.
Connect a domain
- In the sidebar, choose Custom Domains (under Core Services & Infrastructure).
- Under Connect a Custom Domain, pick the Target Container Service.
- Enter the Custom Subdomain, for example
api.yourdomain.com. - Choose + Connect Custom Domain.
- The page shows a DNS record to add: type CNAME, Name your subdomain, Value the CNAME Target shown at the top of the page.
- Create that record at your DNS provider.
If your DNS provider offers a proxy option (an "orange cloud" or similar), set this record to DNS-only. A proxied record answers on its own before the request reaches your container, so your certificate can never be issued.
Verify and go live
On the domain's row, choose Check DNS. The status will be one of:
- Pending DNS: the record is not visible. DNS changes can take a while.
- Verified SSL: the record is found and your HTTPS certificate is active. Your container now answers on your domain.
- Failed: something did not work. Re-check the record.
The certificate is issued automatically the first time real traffic arrives for the domain with DNS pointing correctly. Open https://api.yourdomain.com once to trigger it. In the container's own page, a linked domain shows SSL ACTIVE or PENDING DNS next to its address.
Link or move a domain
- On a container's Configure page, Availability & Scaling has a Custom Ingress Domain area with + Link New Domain, Check DNS and Unlink.
- A domain already registered in the project can be moved: choose Link an existing project domain... and Attach Domain.
- Remove on the Custom Domains page stops routing to that domain immediately.
Good to know
- A domain can belong to only one project, and only one purpose at a time. If it is already used elsewhere, such as for authentication emails or another feature, you are asked to use a different subdomain.
- Your
.ct.pgbhub.appaddress keeps working alongside your own domain. - Your container still sleeps and wakes the same way when served from your own domain. See Scale to zero.
- For DNS basics, see Verify DNS records.
More guides in Console: containers & domains
Deploy a container from code, GitHub or an image
Run a backend service, web app or worker in your project, with a public address and your database already connected.
Scale to zero: how sleeping and waking works
Let idle containers sleep at no compute cost, wake on the next request, or keep one always online.
Container environment variables, secrets and logs
Configure your container with variables and project secrets, and read build and runtime logs to fix problems.