Host OpenClaw Gateway on Upstash Box with SSH Tunnel
Learn how to run a persistent OpenClaw Gateway on Upstash Box using keep-alive lifecycle and SSH tunnel for secure dashboard access. Ideal for developers needing managed Linux hosting.
Read this when
- Deploying OpenClaw to Upstash Box
- You want a managed Linux environment for OpenClaw with SSH-tunneled dashboard access
Run a persistent OpenClaw Gateway on Upstash Box, a managed Linux environment that supports keep-alive lifecycle behavior.
Use an SSH tunnel to reach the dashboard. Do not expose the Gateway port directly to the public internet.
Prerequisites
- An Upstash account
- A keep-alive Upstash Box
- An SSH client installed on your local machine
Create a Box
In the Upstash Console, create a keep-alive Box. Make a note of the Box ID (for example right-flamingo-14486) and your Box API key.
Upstash keeps a current walkthrough for OpenClaw Box at OpenClaw Setup.
Connect with an SSH tunnel
Forward the OpenClaw dashboard port to your local machine. When prompted, use your Box API key as the SSH password:
ssh -o ServerAliveInterval=15 -o ServerAliveCountMax=3 -L 18789:127.0.0.1:18789 <box-id>@us-east-1.box.upstash.com
The keepalive options help reduce idle tunnel drops during initial setup.
Install OpenClaw
Inside the Box:
sudo npm install -g openclaw
Run onboarding
openclaw onboard --install-daemon
Follow the prompts. When onboarding finishes, copy the dashboard URL and token.
Start the Gateway
Configure the Gateway for the Box network and start it in the background:
openclaw config set gateway.bind lan
nohup openclaw gateway > gateway.log 2>&1 &
With the SSH tunnel active, open the dashboard URL on your local machine:
http://127.0.0.1:18789/#token=<your-token>
Auto-restart
Set this command as the Box init script so the Gateway restarts whenever the Box starts:
nohup openclaw gateway > gateway.log 2>&1 &
Troubleshooting
If SSH freezes during onboarding, reconnect with a clean SSH configuration and keepalives:
ssh -F /dev/null -o ControlMaster=no -o ServerAliveInterval=15 -o ServerAliveCountMax=3 -L 18789:127.0.0.1:18789 <box-id>@us-east-1.box.upstash.com
This avoids stale local ~/.ssh/config settings and keeps the tunnel active during idle network periods.