Where to run it
This machine
To try Midplane. Only agents on this machine can use it.
A server, with Docker
For a team or production: agents anywhere reach it at an HTTPS URL.
This machine
You need Node 24.16 or newer, and macOS, Linux or WSL on Windows.1
Create an enrollment token
In your project, open step 2 of the setup (or Gateways, then Set up
a gateway), and click Create enrollment token. The gateway uses it
once, to join your project. Keep the page open: the commands below it now
hold the token.
2
Make the gateway's folder
Choose This machine and run the first block in a terminal. It makes a
folder named after the gateway, such as
gw-k3m9x2qa, with a secrets/
folder inside, and moves into it.3
Save the config
Copy the config the page shows into that folder as
midplane.yaml. It’s
generated for your project, with every database listed.4
Add the connection strings
For each database, write its connection string to the file the page names,
such as
secrets/shop.dsn, with an editor
(prepare your database).5
Start it
Ctrl-C stops it, and the same command starts it again.http://gw-….localhost:7433 URL in its
config. A second gateway on the same machine needs another port: change it on
the page before you copy the commands.
Docker
You need a server with Docker, a URL for the gateway, such ashttps://midplane.example.com, and a TLS certificate for it: the gateway
serves HTTPS itself whenever it’s reachable from other machines.
1
Create an enrollment token
In your project, open step 2 of the setup (or Gateways, then Set up
a gateway), and click Create enrollment token.
2
Enter the gateway's URL
Choose A server (Docker) and enter the URL agents will use. The page
generates the config and commands for it.
3
Make the gateway's folder
On the server, run the first block. It makes the gateway’s folder with a
secrets/ folder inside.4
Save the config, connection strings and certificate
Save the config as
midplane.yaml. Write each connection string to the
file the page names, such as secrets/shop.dsn; inside the container,
localhost is the container, so use the database’s real host. Put the
certificate and its key in secrets/tls.crt and secrets/tls.key.5
Start it
Run the last block. It gives the secrets to the container’s user and
starts the container, which restarts with the server. The page shows the
gateway connected;
docker logs -f midplane-gw-… shows what it says.:latest in the command with a version you
verified.
Other setups
Behind your TLS proxy
Behind your TLS proxy
If a proxy or load balancer on the same host already serves TLS for the
URL, keep the gateway on loopback and have the proxy forward the URL to
http://127.0.0.1:7433, keeping the Host header. Change the config
before the gateway’s first start, since it registers its URL then:- With
npx: follow this machine, and in its config replace thepublic_urlsline withpublic_urls: [https://midplane.example.com]. - With Docker: follow Docker, and in its config replace the
listenline withlisten: { host: 127.0.0.1, port: 7433 }and delete thetlsline. In the last block, run the container with--network hostin place of-p …(Linux only).
A platform without a disk
A platform without a disk
Some platforms keep no files across restarts, so the gateway can’t keep the
identity it gets when it joins. Enroll it once and store the identity as a
secret instead:
- In the config, set
link.identity: { env: MIDPLANE_IDENTITY }. - Run
npx -y midplane@latest enroll --config midplane.yamlwith the token in place. It prints the identity as one line of JSON. It reads the whole config, so every file and variable it names must exist there. - Store that line in the platform’s secrets as
MIDPLANE_IDENTITY, and delete any copy: it holds the gateway’s private key.
What the gateway's folder holds
What the gateway's folder holds