How to Install OpenClaw on Ubuntu
Most OpenClaw self-hosters end up on Ubuntu. Not because it is technically better than Debian or Fedora for this purpose, but because every tutorial assumes it and the Docker install path is well-tested there. If you have a VPS from Hetzner, DigitalOcean, or Contabo running Ubuntu 22.04 or 24.04, you can have OpenClaw running in about 10 minutes.
Docker method (recommended)
SSH into your server and install Docker if it is not already there:
sudo apt update && sudo apt install -y docker.io docker-compose
sudo systemctl enable docker
sudo usermod -aG docker $USER
Log out and back in so the group change takes effect. Or just reboot if you prefer. Then pull and run OpenClaw:
docker pull openclaw/openclaw:latest
docker run -d --restart unless-stopped \
--name openclaw \
-e ANTHROPIC_API_KEY=your_key_here \
-e TELEGRAM_BOT_TOKEN=your_bot_token_here \
openclaw/openclaw:latest
Check that it started cleanly:
docker logs openclaw
You should see the onboarding output and a message that the gateway is listening. If you have not set up your Telegram bot yet, the Telegram guide covers creating one through BotFather.
Direct install (without Docker)
Some people prefer running OpenClaw directly. You will need Node.js 18+:
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs
npm install -g openclaw
openclaw init
openclaw start
This works, but you lose the automatic restart and isolation that Docker provides. So if you go this route, use a process manager like pm2 to keep it running:
npm install -g pm2
pm2 start openclaw -- start
pm2 save
pm2 startup
HTTPS and Telegram webhooks
Telegram requires HTTPS for bot webhooks, which means your server needs a domain and an SSL certificate. Caddy is the easiest reverse proxy for this because it handles SSL automatically:
sudo apt install -y caddy
Edit /etc/caddy/Caddyfile:
yourdomain.com {
reverse_proxy localhost:3000
}
Restart Caddy and point your domain’s DNS to your server IP. Caddy fetches an SSL cert from Let’s Encrypt automatically. And the whole process adds maybe five minutes, assuming you already own a domain.
Sizing your server
OpenClaw does not need much local compute since the AI inference happens on Anthropic or OpenAI’s servers. A 2-core, 4GB RAM VPS handles it comfortably. I have seen people run it on 2GB machines, but the Chromium browser can spike memory usage during heavy browsing tasks, and you do not want the OOM killer shutting things down mid-task.
At Hetzner, a CX22 (2 vCPU, 4GB) costs about $5/month. DigitalOcean’s equivalent is $24/month. Contabo sits somewhere in between. But the compute cost is a small fraction of what you will spend on API keys.
If managing a VPS is not something you want to deal with, managed services handle all of this for you. OpenClaw Cloud runs each agent in an isolated container on infrastructure we maintain, and the waitlist is open.