The Infisical gateway provides secure access to private resources using modern TCP-based SSH tunnel architecture with enhanced security and flexible deployment options.The gateway system uses SSH reverse tunnels over TCP, eliminating firewall complexity and providing excellent performance for enterprise environments.
Deprecation and Migration Notice: The legacy infisical gateway command (v1) will be removed in a future release. Please migrate to infisical gateway start (Gateway v2).If you are moving from Gateway v1 to Gateway v2, this is NOT a drop-in switch. Gateway v2 creates new gateway instances with new gateway IDs. You must update any existing resources that reference gateway IDs (for example: dynamic secret configs, app connections, or other gateway-bound resources) to point to the new Gateway v2 gateway resource. Until you update those references, traffic will continue to target the old v1 gateway.
Run the Infisical gateway component within your the network where your target resources are located. The gateway establishes an SSH reverse tunnel to a relay server and provides secure access to private resources within your network.
By default, the gateway automatically connects to the relay with the lowest latency. To target a specific relay, use the --target-relay-name=<relay-name> flag.
Once started, the gateway component will:
Automatically connect to a healthy relay with the lowest latency (unless the --target-relay-name flag is specified)
Establish outbound SSH reverse tunnel to relay server (no inbound firewall rules needed)
Authenticate using SSH certificates issued by Infisical
Automatically reconnect if the connection is lost
Provide access to private resources within your network
The Gateway supports multiple authentication methods. Below are the available authentication methods, with their respective flags.
Universal Auth
The Universal Auth method is a simple and secure way to authenticate with Infisical. It requires a client ID and a client secret to authenticate with Infisical.
The Native Kubernetes method is used to authenticate with Infisical when running in a Kubernetes environment. It requires a service account token to authenticate with Infisical.
The name of the relay that this gateway should connect to. The relay must be running and registered before starting the gateway.If this flag is omitted, the gateway will automatically connect to a healthy relay with the lowest latency.
Note: For Infisical Cloud users using instance relays, the relay infrastructure is already running and managed by Infisical. If using organization relays or self-hosted instance relays, you must first start a relay server. For more information on deploying relays, refer to the Relay Deployment Guide.
The name of the relay that this gateway should connect to. The relay must be running and registered before starting the gateway.If this flag is omitted, the gateway will automatically connect to a healthy relay with the lowest latency.
Note: For Infisical Cloud users using instance relays, the relay infrastructure is already running and managed by Infisical. If using organization relays or self-hosted instance relays, you must first start a relay server. For more information on deploying relays, refer to the Relay Deployment Guide.
This command is deprecated and will be removed in a future release.Please migrate to infisical gateway start for the new TCP-based SSH tunnel architecture.Migration required: If you are currently using Gateway v1 (via infisical gateway), moving to Gateway v2 is not in-place. Gateway v2 provisions new gateway instances with new gateway IDs. Update any resources that reference a gateway ID (for example: dynamic secret configs, app connections, or other gateway-bound resources) to use the new Gateway v2 gateway ID. Until you update those references, traffic will continue to target the old v1 gateway.
Run the legacy Infisical gateway in the foreground. The gateway will connect to the relay service and maintain a persistent connection.
The Infisical CLI supports multiple authentication methods. Below are the available authentication methods, with their respective flags.
Universal Auth
The Universal Auth method is a simple and secure way to authenticate with Infisical. It requires a client ID and a client secret to authenticate with Infisical.
The Native Kubernetes method is used to authenticate with Infisical when running in a Kubernetes environment. It requires a service account token to authenticate with Infisical.
This command is deprecated and will be removed in a future release.Please migrate to infisical gateway systemd install for the new TCP-based SSH tunnel architecture with enhanced security and better performance.Migration required: If you previously installed Gateway v1 via infisical gateway install, moving to Gateway v2 is not in-place. Gateway v2 provisions new gateway instances with new gateway IDs. Update any resources that reference a gateway ID (for example: dynamic secret configs, app connections, or other gateway-bound resources) to use the new Gateway v2 gateway ID. Until you update those references, traffic will continue to target the old v1 gateway.
Install and enable the legacy gateway as a systemd service. This command must be run with sudo on Linux.
If the --target-relay-name flag is omitted, the gateway automatically selects the optimal relay. It first checks for healthy organization relays and connects to the one with the lowest latency. If no organization relays are available, it then performs the same latency-based selection among the available managed relays.
When restarting the gateway without a relay flag, does it select a new relay every time?
No. The first time the gateway starts, it selects the optimal relay (based on latency) and caches that selection. On subsequent restarts, it will prioritize connecting to the cached relay. If it’s unable to connect, it will then re-evaluate and connect to the next most optimal relay available.