Deploy and Manage Gateways
The gateway is the control plane for OpenShell. All control-plane traffic between the CLI and running sandboxes flows through the gateway.
The gateway is responsible for:
- Provisioning and managing sandboxes, including creation, deletion, and status monitoring.
- Storing provider credentials (API keys, tokens) and delivering them to sandboxes at startup.
- Delivering network and filesystem policies to sandboxes. Policy enforcement itself happens inside each sandbox through the proxy, OPA, Landlock, and seccomp.
- Managing inference configuration and serving inference bundles so sandboxes can route requests to the correct backend.
- Providing the SSH tunnel endpoint so you can connect to sandboxes without exposing them directly.
The gateway runs inside a Docker container and exposes a single port (gRPC and HTTP multiplexed), secured by mTLS by default. No separate Kubernetes installation is required. It can be deployed locally, on a remote host via SSH, or behind a cloud reverse proxy.
Deploy a Local Gateway
Deploy a gateway on your workstation. The only prerequisite is a running Docker daemon.
The gateway becomes reachable at https://127.0.0.1:8080. Verify it is healthy:
You do not need to deploy a gateway manually. If you run openshell sandbox create without a gateway, the CLI auto-bootstraps a local gateway for you.
To use a different port or name:
Deploy a Remote Gateway
Deploy a gateway on a remote machine accessible via SSH. The only dependency on the remote host is Docker.
The gateway is reachable at https://<hostname>:8080.
To specify an SSH key:
For DGX Spark, use your Sparkโs mDNS hostname:
Register an Existing Gateway
Use openshell gateway add to register a gateway that is already running.
Cloud Gateway
Register a gateway behind a reverse proxy such as Cloudflare Access:
This opens your browser for the proxyโs login flow. After authentication, the CLI stores a bearer token and sets the gateway as active.
To give the gateway a specific name instead of deriving it from the hostname, use --name:
If the token expires later, re-authenticate with:
Remote Gateway
Register a gateway on a remote host you have SSH access to:
Or use the ssh:// scheme to combine the SSH destination and gateway port:
Local Gateway
Register a gateway running locally that was started outside the CLI:
Manage Multiple Gateways
One gateway is always the active gateway. All CLI commands target it by default. Both gateway start and gateway add automatically set the new gateway as active.
List all registered gateways:
Switch the active gateway:
Override the active gateway for a single command with -g:
Show deployment details for a gateway, including endpoint, auth mode, and port:
Advanced Start Options
Stop and Destroy
Stop a gateway while preserving its state for later restart:
Permanently destroy a gateway and all its state:
For cloud gateways, gateway destroy removes only the local registration. It does not affect the remote deployment.
Target a specific gateway with --name:
Troubleshoot
Check gateway health:
View gateway logs:
Run a command inside the gateway container for deeper inspection:
If the gateway is in a bad state, recreate it:
Next Steps
- To create a sandbox using the gateway, refer to Manage Sandboxes.
- To install the CLI and get started quickly, refer to the Quickstart.