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.
<Tabs>
<Tab title="Linux Server (Production)">
For production deployments on Linux, install as a systemd service:
```bash
sudo infisical gateway systemd install <gateway-name> \
--enroll-method=token \
--token=<enrollment-token> \
--domain=<your-infisical-domain>
sudo systemctl start infisical-gateway
```
<Warning>
The systemd install command requires a Linux operating system with root/sudo
privileges.
</Warning>
</Tab>
<Tab title="Development & Testing">
For development or testing, run directly in the foreground:
```bash
infisical gateway start my-gateway \
--enroll-method=token \
--token=<enrollment-token> \
--domain=<your-infisical-domain>
```
</Tab>
</Tabs>
<Info>
The enrollment token can only be used once and expires after 1 hour. If it expires, use the **Re-enroll** option in the gateway's context menu to generate a new one.
</Info>
<Info>
You can safely re-run the same command to restart the gateway. It will detect the token has already been used and skip enrollment automatically.
</Info>
To move a gateway to a different machine or regenerate its credentials:
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
sudo journalctl -u infisical-gateway -f
/etc/infisical/gateways/<name>.conf~/.infisical/gateways/<name>.confThis allows multiple gateways to run on the same machine without conflicting. For systemd-based installations, the configuration is at /etc/infisical/gateway.conf. All config files are created with restricted permissions (0600) so only the owner can read them.
</Accordion>
No manual intervention is typically required during network interruptions.
</Accordion> </AccordionGroup>