Skip to content

Use a custom domain

Generated hostnames are convenient but they’re not your brand. This guide replaces my-app.myorg.edgible.app with a hostname you own, like api.example.com.

  • A domain you control and can edit DNS for. We’ll use example.com in the examples. Names under edgible.com and edgible.app are Edgible’s own and are refused with RESERVED_CUSTOM_HOSTNAME; for one of those, use the generated hostname.
  • An application already deploying successfully under a generated hostname (the Quickstart endpoint is fine).

A custom domain needs two things at once: DNS pointing at the gateway so traffic arrives, and a certificate so the TLS handshake works. The order matters.

Replace the hostname: block:

app.yml
access:
- name: public
type: https
target: { workload: web, port: http }
hostname: { generated: true }
hostname: { custom: api.example.com }
tls: { managedBy: edgible }
policies:
auth: { modes: [none] }

Run edgible stack deploy -f app.yml.

The custom hostname does not block the deploy — the generated .edgible.app name keeps serving while you set DNS. When the deploy finishes, it prints the exact DNS record your custom hostname needs, right under the hostname:

Application URLs & routes:
──────────────────────────────────────────────────
my-app
public (primary)
https://api.example.com (custom)
DNS record needed for api.example.com:
api.example.com CNAME my-app.myorg.edgible.app
https://my-app.myorg.edgible.app (generated)
/* → web:http [none]

The CNAME target is the access’s generated .edgible.app hostname. Edgible keeps that name’s A record pointed at the gateway for you, so pointing your custom name at it chases to the gateway automatically — and survives gateway IP changes.

The same DNS record is available from stack status and application get:

Terminal window
edgible stack status -f app.yml
# ...
# Hostnames: api.example.com, my-app.myorg.edgible.app
# DNS record needed for api.example.com:
# api.example.com CNAME my-app.myorg.edgible.app

In your DNS provider, create a CNAME record:

NameTypeValue
apiCNAMEmy-app.myorg.edgible.app

Save and wait for propagation. dig api.example.com CNAME +short should eventually return the target.

If you’re putting the hostname at a zone apex that can’t hold a CNAME, use an ALIAS/ANAME to the same target instead — see Apex domains below.

Once DNS resolves, the platform validates the domain and issues a certificate from a public CA — validation usually completes within a minute or two. If DNS wasn’t ready in time and the certificate went to error, the platform retries automatically once the challenge starts resolving (within ~6h). To force it immediately after fixing DNS, run:

Terminal window
edgible certs retry api.example.com --app <application-id>

Check progress any time with edgible certs --app <application-id>. Once issued:

Terminal window
curl -v https://api.example.com/

Should now return your workload’s response over a valid HTTPS certificate.

If you are putting a proxy in front of this hostname, the certificate works differently — see Using a proxy in front of your domain instead of this step.

A custom domain is additive: adding hostname.custom does not remove the access’s generated <app>.<org>.edgible.app name — both serve at once. That makes cutover zero-downtime (the generated name answers while your DNS propagates) and leaves the generated URL as a debug escape hatch. An access can therefore hold up to two certificates — one for the generated name, one for the custom name.

hostname.custom is a single FQDN per access. To publish the same workload at several custom hostnames, declare multiple access entries — one custom domain each — targeting the same workload:

access:
- name: public
type: https
primary: true
target: { workload: web, port: http }
hostname: { custom: api.example.com }
tls: { managedBy: edgible }
policies: { auth: { modes: [none] } }
- name: alt
type: https
target: { workload: web, port: http }
hostname: { custom: api.example.net }
tls: { managedBy: edgible }
policies: { auth: { modes: [none] } }

Each access gets its own certificate once DNS for its custom name points at its generated target. (Removing a custom domain later is a hostname removal — the apply is refused unless you pass --allow-hostname-removal.)

Apex domains (example.com itself, with no subdomain) work, but require an ALIAS/ANAME record at most providers because the apex can’t be a CNAME. Edgible detects the apex case and prints the record accordingly:

DNS record needed for example.com (apex — use ALIAS/ANAME, or an A record to the gateway IP):
example.com ALIAS my-app.myorg.edgible.app

Point the ALIAS/ANAME at the generated .edgible.app target (the same one shown for sub-domains). The generated name is derived from the app and org names (<app>.<org>.edgible.app), not from your custom domain — so an apex custom like example.com still targets your app’s generated my-app.myorg.edgible.app. Most modern DNS providers (Cloudflare, Route53, DNSimple, others) support this. If yours doesn’t, resolve the generated target (dig my-app.myorg.edgible.app +short) and use an A record to that gateway IP — note you’ll then have to update it if the gateway IP ever changes, which the ALIAS avoids.

Your custom domain can sit behind a proxy — a service that answers your visitors at api.example.com itself and forwards their requests on to Edgible. Use this option if you will put a proxy such as Cloudflare’s proxy in front of this domain.

A proxied domain differs from a plain custom domain in three ways, all of them because Edgible no longer answers your visitors directly:

  • You supply the certificate. Edgible issues certificates by proving control of the domain over the domain itself — which it cannot do when the domain is answered by someone else. For a proxied domain you create a certificate in your proxy provider’s dashboard and upload it to Edgible, which stores it, serves it to the device, and shows you its expiry. It never renews it.
  • Visitor addresses are your proxy’s. Requests arrive from your proxy, so the visitor addresses Edgible reports, and any ipRules on the access, apply to your proxy and not to the people using your site. Block or allow visitors with your proxy provider’s own rules instead.
  • Only web traffic goes through it. Proxies carry HTTP(S). A tcp or udp access needs its own unproxied name — see Keep TCP and UDP names unproxied.

Your access’s generated <app>.<org>.edgible.app name is unaffected: it keeps serving directly, with a platform-issued certificate, and stays your escape hatch for checking the application without the proxy in the path.

In the webapp, tick Proxied domain under the custom domain field. In YAML, set proxied: true on the hostname and managedBy: provided on the TLS block:

app.yml
access:
- name: public
type: https
target: { workload: web, port: http }
hostname: { custom: api.example.com }
tls: { managedBy: edgible }
hostname: { custom: api.example.com, proxied: true }
tls: { managedBy: provided }
policies:
auth: { modes: [none] }

The two go together — a proxied domain is refused unless tls.managedBy is provided, and provided is refused on an access with no hostname.custom. No certificate material ever goes in the YAML.

Deploy as usual. Until you upload a certificate the device serves a placeholder certificate on api.example.com, which browsers reject — the custom hostname does not hold up the deploy, and the generated hostname serves throughout.

2. Create the certificate at your proxy provider

Section titled “2. Create the certificate at your proxy provider”

Create a certificate for the hostname (or a wildcard covering it) in your proxy provider’s dashboard. In Cloudflare’s dashboard this is an Origin Server certificate: it is issued for the names you list, you pick its validity when you create it, and it is trusted by Cloudflare’s proxy — not by browsers. Pick a validity you are willing to keep track of: Edgible never renews a supplied certificate, so every expiry is an upload you have to make.

Download the certificate and its private key as PEM. If your provider gives you a chain as well, keep it — it is optional on upload.

An origin-verification setting pairs with this certificate and must be turned on, or the proxy will not check what it is connecting to. In Cloudflare that setting is the Full (strict) SSL/TLS encryption mode for the zone.

Terminal window
edgible certs upload api.example.com --app <application-id> \
--cert ./origin.pem --key ./origin.key

Add --chain ./chain.pem if your provider gave you one.

In the webapp, open the application, edit the access’s hostname, and use Upload certificate — certificate, private key and optional chain, each a paste box with a file picker.

Before it is stored, Edgible checks that the certificate and key parse, that the key matches the certificate, that the certificate’s subject alternative names cover this hostname (a name in the subject alone is not enough), and that it is neither expired nor not-yet-valid. A failure names the one check that failed and changes nothing that is currently being served.

Once stored, the certificate is delivered to the serving device on the next reconcile and edgible certs --app <application-id> shows the hostname in state Supplied with its expiry. The webapp’s certificate card shows the same, with a Replace certificate action.

Create the same CNAME as in Update your DNS above, then enable proxying for that record at your provider. Requests then land on your proxy, which connects to Edgible over HTTPS and verifies the certificate you uploaded.

Upload again — the same command, the same dialog. The new certificate replaces the old one wholesale and the device picks it up on its next reconcile. edgible certs retry and the webapp’s repair action do not apply to a supplied certificate and are refused; replacement is always an upload.

If a supplied certificate lapses before you replace it, Edgible marks it expired and the device falls back to its placeholder certificate — your proxy will then refuse the connection. Watch the expiry in edgible certs and replace it ahead of time.

Proxies carry web traffic. If an SSH or database access is published on a name you have proxied, it will not connect. Give those accesses their own hostname (ssh.example.com) and leave its DNS record unproxied, pointing at the generated target as usual.

A certificate from your proxy provider is trusted by that provider, not by browsers. If you remove the proxy while it is still serving, visitors get a certificate warning.

Switch the access back to platform issuance first — drop proxied: true and managedBy: provided together, since neither is valid without the other:

hostname: { custom: api.example.com }
tls: { managedBy: edgible }

Deploy, then wait for edgible certs --app <application-id> to show the hostname issued. The supplied certificate keeps serving the whole time, so there is no gap; once the platform certificate is issued it takes over. Only then turn proxying off at your DNS provider.

If the hostname does not reach issued, the platform’s domain-control check is not getting through your proxy. Turn proxying off at your DNS provider and let the certificate issue directly — visitors see a certificate warning for the few minutes that takes.

The reverse switch is just as safe: moving an already-working custom domain from managedBy: edgible to managedBy: provided leaves the platform certificate serving until your first upload replaces it.

If you would rather not hand over the private key

Section titled “If you would rather not hand over the private key”

Uploading stores the private key with Edgible, held the same way as the keys of the certificates the platform mints. If that is not acceptable, use the on-device alternative instead: tls: { managedBy: device, certPath, keyPath } keeps the material on the serving device and Edgible never sees it. You copy the files to every serving device yourself, and Edgible cannot show you the certificate’s state or expiry. See the tls field in the application YAML reference.

Switch the YAML back to a generated hostname (or delete the access entry) and re-deploy. The platform will release the cert and the gateway will stop accepting traffic for the old hostname. You can then remove the DNS record.