How to Set Up OpenClaw: The Complete Getting Started Guide
How to Set Up OpenClaw: The Complete Getting Started Guide
I have helped a lot of people set up OpenClaw. Some of them had it running in two minutes. Others spent an entire afternoon fighting OAuth configuration and gateway ports before sending their first message.
The difference was not skill. It was which setup path they chose.
There are three ways to get OpenClaw running: managed hosting (sign up and start talking), self-hosting on a VPS (full control, full responsibility), and local setup on your own machine (free, but your agent sleeps when your laptop does). This guide covers all three with step-by-step instructions. I run Klaus, a managed hosting service, so I am biased toward that path. But I wrote this guide to be useful regardless of which one you pick.
Which Setup Path Is Right for You?
The right OpenClaw setup path depends on how much time you want to spend on infrastructure versus how much control you need over your agent.
If you have read our managed vs self-hosted comparison, you already know which path you want. Skip to that section.
If you have not, here is the short version:
- Want it running in under 5 minutes? Managed hosting. You sign up, get a dedicated VM, and start chatting. No terminal required, no API keys to configure.
- Want full control and SSH access? Self-host on a VPS. You own everything, but you maintain everything.
- Want to try it for free on your laptop first? Local setup. Free, fast, but your agent goes offline when your machine sleeps.
| Managed | VPS Self-Hosted | Local | |
|---|---|---|---|
| Time to first message | Under 5 minutes | 30-60 minutes | 10-15 minutes |
| Monthly cost | From $19/mo | $4-50/mo + your time | Free (pay for AI tokens) |
| Uptime | 24/7 | 24/7 (if maintained) | Only when machine is on |
| Terminal required | No | Yes | Yes |
| Integrations pre-configured | Yes (on some providers) | You set up each one | You set up each one |
| Ongoing maintenance | Provider handles it | You handle it | You handle it |
For a deeper breakdown of the tradeoffs, see the full hosting comparison.
Path 1: Managed Hosting (The Fast Route)
Managed OpenClaw hosting means a provider runs and maintains your instance. You get a dedicated VM with OpenClaw already deployed, updated, and monitored. You focus on using your agent. The provider handles everything else.
On Klaus, that looks like this: you sign up at klausai.com, your instance is provisioned, and you start chatting in the Control UI. Integrations like Orthogonal (Apollo, Hunter.io, Exa), AgentMail, and OpenRouter credits come pre-configured. Starter plans begin at $19/month with a t4g.small instance (2 vCPUs, 2 GB RAM, 30 GB storage).
You do not need to install Node.js, configure a gateway, set up OAuth apps, or touch a terminal. The provider does all of that. (Though you can use the terminal if you want to, on Klaus at least!)
Other managed providers exist. We wrote an honest comparison if you want to evaluate the options.
When managed hosting makes sense: you want an AI agent for your business, not an infrastructure project. You value your time more than the monthly cost. You want integrations working out of the box rather than spending an afternoon configuring OAuth apps.
Path 2: Self-Hosting on a VPS (The Full Control Route)
Self-hosting gives you root access, full configuration control, and zero recurring fees beyond the VPS itself. It also means you handle security patches, uptime monitoring, backups, and every integration yourself.
What You Need
According to the official OpenClaw documentation, OpenClaw requires Node.js 24 (Node 22.14+ is also supported). For a VPS, you will also need:
- RAM: 2 GB is the documented minimum, but 4 GB is the realistic floor for production. At 2 GB, browser automation skills fail under load and memory pressure causes gateway restarts mid-conversation (source).
- Storage: SSD is essential for workspace logs, skill installations, and cached files.
- OS: Ubuntu 22.04 or 24.04 LTS is the most common choice.
VPS providers like Hetzner, DigitalOcean, Oracle Cloud (free tier with 4 ARM CPUs and 24 GB RAM), and Contabo all work. Pick whichever fits your budget.
Step-by-Step Setup
1. Provision your VPS and install Node.js.
SSH into your server and install Node.js 24:
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
sudo apt install nodejs -y
Verify the version:
node --version
# Should show v24.x.x or higher
2. Install OpenClaw.
Run the official installer (docs):
curl -fsSL https://openclaw.ai/install.sh | bash
3. Run the onboarding wizard.
This takes about 2 minutes. It walks you through model provider selection, API key setup, and gateway configuration:
openclaw onboard --install-daemon
4. Configure gateway access.
This is where most security mistakes happen. The official recommendation is to keep the gateway bound to loopback (localhost only) and access it remotely via SSH tunnel or Tailscale.
SSH tunnel (simplest approach):
ssh -L 18789:localhost:18789 user@your-vps-ip
This forwards port 18789 from your VPS to your local machine. Open http://localhost:18789 in your browser to access the Control UI.
Tailscale (recommended for persistent access): edit your gateway config to bind to "tailnet" and the gateway listens directly on the Tailscale interface. No SSH tunnel needed, and Tailscale Serve can authenticate traffic via identity headers (docs).
Never expose port 18789 directly to the internet. That is how 135,000+ OpenClaw instances ended up exposed to the public web.
5. Set up a systemd service for automatic restarts.
Create a service file so OpenClaw starts on boot and recovers from crashes. The VPS deployment guide recommends:
Restart=always
RestartSec=2
TimeoutStartSec=90
Use SSD-backed storage for state and cache paths to avoid I/O bottlenecks.
6. Verify everything works.
openclaw gateway status
# Should show the gateway listening on port 18789
openclaw doctor
# Checks for config/service issues
The OAuth Problem
Every integration you want to connect (Google Workspace, Slack, etc.) requires creating a separate OAuth app in that platform’s developer console. For Google, that means enabling the Gmail, Calendar, and Drive APIs in Google Cloud Console, creating an OAuth client ID, and downloading the credentials JSON (DigitalOcean walkthrough).
One gotcha that trips people up: Google’s “test mode” fails to authorize properly with OpenClaw. You must manually publish the app to Production status in the Google Auth Platform for the OAuth flow to complete.
This process takes 20-40 minutes per integration. It is the most time-consuming part of self-hosting, and it is where most people give up or make security mistakes.
What You Are Signing Up For
Self-hosting is not a one-time task. After setup, you are responsible for security patches when CVEs are disclosed, uptime monitoring, backups, log management, and API key rotation. See our managed vs self-hosted comparison for the full list of ongoing responsibilities.
Path 3: Local Setup (The Free Route)
Running OpenClaw locally is free and the fastest way to test it. The tradeoff: your agent goes offline when your machine sleeps, which makes it unsuitable for business automation that needs 24/7 messaging integrations.
Prerequisites
From the official docs:
- Node.js 24 (recommended) or Node 22.14+
- API key from a model provider (Anthropic, OpenAI, Google, etc.)
Verify your Node.js version:
node --version
# Need v22.x.x or higher
If you need to install Node.js, the fastest methods are:
# macOS (Homebrew)
brew install node
# macOS or Linux (fnm version manager)
curl -fsSL https://fnm.vercel.app/install | bash && fnm install 22
Step-by-Step Setup
1. Install OpenClaw.
# macOS / Linux
curl -fsSL https://openclaw.ai/install.sh | bash
# Windows (PowerShell)
iwr -useb https://openclaw.ai/install.ps1 | iex
2. Run the onboarding wizard.
openclaw onboard --install-daemon
The wizard takes about 2 minutes. It asks for your model provider, API key, and gateway preferences. For the model, Claude Sonnet 4.6 is a good default for general-purpose use. DeepSeek V3.2 is cheaper if you want to experiment without burning through credits.
3. Verify the gateway.
openclaw gateway status
# Should show listening on port 18789
4. Open the dashboard.
openclaw dashboard
This opens the Control UI in your browser. Send your first message.
Cost
Local hosting itself is free. You pay for AI model tokens through your own API key. Tokens can be free but typically cost as much or more than hosting. For a real breakdown of what that means in practice, see our pricing guide.
After Setup: First Steps That Actually Matter
Regardless of which path you chose, these four steps turn a fresh install into a useful agent. On Klaus, some of these are handled for you, but the concepts apply everywhere.
Bootstrap Your Agent
On first launch, OpenClaw runs a short Q&A ritual that creates workspace files in ~/.openclaw/workspace (docs). These files shape your agent’s personality and behavior:
- AGENTS.md: operating instructions and persistent memory notes
- SOUL.md: persona definition, boundaries, tone
- USER.md: your preferences and profile
- IDENTITY.md: agent name and personality
- BOOTSTRAP.md: the first-run ritual itself (deleted after completion)
Take the bootstrapping seriously. The answers you give here affect every conversation going forward. If you are running on a remote VPS, remember that these files live on the gateway machine, not your local computer.
Connect a Messaging Channel
Telegram is the fastest channel to set up and the most stable for daily use. Create a bot through Telegram’s @BotFather, copy the token, and run:
openclaw channels add --channel telegram --token "YOUR_TOKEN"
Other channels (WhatsApp, Discord, Slack) require more configuration.
Install Your First Skills
Skills add capabilities to your agent. Install them from ClawHub:
clawhub install <skill-slug>
For curated recommendations on which skills are worth installing (and which to skip), see our skills guide.
One important note: after the ClawHavoc incident, where over 1,100 malicious skills were discovered on ClawHub, vet skills before installing. Check download counts, author reputation, and pin versions with clawhub install <slug>@1.2.0.
Run Diagnostics
Three commands to check that everything is working (docs):
openclaw doctor # Config and service health
openclaw channels status --probe # Channel connectivity
openclaw logs --follow # Real-time activity
Common Setup Problems (and How to Fix Them)
“command not found” after install. Your PATH was not updated. Restart your terminal or run source ~/.bashrc (or source ~/.zshrc on macOS).
Gateway won’t start. Port 18789 is already in use. Check with lsof -i :18789 and kill the conflicting process, or change the gateway port in your openclaw.json config.
Models list is empty. Your API key was not set or you selected the wrong provider during onboarding. Re-run openclaw onboard or edit openclaw.json directly.
Google OAuth fails silently. You left the app in test mode. Go to Google Auth Platform in Google Cloud Console and publish the app to Production. Test mode does not authorize properly with OpenClaw.
Gateway crashes under load. Browser automation skills can spike memory to 8-14 GB during active sessions. On a 2 GB VPS, this will crash the gateway. Upgrade to 4 GB or disable browser automation skills.
For more, see the official troubleshooting guide.
Frequently Asked Questions
How long does it take to set up OpenClaw?
Managed hosting takes under 5 minutes. Local setup takes 10-15 minutes if you have Node.js and an API key ready. VPS self-hosting takes 2-10 hours including gateway configuration and integration setup.
Do I need to know how to code?
Managed hosting requires zero coding. Running locally requires basic terminal comfort with SSH, systemd, and package managers. If you’re using a minimal hosting service like Digital Ocean, you should know how to code.
What is the cheapest way to run OpenClaw?
Local setup is free (you pay only for AI model tokens via your own API key). Oracle Cloud’s free tier provides a VPS with 4 ARM CPUs and 24 GB RAM at no cost. Managed hosting starts at $19/month on Klaus.
Can I switch from self-hosted to managed later?
Yes. Your agent’s workspace can be uploaded to a git repo and then downloaded again to another machine. This can be somewhat tricky to do securely. If you want to do this email us at support@usebits.com. We’re happy to help.
What AI models does OpenClaw support?
Any model available through your provider. Claude, GPT, DeepSeek, Gemini, Llama, and others via OpenRouter. You configure your model choice during the onboarding wizard.
Is OpenClaw safe to run on a public server?
Only if you keep the gateway on loopback and access it via SSH tunnel or Tailscale. Never expose the gateway port (18789) directly to the internet.
Key Takeaways
- Three paths to a working AI agent: managed hosting is the fastest (under 5 minutes), VPS self-hosting gives full control (30-60 minutes), and local setup is free (10-15 minutes).
- The initial install is not the hard part. OAuth app creation, gateway security, and ongoing maintenance are where self-hosting gets expensive in time.
- Keep the gateway on loopback. Access via SSH tunnel or Tailscale. This is the official recommendation and the most common mistake people skip.
- Start with Telegram as your first messaging channel. It is the fastest to set up and the most stable.
- Run
openclaw doctorafter setup to catch configuration problems early. - Bootstrap your agent thoughtfully. The workspace files you create during first launch shape every conversation.
Want to skip the setup entirely? Sign up at klausai.com and start talking to your agent.
If you prefer self-hosting, our managed vs self-hosted comparison covers the full tradeoff in detail.
Sources
- OpenClaw Official Docs: Getting Started. Prerequisites, installation commands, onboarding wizard.
- OpenClaw Official Docs: Linux Server Deployment. VPS setup, systemd configuration, gateway architecture.
- OpenClaw Official Docs: Remote Access. SSH tunnel and Tailscale configuration for gateway access.
- OpenClaw Official Docs: Bootstrapping. Workspace files and first-run ritual.
- OpenClaw Official Docs: ClawHub. Skill discovery and installation.
- OpenClaw Official Docs: Troubleshooting. Diagnostic commands and common issues.
- OpenClaw GitHub Repository. 330,000+ stars, 500+ contributors, 2 million weekly downloads.
- DigitalOcean: How to Connect Google to OpenClaw. Google OAuth setup walkthrough.
- Klaus: OpenClaw Hosting, Managed vs Self-Hosted. RAM recommendations, self-hosting responsibilities, exposure statistics.
- Klaus: Best OpenClaw Skills for Business. Curated skill recommendations and ClawHavoc incident details.
- Klaus Pricing. Managed hosting plans starting at $19/month. Accessed March 2026.