Skip to main content
Infisical Gateways enables secure communication between your private resources and the Infisical platform without exposing inbound ports in your network. This guide covers everything you need to deploy and configure Infisical Gateways.
For a complete Helm chart reference for Kubernetes deployments, see the Gateway Helm chart documentation.

Deployment steps

1

Set Up a Relay Server

Ensure a relay server is running and accessible before you deploy any gateways. You have two options:
  • Managed relay (Infisical Cloud, US/EU only): If you are using Infisical Cloud in the US or EU regions, you can use the provided managed relay.
  • Self-hosted relay: For all other cases, you must deploy your own relay server. See the Relay Deployment Guide.
2

Create the Gateway in the UI

  1. Navigate to Organization Settings > Networking > Gateways.
  2. Click Create Gateway. Create Gateway button
  3. Enter a name for the gateway. Create Gateway form
  4. (Optional) Open the new gateway’s detail page and change the method under Authentication in the Details card. Three methods are supported:
    • Token (default): a one-time enrollment token (1h expiry) bootstraps the gateway.
    • AWS: the gateway authenticates by signing an sts:GetCallerIdentity request with whatever AWS credentials it can resolve on the host (instance role, env vars, shared profile). Configure the allowed principal ARNs and/or account IDs that match your hosts.
    • Kubernetes: the gateway authenticates with the projected service account token of the pod it runs in, so no credential has to be distributed to the cluster. Configure the cluster’s API server URL and the allowed namespaces and/or service account names.
  5. Click Show deploy command in the Deployment card. Pick a relay (or “Auto Select Relay”) and copy the generated CLI command.
3

Install the Infisical CLI

Make sure the Infisical CLI is installed on the target machine. See the CLI Installation Guide for instructions.
4

Configure Network & Firewall

Ensure your network and firewall settings allow the gateway to connect to all required services. All connections are outbound only; no inbound ports need to be opened.For managed relays, allow outbound traffic to the provided relay server IP/hostname. For self-hosted relays, allow outbound traffic to your own relay server address.If you are in a corporate environment with strict egress filtering, ensure outbound TCP 2222 to relay servers and outbound HTTPS 443 to Infisical API endpoints are allowed.
For the full connection model, a complete port reference, and firewall details (including self-hosted relays and HTTP forward proxies), see the Network Architecture page.
5

Run the CLI Command

Run the command you copied from the UI on the target machine. This single command enrolls the gateway and starts it immediately.
A one-time enrollment token (1h expiry) bootstraps the gateway.
The host must have AWS credentials whose principal matches your allowlist. The gateway re-authenticates via STS on every start.
The gateway sends the projected service account token of its own pod, and Infisical verifies it against your cluster’s TokenReview API. Nothing has to be copied into the cluster, so this is the method to use when gateway creation is automated. The gateway re-authenticates on every start.Before deploying, configure the Kubernetes auth method on the gateway’s detail page:At least one of Allowed Namespaces or Allowed Service Account Names must be set, so that not every pod in the cluster can enroll as the gateway.

Clusters with a private API server

By default Infisical calls your API server directly, which requires an address it can reach. If your API server is private, select a gateway or gateway pool under Gateway and the check is tunnelled through it instead. Two modes are available:A gateway pool can only be used with Manual Token Reviewer JWT (API), where any healthy member performs the check and one gateway going offline does not stop the others from authenticating. Gateway as Reviewer requires a specific gateway, because in that mode the selected gateway decides the outcome and pool membership can change after the config is saved.
A gateway cannot review its own token. The proxy runs over the gateway’s own tunnel, which only exists once it has already authenticated, so the reviewer must be a different gateway that is already enrolled and connected.This means the first gateway in a private cluster cannot use Kubernetes auth. Enrol it with an enrollment token or AWS auth, then point later gateways at it. Deleting a gateway that other gateways use as their reviewer is refused until they are pointed elsewhere.
Install the Infisical Helm chart repository:
Install the gateway:
The chart binds the gateway’s service account to the system:auth-delegator ClusterRole by default, which is what lets its own token act as the token reviewer. Set serviceAccount.createAsAuthDelegator=false only if you configure a separate Token Reviewer JWT on the gateway instead.
Make sure the release namespace and service account name match the allowlists you configured. With the command above, that is namespace infisical-gateway and service account infisical-gateway.
Infisical must be able to reach the cluster’s API server to review the token. For a cluster with no publicly reachable API server, use Token or AWS auth instead.
The systemd install command requires Linux with root/sudo privileges.
Token-method enrollment tokens are single-use and expire after 1 hour. If the token expires before deployment, click Show deploy command again on the detail page to generate a new one.
You can safely re-run the same command to restart the gateway. The CLI detects the token has already been used locally and skips enrollment automatically.
6

Verify Your Gateway Deployment

After deployment, verify your gateway is working:
  1. Check logs for “Gateway started successfully” message.
  2. Verify registration in the Infisical UI. Navigate to Networking > Gateways and confirm the gateway shows a “Healthy” status.
  3. Test connectivity by creating a resource that uses the gateway to access a private service.

Managing a gateway

From the gateway’s detail page (click the gateway row in the list):
  • Show deploy command: Generates a fresh enrollment token (token method) or re-displays the start command for the AWS and Kubernetes methods. Clicking this on a token-method gateway does not disconnect the running gateway; the next login with the new token rotates credentials atomically.
  • Edit auth method: Switch between Token, AWS, and Kubernetes, or update the allowlists of the current method. Existing gateways keep their JWT until they restart and re-authenticate.
  • Options → Revoke Access — Disconnects the running gateway and invalidates outstanding enrollment tokens. The gateway must re-authenticate to reconnect. Gated by the dedicated revoke-gateway-access permission, separate from edit-gateways.
  • Options → Delete Gateway — Permanently removes the gateway.
To migrate a gateway to a different host with zero downtime: click Show deploy command to generate a fresh token, run it on the new host, and the new login will rotate credentials away from the old host.

Frequently asked questions

No inbound ports need to be opened for gateways. The gateway only makes outbound connections:
  • Outbound SSH to relay servers on port 2222
  • Outbound HTTPS to Infisical API endpoints on port 443
  • SSH reverse tunnels handle all communication - no return traffic configuration needed
This design maintains security by avoiding the need for inbound firewall rules that could expose your network to external threats.
Test relay connectivity and outbound API access from the gateway:
  1. Test SSH port to relay:
  1. Test outbound API access (replace with your Infisical domain if different):
If the gateway cannot connect to the relay:
  1. Verify the relay server is running and accessible
  2. Check firewall rules allow outbound connections on port 2222
  3. Confirm the relay name matches exactly
  4. Test SSH port to relay:
For token method: ensure the enrollment token has not expired or already been used. Open the gateway’s detail page and click Show deploy command to generate a fresh token.For AWS method: ensure the host has AWS credentials available (instance role, env vars, or shared profile) and the resolved principal/account is in the allowlist on the gateway’s detail page.For Kubernetes method: ensure Infisical can reach the configured Kubernetes host, that the pod’s namespace and service account are in the allowlists, and that the reviewer (the gateway’s own service account by default) holds the system:auth-delegator ClusterRole. The gateway’s audit log records the reviewed namespace and service account name for each login, and the reason code for each failure.
Check gateway logs for detailed error information:
  • systemd service:
  • Local installation: Logs appear in the terminal where you started the gateway
Enrollment tokens expire after 1 hour. If the token expires before deployment, open the gateway’s detail page and click Show deploy command to generate a new one.
For token-method gateways, the access token and domain are saved to a config file scoped by gateway name:
  • Running as root/sudo: /etc/infisical/gateways/<gateway-name>.conf
  • Running as a regular user: ~/.infisical/gateways/<gateway-name>.conf
For AWS-method and Kubernetes-method gateways, no JWT is persisted to disk. The gateway re-authenticates on every start, by signing a fresh STS request with the host’s AWS credentials or by presenting the pod’s service account token. Only the gateway id and domain are stored locally.For systemd-based installations, the configuration is at /etc/infisical/gateways/<gateway-name>.conf. All config files are created with restricted permissions (0600).
Yes. Each gateway stores its credentials in a separate config file scoped by name (e.g., ~/.infisical/gateways/my-gateway.conf). You can enroll and start multiple gateways in separate terminal sessions using different names.
The gateway is designed to handle network interruptions gracefully:
  • Automatic reconnection: The gateway will automatically attempt to reconnect to relay servers if the SSH connection is lost
  • Connection retry logic: Built-in retry mechanisms handle temporary network outages without manual intervention
  • Automatic failover: Gateways configured with automatic relay selection will switch to a different healthy relay if the current one becomes unreachable
  • Gateway Pools: If the gateway itself becomes unavailable, a Gateway Pool will automatically route through a healthy member
  • Persistent SSH tunnels: SSH connections are automatically re-established when connectivity is restored
  • Certificate rotation: The gateway handles certificate renewal automatically during reconnection
  • Graceful degradation: The gateway logs connection issues and continues attempting to restore connectivity
No manual intervention is typically required during network interruptions.