This guide walks through installing OpenClaw on a VPS and getting the gateway running. Once set up, you can connect messaging channels like Telegram and interact with your agent from anywhere.
1. Prerequisites
- A VPS running Ubuntu 20.04+ or Debian 10+
- Node.js 24 (recommended) or Node 22.16+ LTS
- An API key from your preferred AI provider (Anthropic, OpenAI, etc.)
OpenClaw is lightweight. A 1 vCPU / 1 GB RAM server works for a basic setup. For a list of recommended providers, see the Server Providers guide.
2. Install Node.js
# Install Node.js 24 via nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
nvm install 24
nvm use 24
node --version 3. Install OpenClaw
npm i -g openclawyarn global add openclawpnpm add -g openclawbun add -g openclawdeno add npm:-g openclawVerify the installation:
openclaw --version 4. Run the onboarding wizard
The onboarding wizard configures your API keys, gateway auth, and messaging channels in one go:
openclaw onboard --install-daemon The wizard will ask for:
- Your AI provider and API key
- A gateway auth token (auto-generated if you skip)
- Which messaging channels to connect (you can skip these and add them later)
Using --install-daemon registers OpenClaw as a system service so the gateway starts automatically on reboot.
5. Start the gateway
If you skipped daemon install, start the gateway manually:
openclaw gateway start Check status:
openclaw gateway status The dashboard runs at http://127.0.0.1:18789/. Access it via SSH tunnel if you’re on a remote server:
# On your local machine
ssh -L 18789:127.0.0.1:18789 user@your-vps-ip Then open http://127.0.0.1:18789/ in your browser.
6. Configure AI provider
If you want to change or add a provider after onboarding, edit ~/.openclaw/openclaw.json:
{
"agents": {
"main": {
"model": {
"provider": "anthropic",
"id": "claude-sonnet-4-5-20251001"
}
}
}
} Set your API key as an environment variable or add it to the config:
export ANTHROPIC_API_KEY=sk-ant-... Restart the gateway after any config change:
openclaw gateway restart 7. Key directories
| Path | Purpose |
|---|---|
~/.openclaw/openclaw.json | Main config file |
~/.openclaw/agents/ | Agent sessions and state |
~/.openclaw/plugins/ | Custom plugins |
~/.openclaw/skills/ | Custom skills |
Next steps
- Connect Telegram to chat with your agent from your phone
- Custom Plugins to extend the agent with your own tools