docs/documentation/platform/gateways/gateway-deployment.mdx
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.
| Protocol | Destination | Port | Purpose |
| -------- | ------------------------------------ | ---- | ------------------------------------------ |
| TCP | Relay Server IP/Hostname | 2222 | SSH reverse tunnel establishment |
| TCP | Infisical instance host (US/EU, other) | 443 | API communication and certificate requests |
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.
<AccordionGroup>
<Accordion title="Token Auth">
A one-time enrollment token (1h expiry) bootstraps the gateway.
<Tabs>
<Tab title="Linux (Production)">
```bash
sudo infisical gateway systemd install <gateway-name> \
--enroll-method=token \
--token=<enrollment-token> \
--domain=<your-infisical-domain>
sudo systemctl start infisical-gateway
```
</Tab>
<Tab title="Foreground">
```bash
infisical gateway start <gateway-name> \
--enroll-method=token \
--token=<enrollment-token> \
--domain=<your-infisical-domain>
```
</Tab>
</Tabs>
</Accordion>
<Accordion title="AWS Auth">
The host must have AWS credentials whose principal matches your allowlist. The gateway re-authenticates via STS on every start.
<Tabs>
<Tab title="Linux (Production)">
```bash
sudo infisical gateway systemd install <gateway-name> \
--enroll-method=aws \
--gateway-id=<gateway-id> \
--domain=<your-infisical-domain>
sudo systemctl start infisical-gateway
```
</Tab>
<Tab title="Foreground">
```bash
infisical gateway start <gateway-name> \
--enroll-method=aws \
--gateway-id=<gateway-id> \
--domain=<your-infisical-domain>
```
</Tab>
</Tabs>
</Accordion>
</AccordionGroup>
<Warning>
The systemd install command requires Linux with root/sudo privileges.
</Warning>
<Info>
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.
</Info>
<Info>
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.
</Info>
From the gateway's detail page (click the gateway row in the list):
revoke-gateway-access permission, separate from edit-gateways.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.
This design maintains security by avoiding the need for inbound firewall rules that could expose your network to external threats.
</Accordion> <Accordion title="How do I test network connectivity from the gateway?"> Test relay connectivity and outbound API access from the gateway:nc -zv <relay-ip> 2222
curl -I https://app.infisical.com
nc -zv <relay-ip> 2222
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. </Accordion>
<Accordion title="Where can I find gateway logs?"> Check gateway logs for detailed error information:sudo journalctl -u infisical-gateway -f
/etc/infisical/gateways/<name>.conf~/.infisical/gateways/<name>.confFor AWS-method gateways, no JWT is persisted to disk. The gateway re-authenticates by signing a fresh STS request on every start using the host's AWS credentials. Only the gateway id and domain are stored locally.
For systemd-based installations, the configuration is at /etc/infisical/gateway.conf. All config files are created with restricted permissions (0600).
</Accordion>
No manual intervention is typically required during network interruptions.
</Accordion> </AccordionGroup>