- Start gateway
- Start gateway as background daemon (Linux only)
Description
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.Subcommands & flags
infisical gateway start
infisical gateway start
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.Once started, the gateway component will:
By default, the gateway automatically connects to the relay with the lowest latency. To target a specific relay, use the
--relay=<relay-name> flag.- Automatically connect to a healthy relay with the lowest latency (unless the
--relayflag 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
Authentication
The Gateway supports multiple authentication methods. Below are the available authentication methods, with their respective flags.Universal Auth
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.
Flags
Native Kubernetes
Native Kubernetes
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.
Flags
Native Azure
Native Azure
The Native Azure method is used to authenticate with Infisical when running in an Azure environment.
Flags
Native GCP ID Token
Native GCP ID Token
The Native GCP ID Token method is used to authenticate with Infisical when running in a GCP environment.
Flags
GCP IAM
GCP IAM
Native AWS IAM
Native AWS IAM
The AWS IAM method is used to authenticate with Infisical with an AWS IAM role while running in an AWS environment like EC2, Lambda, etc.
Flags
OIDC Auth
OIDC Auth
JWT Auth
JWT Auth
Token Auth
Token Auth
You can use the
INFISICAL_TOKEN environment variable to authenticate with Infisical with a raw machine identity access token.Flags
Other Flags
--relay
--relay
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.
--name
--name
The name of the gateway instance.
--domain
--domain
Domain of your self-hosted Infisical instance.
infisical gateway systemd install
infisical gateway systemd install
Install and enable the gateway as a systemd service. This command must be run with sudo on Linux.
Requirements
- Must be run on Linux
- Must be run with root/sudo privileges
- Requires systemd
Flags
--token
--token
The machine identity access token to authenticate with Infisical.You may also expose the token to the CLI by setting the environment variable
INFISICAL_TOKEN before executing the install command.--domain
--domain
Domain of your self-hosted Infisical instance.
--name
--name
The name of the gateway instance.
--relay
--relay
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.
Service Details
The systemd service is installed with secure defaults:- Service file:
/etc/systemd/system/infisical-gateway.service - Config file:
/etc/infisical/gateway.conf - Runs with restricted privileges:
- InaccessibleDirectories=/home
- PrivateTmp=yes
- Resource limits configured for stability
- Automatically restarts on failure
- Enabled to start on boot
- Maintains persistent SSH reverse tunnel connections to the specified relay
- Handles certificate rotation and connection recovery automatically
Legacy Gateway Commands
infisical gateway (deprecated)
infisical gateway (deprecated)
Run the legacy Infisical gateway in the foreground. The gateway will connect to the relay service and maintain a persistent connection.
Authentication
The Infisical CLI supports multiple authentication methods. Below are the available authentication methods, with their respective flags.Universal Auth
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.
Flags
Native Kubernetes
Native Kubernetes
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.
Flags
Native Azure
Native Azure
The Native Azure method is used to authenticate with Infisical when running in an Azure environment.
Flags
Native GCP ID Token
Native GCP ID Token
The Native GCP ID Token method is used to authenticate with Infisical when running in a GCP environment.
Flags
GCP IAM
GCP IAM
Native AWS IAM
Native AWS IAM
The AWS IAM method is used to authenticate with Infisical with an AWS IAM role while running in an AWS environment like EC2, Lambda, etc.
Flags
OIDC Auth
OIDC Auth
JWT Auth
JWT Auth
Token Auth
Token Auth
You can use the
INFISICAL_TOKEN environment variable to authenticate with Infisical with a raw machine identity access token.Flags
Other Flags
--domain
--domain
Domain of your self-hosted Infisical instance.
infisical gateway install (deprecated)
infisical gateway install (deprecated)
Install and enable the legacy gateway as a systemd service. This command must be run with sudo on Linux.
Requirements
- Must be run on Linux
- Must be run with root/sudo privileges
- Requires systemd
Flags
--token
--token
The machine identity access token to authenticate with Infisical.You may also expose the token to the CLI by setting the environment variable
INFISICAL_TOKEN before executing the install command.--domain
--domain
Domain of your self-hosted Infisical instance.
Service Details
The systemd service is installed with secure defaults:- Service file:
/etc/systemd/system/infisical-gateway.service - Config file:
/etc/infisical/gateway.conf - Runs with restricted privileges:
- InaccessibleDirectories=/home
- PrivateTmp=yes
- Resource limits configured for stability
- Automatically restarts on failure
- Enabled to start on boot
Frequently Asked Questions
How are relays auto-selected?
How are relays auto-selected?
If the
--relay 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?
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.