# Domains and HTTPS > How to add a domain to a service, point the DNS, get automatic HTTPS and fix a domain that doesn't open. A domain carries internet traffic to the service's port. For a service on a single server, the server's proxy (Traefik) receives the request and requests the HTTPS certificate from Let's Encrypt, which renews on its own. For a service with replicas, the domain goes through the load balancer: on AWS, the project's, with an AWS certificate; on DigitalOcean, the service's, with a Let's Encrypt certificate issued by the panel. Domains live in the service's **Network** tab. ## Before you start - Domains are for HTTP services (site, API, panel). Databases and Redis stay on the internal network; to connect from outside, see [Private access and public ports](https://ployter.com/en/docs/networking/access/). - Set the service's **Port** in **Settings** (e.g. `3000`). The domain forwards to it. Without a port, the **Network** tab warns you and the deploy is refused. - The server needs a public IP. ## Add a domain 1. Open the service (e.g. `web`) and go to the **Network** tab. 2. Under **Domains**, type the domain (e.g. `loja.com.br` or `www.loja.com.br`) and click **Add**. 3. Keep **Issue HTTPS certificate on the server (Let's Encrypt)** checked, unless Cloudflare with proxy handles SSL (see below). 4. Point the domain's DNS to the server (next section). 5. Run a deploy. Adding or removing a domain applies from the next deploy. ![Network tab of the web service with the loja.com.br domain and the DNS card](https://ployter.com/assets/docs/en/domains-tab.webp) For several names (`loja.com.br` and `www.loja.com.br`), add each one. ## Point the DNS In the **DNS** card, the panel shows the server's IP. At your DNS provider (Registro.br, Cloudflare, GoDaddy...), create an **A** record for each domain: | Type | Name | Value | | --- | --- | --- | | A | `@` (for `loja.com.br`) | Server IP, e.g. `203.0.113.10` | | A | `www` | Server IP | A DNS change can take a few minutes to propagate everywhere. ### With Cloudflare connected With a Cloudflare account connected in **Integrations → Cloudflare**, each domain shows where it currently points on Cloudflare: - **Points here**, with the **proxy** or **DNS only** tag. - **Points elsewhere:** and the current record. - **No record on Cloudflare.** To point it: 1. Click **Point here**. 2. Check the current record and what it will become. 3. Choose whether to turn on the **Cloudflare proxy (orange cloud)**. 4. Click **Point**. The panel keeps the previous record. **Undo** restores it. Adding a domain in the panel never changes DNS on its own: only the **Point** button does. ![Point loja.com.br on Cloudflare modal](https://ployter.com/assets/docs/en/domains-cloudflare-point.webp) See how to connect the account in [Connect Cloudflare](https://ployter.com/en/docs/integrations/cloudflare/). ### HTTPS with the Cloudflare proxy With the proxy on (orange cloud), Cloudflare serves the visitor and connects to your server. The zone's SSL/TLS mode (under **SSL/TLS → Overview** on Cloudflare) must match the domain: | Mode on Cloudflare | Domain HTTPS in the panel | Result | | --- | --- | --- | | **Full** | on or off | Works. It is the simplest mode. | | **Full (strict)** | on | Works once the certificate is issued on the server. Until then, error 526. | | **Full (strict)** | off | Doesn't work: Cloudflare rejects the default certificate. | | **Flexible** | on | Redirect loop. The panel doesn't let you point with proxy. | | **Off** | any | The panel doesn't let you point with proxy. | > [!TIP] > With proxy and **Full** mode, you can turn off the domain's HTTPS in the panel. The server responds over HTTP and Cloudflare handles the visitor's certificate. ## HTTPS on the server With HTTPS on, the server requests the certificate from Let's Encrypt during the deploy and renews it on its own. Let's Encrypt checks that the domain points to the server, so point the DNS before the deploy. The tag next to each domain shows its status: | Tag | Meaning | | --- | --- | | **awaiting deploy** | New domain or HTTPS changed. It goes live on the next deploy. | | **issuing certificate...** | Let's Encrypt is checking the domain. It takes from a few seconds to a few minutes. | | **HTTPS until** (date) | Certificate issued, with its expiration date. It renews on its own. | | **certificate error** | Let's Encrypt refused it. The reason shows right below the domain. | | **no HTTPS on server** | HTTPS turned off. The domain responds over HTTP and SSL is handled by Cloudflare. | To turn it on or off, use the domain's **HTTPS** switch and run a deploy. ## Automatic domain To test before you have a domain, click **Generate automatic domain**. The panel creates an address that already resolves to the server's IP, without touching DNS, in the format `web-xxxxxx.ployter.app`. It is also good for internal panels. If the service moves to another server, the address follows it on its own. > [!NOTE] > The automatic domain has the server's IP in its name. If the service moves to another server, remove it and generate another one. ## When the domain doesn't open Click **Diagnose** on the domain. The panel checks on the server what you would check over SSH (DNS, proxy, certificate, container) and shows each item with its result. The first item with a problem is usually the cause. The diagnosis also shows the Traefik log for the domain. ![Diagnosis modal for loja.com.br with the list of checks](https://ployter.com/assets/docs/en/domains-diagnose.webp) Common causes: - The DNS still points elsewhere, or hasn't propagated yet. - The deploy after adding the domain is missing. - The **Port** in **Settings** isn't the port the application listens on. - The cloud firewall doesn't allow ports 80 and 443 (your own server, or a rule changed by hand). ## Domains with replicas With the service on 2 or more AWS or DigitalOcean servers, the domain goes through the load balancer, which splits traffic across the servers and handles HTTPS. Each domain needs two records in your DNS. The **Network** tab shows the steps for each one and checks on its own every few seconds. When both steps are done, the domain shows **HTTPS active**. ### On AWS The project load balancer is created with the first domain, takes about 3 minutes and costs about US$ 16–20/month on AWS. A new domain is added to the load balancer in moments, with no deploy. 1. **Point the domain to the load balancer**: create a **CNAME** record with the domain name and the load balancer's address. If an A or CNAME record with that name already exists, delete it first. 2. **Validate the HTTPS certificate**: create the second **CNAME** the panel shows. AWS takes 2 to 30 minutes to validate it. Don't delete this record: it also renews the certificate every year. ![DNS steps for loja.com.br with replicas](https://ployter.com/assets/docs/en/domains-replicas-setup.webp) > [!WARNING] > On Cloudflare, keep the proxy off (gray cloud, "DNS only") until step 2 is done. After that, you can turn on the orange cloud with SSL/TLS set to **Full (strict)**. > [!NOTE] > The apex domain (`loja.com.br`, without `www`) doesn't accept a CNAME in most DNS panels. Use an **ALIAS** or **ANAME** record with the same target. On Cloudflare, a CNAME works normally. ### On DigitalOcean Each service with replicas has its own load balancer, with a fixed IP. It's created with the service's first domain, takes a few minutes and costs about US$ 12/month. 1. **Point the domain to the load balancer**: create an **A** record with the IP of the service's load balancer. If an A or CNAME record with that name already exists, delete it first. 2. **Validate the HTTPS certificate**: create, only once, the **CNAME** `_acme-challenge.` the panel shows (e.g. `_acme-challenge.api.loja.com.br` to `k3x9a1b2c3.acme.ployter.app`). With it, the panel issues the Let's Encrypt certificate and renews it on its own, about 30 days before it expires. Don't delete this record. A new domain doesn't take the others down: when its CNAME shows up, a new certificate with all the domains replaces the old one, with no downtime. > [!WARNING] > On Cloudflare, create both records with the proxy off (gray cloud, "DNS only"). Once the certificate is issued, you can turn on the orange cloud with SSL/TLS set to **Full (strict)**. Hetzner, Vultr and Linode servers and your own servers have no load balancer in the panel, so they have no replicas. See [Replicas and load balancer](https://ployter.com/en/docs/scaling/replicas/). ## Remove a domain Click **Remove** on the domain and confirm. For a service on a single server, it applies from the next deploy. The panel doesn't delete the record in your DNS. ## Permissions Adding, removing and pointing domains requires the **Manage domains** permission. See [Teams, members and roles](https://ployter.com/en/docs/team/members/).