Skip to main content

Connect to Your Instance

After installing the CLI, you need to point it at your hosted OpenClaw instance. You will need two pieces of information from your dashboard: the Gateway URL and the Gateway Token.

Find Your Credentials​

  1. Go to your OpenClaw Dashboard.
  2. Navigate to Instance.
  3. Look for the Gateway URL and Gateway Token fields.

The Gateway URL looks like wss://your-id.app.openclawhost.co and the token is a long string used for authentication.

Set Environment Variables​

The CLI reads your connection details from environment variables. Set them in your terminal:

export OPENCLAW_GATEWAY_URL="wss://your-id.app.openclawhost.co"
export OPENCLAW_GATEWAY_TOKEN="your-gateway-token-here"

Persist Across Sessions​

To avoid setting these variables every time you open a new terminal, add them to your shell profile:

For bash (~/.bashrc or ~/.bash_profile):

echo 'export OPENCLAW_GATEWAY_URL="wss://your-id.app.openclawhost.co"' >> ~/.bashrc
echo 'export OPENCLAW_GATEWAY_TOKEN="your-gateway-token-here"' >> ~/.bashrc
source ~/.bashrc

For zsh (~/.zshrc):

echo 'export OPENCLAW_GATEWAY_URL="wss://your-id.app.openclawhost.co"' >> ~/.zshrc
echo 'export OPENCLAW_GATEWAY_TOKEN="your-gateway-token-here"' >> ~/.zshrc
source ~/.zshrc

Test the Connection​

Verify the CLI can reach your instance:

openclaw status

You should see output showing your instance status, connected channels, and agent state. If you see a connection error, double-check that your Gateway URL and Token are correct.

tip

Use openclaw status --deep for a more detailed probe that checks each subsystem individually.