Skip to main content
A private region connects to your control plane through the region hub: a NATS server that each region links to with an outbound TLS connection on port 7422. The Docker Compose bundle leaves the hub out, so private regions are off until you add it. This page adds it to an install made with Install with Docker Compose. When you’re done, workspace owners see Settings → Region in the dashboard, where they create a private region and get its install command.

Before you begin

You need:
  • Fonoster installed with Docker Compose and served over HTTPS, with TLS_CERT and TLS_KEY set in .env. Regions link to the hub over TLS with the same certificate, at the same domain (for example voice.example.com).
  • TCP port 7422 open to the internet on this machine. Regions connect to it; nothing connects out.
All commands run in your fonoster folder.

Add the region hub

1

Generate the hub's keys and config

Run the hub setup from the API server image. It writes the hub’s config, the region-signing key and the hub’s credentials into config/:
It prints region hub material in /out and writes config/region-hub.conf, config/keys/region-signing.pem and four files in config/keys/region-hub/. Running it again leaves existing files alone.With the fonoster-region CLI (the region agent image or package) the same step is one command, fonoster-region hub init. It writes the same files, all readable only by you (0600), keeps any that already exist, and prints the next steps:
The leaf port needs TLS, so the command asks for the certificate and key as the hub’s NATS server will see them. For a local stack only, pass --allow-no-tls instead; --leaf-port changes the default 7422.The API server runs as another user, so let it read the new keys:
The files in config/keys/region-hub/ can create credentials for any region. Back them up with .env and keep them private.
2

Create an operator key

The operator key protects the region admin API, which manages public regions. Create one:
You can skip it: private regions work without it, and the admin API stays off.
3

Run the hub

Save this as compose.regions.yaml, next to compose.yaml. It runs the hub with your certificate and makes the API server wait for it:
Then add it to COMPOSE_FILE in .env:
4

Connect the API server to the hub

Open config/fonoster.example.yaml. Keep the regions.public list as it is and add these keys under regions, with your domain in leafUrl:
Edit the example, not config/fonoster.yaml: init writes that file again from the example.
5

Write the config and restart

Write and check the config, then start the hub and recreate the API server:

Check that it works

The API server says at start whether private regions are on:
The line ends with enrolled regions on; admin API on. If it says off, check signingKey and hub in config/fonoster.example.yaml, and that region-hub is healthy in docker compose ps. With an operator key, list every region through the admin API:
Then sign in to the dashboard and open Settings → Region. From there, a workspace owner creates a private region and gets the command that installs and enrolls it on their own machine.