If you haven’t set up the Infisical platform yet, follow the local development guide first.
Local development setup
In a local dev environment, the Infisical platform runs inside Docker while the gateway runs directly on your host machine. Use direct listen mode: the backend dials the gateway, so there’s no relay to run.The gateway listens on
host.docker.internal so the Dockerized backend can reach it on your host machine.Prerequisites
- Infisical platform running locally via
docker compose -f docker-compose.dev.yml up - Go installed
- A machine identity with Token Auth configured (see Token Auth docs)
Clone the CLI repository
The gateway lives in the Infisical CLI repository. For local development, run it viago run main.go rather than the pre-built binary:
Start the Gateway
From the CLI repository root:Using a relay instead
Using a relay instead
Direct listen needs nothing else running, so prefer it unless you’re testing relay behaviour itself. For that, start a relay first and point the gateway at it with Verify the relay at Organization Settings > Networking > Relays. See the Relay CLI Reference for all flags.
--target-relay-name instead of --listen-address:Quick reference
Seed test resources
Once your relay and gateway are up, you still need actual databases and SSH servers to point PAM at. Spinning those up by hand — running each container, creating users, then working through the UI to register every resource and account — is the slow part of any PAM dev loop. Thedev/pam dev stack in the Infisical CLI repo does both in one shot: it boots the resources you pick in .env, pre-seeded with users and sample data, then registers each one as a PAM resource + account in your local Infisical against the gateway you just started.
make up, you get a connection table along with the CLI command and web access URL for each resource — no need to dig through the Infisical UI to grab them, just copy and use:
dev/pam README for setup, env vars, and the full list of make targets.
You’re not locked into this stack — PAM works against anything reachable from the gateway, so you can also point it at your own containers or cloud-hosted resources (DigitalOcean, AWS, etc.) when you need to test against something closer to production.
Troubleshooting
Gateway cannot connect to Infisical
Gateway cannot connect to Infisical
Ensure the backend is fully started before running the gateway. Check logs:
Backend cannot reach the gateway
Backend cannot reach the gateway
- Check the gateway logs for “Direct gateway listener started”
- Ensure
--listen-addressuseshost.docker.internal, notlocalhost, so the Dockerized backend can reach your host - Ensure the port isn’t already in use
Cannot reach local resources through gateway
Cannot reach local resources through gateway
- Check resource connection details are correct
- Ensure target resource is running and accessible from your machine
Next steps
- Launch your first session and test connections through the gateway
- Explore session recording functionality