Hostnames and custom domains
Each deployment has exactly one hostname, chosen in freepod init and changed with hostname in .freepod.json. It is either a Freepod hostname ending in your handle, or a domain you own.
Freepod hostnames
Your account's handle, such as alice, is chosen once in the browser. See Get started. A Freepod hostname is an app name followed by - and your handle:
myapp-alice.freepod.app
- Set
hostnameto the app name alone (myapp). Freepod completes it with your handle, andfreepod deployprints the resulting address. - The app name is 1 to 34 characters of letters, digits and hyphens. It does not start or end with a hyphen and does not contain
--. Names starting withpreview-are reserved. - There is no limit on the number of hostnames ending in your handle, but each deployment has one, and a hostname can be used by only one deployment at a time.
- Hostnames ending in another account's handle, and names nested below a Freepod hostname (
a.myapp-alice.freepod.app), are refused. - Certificates for these hostnames are in place before the first deploy.
Custom domains
A deployment can use a domain you own: a name within it, such as app.example.com, or the domain itself, such as example.com.
-
At your DNS provider, point the hostname at Freepod:
Hostname Record app.example.comCNAMEtofreepod.appexample.comALIAS,ANAMEor flattenedCNAMEtofreepod.app, where the provider offers one. Without one, the domain itself cannot be used.Step-by-step instructions for common providers are in Custom domain.
-
Enter the hostname in
freepod init, or, for an existing app, set it in.freepod.json:.freepod.json"hostname": "app.example.com" -
Run
freepod apply.
Freepod checks the record with the domain's authoritative nameservers at every release, and refuses the release if it does not point to Freepod:
- A
CNAMEmust point to exactlyfreepod.app. - Without a
CNAME, as withALIAS,ANAMEand flattened records, everyAandAAAAaddress of the hostname must be one offreepod.app's current addresses. Do not createAorAAAArecords with Freepod's addresses by hand: they can change. - A record proxied through Cloudflare resolves to Cloudflare's addresses instead. It is accepted when a
TXTrecord at_freepod.<hostname>, such as_freepod.app.example.com, holds your handle followed by.freepod.app, such asalice.freepod.app. Freepod cannot check where Cloudflare forwards it, andfreepod initsays so when it accepts the hostname. Set Cloudflare's encryption mode to Full (strict) and leave Always Use HTTPS off; see Through Cloudflare's proxy.
It obtains a TLS certificate for the hostname from Let's Encrypt and renews it automatically. Keep the record in place: releases and certificate renewal depend on it.
- Turn off proxying for the record at providers other than Cloudflare that offer it. A proxied record resolves to the provider's addresses.
- If the domain has
CAArecords, they must allowletsencrypt.org.
Changing the hostname
Set hostname in .freepod.json and apply it:
freepod apply
The new hostname serves the deployment once the release completes. The old hostname stops serving immediately and becomes available to other deployments; requests to it are not redirected.
Applications that store their own URL, issue links, or are identified by their hostname, such as federated services, may need their own configuration updated or may not work under a new hostname.