Skip to content

Access, hostnames, and TLS

An application becomes publicly reachable when it has at least one access entry. An access entry connects a port on a workload to a hostname on the internet, and chooses the protocol and the TLS strategy that bridges the two.

spec:
access:
- name: public
type: https
target: { workload: web, port: http }
hostname: { generated: true }
tls: { managedBy: edgible }
policies:
auth: { modes: [none] }

This page walks through each piece.

Edgible supports three access protocols:

typeWhat it doesWhen to use
httpsTLS terminated at Caddy on the device; HTTP forwarded to the workload.The default for any web app or HTTP API.
tcpRaw TCP byte stream forwarded over the tunnel — bytes are not inspected or modified by the platform.Databases, custom protocols, anything non-HTTP.
udpRaw UDP datagrams forwarded over the tunnel.Game servers, DNS, anything UDP-native.

For https, the platform handles TLS. For tcp and udp, your workload is responsible for any encryption it wants — the platform is a transparent pipe.

A hostname tells the platform which traffic belongs to this access entry. Every https access always gets a generated hostname; a custom domain is optional and additive on top of it.

hostname: { generated: true }

Edgible mints a hostname under a platform-owned domain from your app and access names. The primary access gets the bare <app>.<org>.edgible.app; every other access gets its name as a prefix label: <accessName>.<app>.<org>.edgible.app (for example an access named admin on app myapp in org acme → admin.myapp.acme.edgible.app). The hostname is stable for the lifetime of the access — it doesn’t change on redeploy. Apps created before Edgible moved to edgible.app keep their .edgible.com name; it works the same way. See Multiple access entries for how primary is chosen.

The generated hostname is never withdrawn while the access exists — even after you add a custom domain, it stays live as a support/debug escape hatch.

hostname: { custom: api.example.com } # one FQDN; rides alongside the generated name

Add a hostname you control. custom is a single FQDN and is additive: the access serves on both the generated name and your custom name at once. That makes cutover zero-downtime — both names answer while your DNS propagates — and means an access can have up to two certificates (one for the generated name, one for the custom name).

You’re responsible for pointing DNS at Edgible: add a CNAME from your custom name to the access’s generated .edgible.app hostname (Edgible keeps that name’s A record on the gateway, so the CNAME chases it automatically). stack deploy, stack status, and application get all print the exact record as a two-line block — a label line followed by the indented record:

DNS record needed for <hostname>:
<hostname> CNAME <target>

Apex domains get an ALIAS/ANAME variant. The generated hostname gates the deploy; the custom hostname does not block it — once DNS resolves, its certificate is issued by the edge-cert reconciler and traffic starts flowing on that name too. If issuance failed before DNS was ready, edgible certs retry <hostname> --app <id> forces a fresh order (the platform also retries on its own within ~6h). See Use a custom domain for the full walkthrough.

To publish the same workload at several custom hostnames, declare multiple access entries (below) — one custom domain per access.

For https access, you choose how the certificate is obtained.

tls: { managedBy: edgible } # default — platform manages cert lifecycle
tls: { managedBy: passthrough } # workload handles TLS itself

With managedBy: edgible, the platform orders the certificate, validates the domain, installs it on the device’s Caddy, and rotates it before expiry. You don’t see the cert; the platform handles its lifecycle. This is the default.

With managedBy: passthrough, the platform forwards TLS bytes directly to the workload — your workload terminates TLS itself. Use this when you have a specific reason to control the certificate (for example, mTLS terminated by your application).

Every access entry can specify an authentication mode that runs before the request reaches your workload:

policies:
auth: { modes: [none] }

Five modes are supported:

  • none — anyone with the URL can reach the service. Use for genuinely public endpoints.
  • edgible-login — the requester must present a valid Edgible session for a member of your organization. Use for internal tools.
  • api-key — the requester must present a bearer token issued by edgible application api-keys create. Use for programmatic access.
  • short-code — the requester must present a short-code token (rotating, time-bounded, optionally usage-capped). Use for short-lived shareable access.
  • app-native — the platform passes the request through; your application’s own login is the declared control. Valid only on a routes[] entry, never at the access root, and never combined with another mode.

The check happens at Caddy on the device, before the request reaches your workload. A missing or invalid credential returns 401 without your code seeing the request at all. See Authentication modes for the details of each.

Raw TCP and UDP connections carry no login or API key, so the only thing the gateway can check is the address a connection comes from. Mark a tcp or udp access private and only the addresses on its allow list can connect.

ipRules on a tcp/udp accessWho can connect
no allow list, not privateeveryone
allow: [203.0.113.7]only 203.0.113.7
private: true, no allow listnobody
private: true, allow: [203.0.113.7]only 203.0.113.7

The difference shows when the list becomes empty. Without private, removing the last address opens the port to everyone. With private, it closes the port to everyone.

Example: SSH to a home server from your laptop only. Here the device’s SSH server listens on port 22022, which is also the public port (see the YAML below to keep SSH on port 22).

Terminal window
# Reachable from this computer only
edgible application create existing --name ssh-box --port 22022 --protocol tcp \
--device-id <serving-device> --private --allow-my-ip
# The app's address is shown by: edgible application get ssh-box
ssh -p 22022 you@<app-address>
# Later, from another network (a café, a hotel): add the address you are on now
edgible application update ssh-box --allow-my-ip
# Close the port to everyone, keeping it private
edgible application update ssh-box --allowed-ips none

The same in YAML, with public port 22022 sent to SSH on port 22:

spec:
workloads:
- name: ssh
type: pre-existing
ports:
- { name: ssh, containerPort: 22, protocol: tcp }
access:
- name: ssh
type: tcp
target: { workload: ssh, port: ssh }
listenPort: 22022
policies:
ipRules:
private: true
allow: [203.0.113.7/32]
  • --allow-my-ip adds the address Edgible sees your computer connect from (as /32), once. Behind a VPN or a work proxy, that is the VPN’s or the proxy’s address. Many home and phone networks change address from time to time; run --allow-my-ip again when the connection stops working.
  • IPv4 only. The gateway’s TCP/UDP path is IPv4, so --allow-my-ip connects to Edgible over IPv4 when your computer has both. If Edgible still sees you over IPv6 (an IPv6-only network), the CLI says so; add your IPv4 address instead (for example from curl -4 https://ifconfig.me) with --allowed-ips.
  • An address is not a person: everyone behind the same office or mobile network address can connect. Keep the app’s own password or key (SSH keys, a database password) switched on.
  • --access <name> picks the access when an application has several tcp/udp accesses. --no-private turns private off again.
  • Changing private or the lists takes effect within seconds and does not restart the app.
  • private needs agent 1.4.14 or later on the application’s gateway. On an older gateway the change is refused with AGENT_VERSION_TOO_OLD, because an older gateway would ignore it and leave the port open.
  • private applies to tcp and udp only. Protect an https access with policies.auth (login or API keys) or an allow list, which on https already admits only the listed addresses.

Beyond auth, an access entry’s policies block can include ipRules, rateLimit, and waf — see the YAML reference for the full set. ipRules.allow/ipRules.deny (IPv4/IPv6 addresses or CIDR blocks) are enforced at the gateway: an allow list is default-deny (only listed sources reach the app), a deny list drops listed sources, and deny wins when both match. rateLimit is enforced for tcp/udp accesses (new connections per minute); for https accesses rateLimit and waf are accepted by the schema but not enforced yet — the request telemetry the platform now records (see Watching your traffic) is the data those controls will be built on.

An application can declare several access entries — a public web surface, a login-gated admin surface, a raw TCP port — each with its own hostname, TLS, and policies.

spec:
workloads:
- name: web
type: compose
composeFile: ./compose.yml
ports:
- { name: http, containerPort: 8080, protocol: tcp }
- name: admin
type: docker
image: ghcr.io/acme/admin:latest
ports:
- { name: http, containerPort: 9000, protocol: tcp }
access:
- name: public # → myapp.acme.edgible.app (primary)
type: https
primary: true # optional; defaults to the first https entry
target: { workload: web, port: http }
hostname: { custom: app.example.com } # additive; generated name stays live
tls: { managedBy: edgible }
policies: { auth: { modes: [none] } }
- name: admin # → admin.myapp.acme.edgible.app
type: https
target: { workload: admin, port: http }
policies: { auth: { modes: [edgible-login] } }

Primary selection. One https access is the primary and gets the bare <app>.<org>.edgible.app. Set primary: true on exactly one access to choose it (declaring two is rejected with MULTIPLE_PRIMARY_ACCESS); if none is marked, the first https access is primary. Every non-primary access gets the <accessName>.-prefixed name.

Agent version. Multiple access entries, routes[], and additive custom hostnames are enforced on the device, so the target device/gateway must run agent ≥ 1.2.0. An older agent fails the apply with 400 AGENT_VERSION_TOO_OLD naming the field and device.

Instead of a single target, an https access can carry a routes[] table that sends different paths to different workloads, each with its own auth:

access:
- name: public
type: https
hostname: { generated: true }
tls: { managedBy: edgible }
routes:
- path: /api/*
target: { workload: api, port: http }
stripPrefix: false # default — workload receives /api/health unchanged
policies: { auth: { modes: [api-key] } }
- path: /*
target: { workload: web, port: http }
policies: { auth: { modes: [none] } }
  • path is /x (exact) or /x/* (prefix). Matching is longest-prefix, exact beats wildcard, and is deterministic regardless of the order you list routes.
  • stripPrefix (default false) controls the path the workload sees. With the default, GET /api/health arrives at the workload as /api/health. Set stripPrefix: true and the matched prefix is removed — GET /api/health arrives as /health.
  • policies are per-route, so /api/* can require an api-key while /* is public.
  • An access-level target is shorthand for a single /* route. You give an access either target or routes (not both — ACCESS_TARGET_OR_ROUTES). Two routes with the same path is DUPLICATE_ROUTE_PATH.
  • A missing /* route is legal (API-only apps) — edgible stack validate warns, it is not an error. Requests that match no route get a platform no-route page: HTTP 404 with header X-Edgible-Route: none, so a platform 404 is distinguishable from a workload 404 at a glance.

The older pathPolicies (path-scoped auth only) is deprecated in favour of routes[] but still accepted; declaring both on one access is rejected with ROUTES_PATHPOLICIES_CONFLICT.

To put Edgible login in front of one part of a site, such as an admin area, and leave the rest public, give the access a routes[] table and set edgible-login on the routes you want to protect. A route with no policies of its own uses the access’s policies.auth; when the access declares none, that route is public.

access:
- name: web
type: https
routes:
- path: /admin
target: { workload: app, port: http }
policies: { auth: { modes: [edgible-login] } }
- path: /admin/*
target: { workload: app, port: http }
policies: { auth: { modes: [edgible-login] } }
- path: /*
target: { workload: app, port: http }
  • List both /admin and /admin/*. /admin matches only that exact path, and /admin/* matches everything below it but not /admin itself.
  • Only the listed paths are protected. If the app also serves admin functions somewhere else, such as /api/admin, add routes for those paths too.
  • The /* route is the catch-all. Without it, requests that match no route get the platform no-route page (see above).
  • To let only some organizations in, add allowedOrganizations next to modes on the protected routes. A route that lists none uses its access’s list; with no list anywhere, only your own organization gets in. Each path checks this on every request: someone signed in through an organization that only /partners/* lists gets in there and gets 403 on /admin. When your paths list different organizations, the app’s devices need agent 1.4.14 or later (an apply is refused while one runs an older agent).
  • To let machines through as well, list api-key too: modes: [edgible-login, api-key].
  • The same works on a second https access (for example a separate staff hostname): login set only there still sends people to the Edgible sign-in page and back.

Apply it with edgible stack deploy -f app.yml, or change the current declaration with edgible application edit <app>. Adding the routes reloads the edge routing for that access; your workload is not restarted. Later changes to which login modes a route requires are applied live.

Any apply whose diff removes a live hostname — renaming or deleting an access, reassigning primary, or removing a custom domain — is refused with 409 CONFIRMATION_REQUIRED listing what would change, including the affected hostnames. Re-run with --allow-hostname-removal to confirm (on edgible application update, use --confirm):

Terminal window
edgible stack deploy -f app.yml --allow-hostname-removal

Adding hostnames never trips the guard.