Quick Summary
OpenClaw is the fastest-growing self-hosted AI assistant in history, crossing 215,000 GitHub stars within months of its public release. In this guide, you will install OpenClaw on Ubuntu 24.04, connect it to multiple LLM providers (Claude, ChatGPT, and local models via Ollama), set up Telegram integration, and configure the deployment for production use with Nginx, SSL, and automatic backups.
The entire process takes about 20 minutes on a fresh VPS.
Want to skip the setup? VPS-Server.host offers one-click OpenClaw deployments on our CloudCore Professional plan. Get started here and have your personal AI assistant running in under 60 seconds.
Table of Contents
What is OpenClaw?
OpenClaw is an open-source, self-hosted AI assistant that connects to multiple large language model (LLM) providers and exposes them through a unified web interface, API, and messaging integrations. It launched in early 2026 and reached 215,000 GitHub stars faster than any developer tool in the platform's history, surpassing previous records set by projects like Ollama and Open WebUI.
At its core, OpenClaw is a Docker-based platform that acts as a single control plane for all of your AI interactions. Instead of paying for separate subscriptions to ChatGPT, Claude, and other services, you bring your own API keys and interact with every model through one interface. But OpenClaw goes well beyond simple chat.
What OpenClaw can do:
- Multi-LLM conversations. Switch between Claude (Anthropic), GPT-4o (OpenAI), Gemini (Google), Mistral, and local models mid-conversation. Compare responses side-by-side.
- Task automation. Define recurring tasks -- daily briefings, email summaries, data checks -- and OpenClaw executes them on schedule using whichever model you assign.
- Web browsing. OpenClaw includes a built-in headless browser. Ask it to research a topic, scrape a page, monitor a competitor's pricing, or summarize a long article -- it navigates the web on your behalf.
- File management. Upload documents, images, and datasets. OpenClaw processes them, extracts information, converts formats, and stores results in your personal knowledge base.
- Code execution. OpenClaw runs Python and JavaScript in a sandboxed environment. Ask it to analyze data, generate charts, write scripts, or debug code, and it executes the result in real time.
- Messaging integrations. Connect Telegram, Slack, Discord, or email. Send a message to your Telegram bot and get an AI response instantly, from any device.
- Plugin ecosystem. Extend OpenClaw with community plugins for calendar management, home automation, financial tracking, and hundreds of other use cases.
Compared to alternatives like Open WebUI (which focuses on Ollama integration) or LibreChat (which focuses on API proxy), OpenClaw distinguishes itself with its task automation engine, plugin system, and first-class mobile experience through messaging apps.
Why Self-Host OpenClaw?
Running OpenClaw on your own VPS provides advantages that no hosted AI service can match:
Complete privacy. Every conversation, uploaded file, and generated response stays on your server. Nothing is sent to third parties beyond the LLM API calls themselves (which you control). For businesses handling sensitive data, this is not optional -- it is a requirement.
Bring your own API keys. You pay only for the tokens you actually use. No monthly subscription, no per-seat pricing, no surprise charges. A typical user running Claude 3.5 Sonnet through their own API key spends $3-8 per month instead of $20 for a Pro subscription.
Customizable behavior. Configure system prompts, model defaults, temperature settings, and response formatting exactly how you want. Create specialized assistants for different workflows -- one for coding, one for writing, one for research -- each with its own personality and tool access.
Integration with your infrastructure. Connect OpenClaw to your existing tools: Telegram for mobile access, Slack for team channels, email for async workflows, webhooks for automation pipelines. On a VPS, you can also mount local directories, access databases, and connect to internal services.
No rate limits. Hosted AI services throttle heavy users. With your own API keys and self-hosted interface, your only limit is the rate limit on your API tier, which you control.
Full data ownership. Export your conversation history, knowledge base, and configuration at any time. Migrate between providers without losing anything. Your data is stored in a PostgreSQL database that you own and can back up however you choose.
Prerequisites
Before you begin, make sure you have the following:
| Requirement | Details |
|---|---|
| VPS | Ubuntu 24.04 LTS with at least 4 vCPU, 8 GB RAM, and 50 GB storage. We recommend our CloudCore Professional plan (6 vCPU, 12 GB RAM, 100 GB NVMe) for the best experience, especially if you plan to run local models with Ollama. |
| SSH access | Root or sudo access to your server. |
| Docker & Docker Compose | Covered in Step 1 below. |
| Domain name | Optional but recommended for production. Required if you want SSL. |
| LLM API key | At least one of: Anthropic API key, OpenAI API key, or a local Ollama installation (free, covered in Step 9). |
Not sure which VPS plan to pick? OpenClaw itself runs comfortably on 4 GB RAM. If you also want to run Ollama with a 7B-parameter model locally, aim for 12 GB RAM. Our CloudCore Professional plan at $18.99/month covers both with room to spare. View plans.
Step 1: Install Docker and Docker Compose
Connect to your VPS via SSH:
ssh root@your-server-ipUpdate the system packages:
apt update && apt upgrade -yInstall Docker using the official convenience script:
curl -fsSL https://get.docker.com | shAdd your user to the docker group so you can run Docker commands without sudo:
usermod -aG docker $USERLog out and log back in for the group change to take effect, or run:
newgrp dockerVerify Docker is installed and running:
docker --versionExpected output:
Docker version 27.x.x, build xxxxxxxDocker Compose is included with modern Docker installations. Verify:
docker compose versionExpected output:
Docker Compose version v2.x.xIf docker compose is not available, install the plugin manually:
apt install docker-compose-plugin -yStep 2: Clone the OpenClaw Repository
Install Git if it is not already present:
apt install git -yClone the OpenClaw repository:
git clone https://github.com/openclaw-ai/openclaw.git /opt/openclawChange into the project directory:
cd /opt/openclawCheck out the latest stable release:
git checkout $(git describe --tags --abbrev=0)This ensures you are running a tagged release rather than the latest commit on main, which may contain experimental changes.
Step 3: Configure Environment Variables
Copy the example environment file:
cp .env.example .envOpen the file in your preferred editor:
nano .envHere is a breakdown of the key variables you need to configure:
# ============================================
OpenClaw Configuration
============================================
--- Security ---
Generate a random secret key for session encryption.
Run: openssl rand -hex 32
SECRET_KEY=your_generated_secret_key_hereAdmin credentials for the first user account.
[email protected]
ADMIN_PASSWORD=a_strong_password_here--- LLM Providers ---
Add API keys for the providers you want to use.
You need at least one, but can add all of them.
Anthropic (Claude)
ANTHROPIC_API_KEY=sk-ant-api03-xxxxxxxxxxxxxxxxxxxxOpenAI (GPT-4o, GPT-4, GPT-3.5)
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxGoogle (Gemini)
GOOGLE_AI_API_KEY=AIzaxxxxxxxxxxxxxxxxxxxxxxxxxLocal models via Ollama (configured in Step 9)
OLLAMA_URL=http://host.docker.internal:11434--- Database ---
Default PostgreSQL credentials. Change the password.
POSTGRES_USER=openclaw
POSTGRES_PASSWORD=change_this_to_a_strong_password
POSTGRES_DB=openclawInternal database URL (used by the application container).
DATABASE_URL=postgresql://openclaw:change_this_to_a_strong_password@db:5432/openclaw--- Redis ---
REDIS_URL=redis://redis:6379/0--- Application ---
The URL where OpenClaw will be accessible.
For initial setup, use your VPS IP. Change to your domain later.
APP_URL=http://your-server-ip:3000Port the web interface listens on.
PORT=3000--- Telegram (Optional, configured in Step 7) ---
TELEGRAM_BOT_TOKEN=
TELEGRAM_WEBHOOK_URL=--- File Storage ---
Maximum upload size in megabytes.
MAX_UPLOAD_SIZE=50--- Logging ---
LOG_LEVEL=infoSave the file (Ctrl+O, Enter, Ctrl+X in nano).
Important notes on the configuration:
SECRET_KEY: Generate this withopenssl rand -hex 32. Never reuse a secret key across installations.ADMIN_PASSWORD: Use a strong password with at least 16 characters. You will change this through the web interface later if you want.POSTGRES_PASSWORD: Must match in bothPOSTGRES_PASSWORDand theDATABASE_URLconnection string.OLLAMA_URL: Thehost.docker.internalhostname lets the Docker container reach services running on the host machine. If Ollama is not installed yet, leave this as-is -- it will simply be unused until you set it up in Step 9.
Step 4: Launch with Docker Compose
From the /opt/openclaw directory, start all services:
docker compose up -dThis pulls the required images and starts four containers:
| Container | Purpose | Default Port |
|---|---|---|
openclaw-web | The main web application and API server | 3000 |
openclaw-worker | Background task runner for scheduled jobs, web browsing, and code execution | - |
openclaw-db | PostgreSQL 16 database for conversations, users, and configuration | 5432 (internal) |
openclaw-redis | Redis for session management, caching, and task queues | 6379 (internal) |
docker-compose.yml that ships with OpenClaw:services: web: image: ghcr.io/openclaw-ai/openclaw:latest container_name: openclaw-web restart: unless-stopped ports: - "${PORT:-3000}:3000" env_file: - .env depends_on: db: condition: service_healthy redis: condition: service_started volumes: - openclaw-uploads:/app/uploads - openclaw-plugins:/app/plugins extra_hosts: - "host.docker.internal:host-gateway"worker: image: ghcr.io/openclaw-ai/openclaw:latest container_name: openclaw-worker restart: unless-stopped command: ["node", "dist/worker.js"] env_file: - .env depends_on: db: condition: service_healthy redis: condition: service_started volumes: - openclaw-uploads:/app/uploads - openclaw-plugins:/app/plugins extra_hosts: - "host.docker.internal:host-gateway"
db: image: postgres:16-alpine container_name: openclaw-db restart: unless-stopped environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} volumes: - openclaw-pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"] interval: 5s timeout: 5s retries: 5
redis: image: redis:7-alpine container_name: openclaw-redis restart: unless-stopped volumes: - openclaw-redis-data:/data
volumes: openclaw-pgdata: openclaw-redis-data: openclaw-uploads: openclaw-plugins:
Check that all containers are running:
docker compose psExpected output:
NAME IMAGE STATUS PORTS
openclaw-web ghcr.io/openclaw-ai/openclaw:latest Up 30 seconds 0.0.0.0:3000->3000/tcp
openclaw-worker ghcr.io/openclaw-ai/openclaw:latest Up 30 seconds
openclaw-db postgres:16-alpine Up 30 seconds 5432/tcp
openclaw-redis redis:7-alpine Up 30 seconds 6379/tcpWatch the logs for any startup errors:
docker compose logs -f webYou should see a message like:
[INFO] OpenClaw server started on port 3000
[INFO] Database migrations applied successfully
[INFO] Ready to accept connectionsPress Ctrl+C to stop following the logs.
Step 5: Access the Web Interface
Open your browser and navigate to:
http://your-server-ip:3000You will see the OpenClaw login screen. Sign in with the credentials you set in the .env file:
- Email: The value of
ADMIN_EMAIL - Password: The value of
ADMIN_PASSWORD
Complete the wizard or skip it -- you can configure everything later from the Settings panel.
The main interface is organized into:
- Chat. The primary conversation view. Start new threads, switch models, upload files.
- Tasks. Schedule and monitor recurring AI tasks.
- Knowledge. Upload documents to build a searchable knowledge base that grounds your AI conversations.
- Tools. Browse and enable built-in tools (web search, code execution, image generation) and community plugins.
- Settings. Manage API keys, users, integrations, and system configuration.
Step 6: Connect LLM Providers
If you already set API keys in the .env file, your providers should appear automatically in Settings > Providers. You can also add or update keys through the web interface.
Anthropic (Claude)
OpenAI (GPT-4o)
Local Models via Ollama
If you want to use completely free, locally-running models, see Step 9 below.
Testing Your Providers
Verify each provider works by opening a new chat, selecting the model from the dropdown, and sending a simple prompt:
What model are you, and what is today's date?Each provider should respond with its identity. This confirms the API key, network connectivity, and model routing are all working.
You can also test from the command line:
curl -s http://localhost:3000/api/v1/chat/completions \
-H "Authorization: Bearer $(cat /opt/openclaw/.env | grep SECRET_KEY | cut -d= -f2)" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-20250514",
"messages": [{"role": "user", "content": "Hello, what model are you?"}]
}' | jq .choices[0].message.contentStep 7: Set Up Telegram Integration
The Telegram integration is what made OpenClaw go viral. It turns your self-hosted AI into a personal assistant you can message from your phone, anywhere.
Create a Telegram Bot
/newbot.my_openclaw_bot). It must end in bot.7123456789:AAH0xjk9fZ3Kq2Pm.... Copy it.Configure OpenClaw
Edit the environment file:
nano /opt/openclaw/.envSet the Telegram variables:
TELEGRAM_BOT_TOKEN=7123456789:AAH0xjk9fZ3Kq2Pm_your_full_token_here
TELEGRAM_WEBHOOK_URL=https://yourdomain.com/api/v1/telegram/webhookNote: The webhook URL must be HTTPS. If you have not set up SSL yet (covered in Step 8), you can use Telegram's polling mode instead by adding:
TELEGRAM_MODE=pollingRestart the services to pick up the new configuration:
cd /opt/openclaw && docker compose restartTest the Bot
Open Telegram and send a message to your bot:
Hello, are you there?The bot should respond within a few seconds using your default LLM provider. You can switch models by sending:
/model claude-sonnetOther useful Telegram commands:
| Command | Description |
|---|---|
/model <name> | Switch the active LLM model |
/reset | Clear conversation history |
/task <description> | Create a new scheduled task |
/status | Show system status and active model |
/help | List all available commands |
Step 8: Configure for Production
Running on port 3000 over HTTP is fine for testing. For production, you need a reverse proxy with SSL, automatic restarts, and database backups.
Set Up Nginx Reverse Proxy with SSL
Install Nginx and Certbot:
apt install nginx certbot python3-certbot-nginx -yCreate the Nginx configuration file:
nano /etc/nginx/sites-available/openclawPaste the following configuration, replacing openclaw.yourdomain.com with your actual domain:
# Redirect HTTP to HTTPS server { listen 80; listen [::]:80; server_name openclaw.yourdomain.com;location /.well-known/acme-challenge/ { root /var/www/html; }
location / { return 301 https://$host$request_uri; } }
Main HTTPS server block
server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name openclaw.yourdomain.com;# SSL certificates (managed by Certbot) ssl_certificate /etc/letsencrypt/live/openclaw.yourdomain.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/openclaw.yourdomain.com/privkey.pem;
# SSL hardening ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384; ssl_prefer_server_ciphers off; ssl_session_cache shared:SSL:10m; ssl_session_timeout 1d; ssl_session_tickets off;
# HSTS add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
# Security headers add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Content-Type-Options "nosniff" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# Max upload size (match OpenClaw's MAX_UPLOAD_SIZE) client_max_body_size 50M;
# Proxy to OpenClaw location / { proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme;
# Timeouts for long-running LLM requests proxy_read_timeout 300s; proxy_send_timeout 300s; proxy_connect_timeout 60s;
# Buffering settings for streaming responses proxy_buffering off; proxy_cache off; }
# Health check endpoint location /api/v1/health { proxy_pass http://127.0.0.1:3000; proxy_set_header Host $host; access_log off; } }
Enable the site and disable the default:
ln -s /etc/nginx/sites-available/openclaw /etc/nginx/sites-enabled/
rm -f /etc/nginx/sites-enabled/defaultTest the Nginx configuration:
nginx -tObtain an SSL certificate:
certbot --nginx -d openclaw.yourdomain.com --non-interactive --agree-tos -m [email protected]Restart Nginx:
systemctl restart nginxUpdate the APP_URL in your .env file:
sed -i 's|APP_URL=.*|APP_URL=https://openclaw.yourdomain.com|' /opt/openclaw/.envAlso update the Telegram webhook URL if applicable:
sed -i 's|TELEGRAM_WEBHOOK_URL=.*|TELEGRAM_WEBHOOK_URL=https://openclaw.yourdomain.com/api/v1/telegram/webhook|' /opt/openclaw/.env
sed -i '/TELEGRAM_MODE=polling/d' /opt/openclaw/.envRestart OpenClaw to apply the changes:
cd /opt/openclaw && docker compose restartSet Up Automatic Restarts with systemd
Docker's restart: unless-stopped policy handles container crashes, but to ensure the entire stack starts on server boot, create a systemd service:
nano /etc/systemd/system/openclaw.service[Unit] Description=OpenClaw AI Assistant Requires=docker.service After=docker.service[Service] Type=oneshot RemainAfterExit=yes WorkingDirectory=/opt/openclaw ExecStart=/usr/bin/docker compose up -d ExecStop=/usr/bin/docker compose down TimeoutStartSec=120
[Install] WantedBy=multi-user.target
Enable and start the service:
systemctl daemon-reload
systemctl enable openclaw.serviceConfigure Database Backups
Create a backup script:
nano /opt/openclaw/backup.sh#!/bin/bashOpenClaw database backup script
Keeps 7 daily backups
BACKUP_DIR="/opt/openclaw/backups" TIMESTAMP=$(date +%Y%m%d_%H%M%S) BACKUP_FILE="${BACKUP_DIR}/openclaw_${TIMESTAMP}.sql.gz"
mkdir -p "$BACKUP_DIR"
Dump the database and compress it
docker exec openclaw-db pg_dump -U openclaw openclaw | gzip > "$BACKUP_FILE"if [ $? -eq 0 ]; then echo "[$(date)] Backup created: $BACKUP_FILE" else echo "[$(date)] ERROR: Backup failed!" >&2 exit 1 fi
Remove backups older than 7 days
find "$BACKUP_DIR" -name "openclaw_*.sql.gz" -mtime +7 -delete
echo "[$(date)] Cleanup complete. Current backups:" ls -lh "$BACKUP_DIR"
Make it executable and set up a daily cron job:
chmod +x /opt/openclaw/backup.shcrontab -eAdd the following line to run backups daily at 3:00 AM:
0 3 * /opt/openclaw/backup.sh >> /var/log/openclaw-backup.log 2>&1Run the backup script once to verify:
/opt/openclaw/backup.shYou should see output confirming the backup was created in /opt/openclaw/backups/.
Step 9: Connect to Local Ollama (No API Keys Needed)
Ollama lets you run large language models locally on your VPS. Combined with OpenClaw, you get a fully self-contained AI assistant with zero ongoing API costs. This is ideal for privacy-sensitive deployments or for experimenting with open-weight models.
Install Ollama
curl -fsSL https://ollama.com/install.sh | shVerify the installation:
ollama --versionPull a Model
For a good balance of quality and resource usage, start with Llama 3.1 8B:
ollama pull llama3.1:8bThis downloads approximately 4.7 GB. On a VPS with 12 GB RAM, this model runs comfortably and leaves headroom for OpenClaw's services.
For a smaller, faster option:
ollama pull phi3:miniFor the most capable open model that fits in 12 GB RAM:
ollama pull llama3.1:8b-instruct-q8_0Verify Ollama is Running
curl http://localhost:11434/api/tags | jq .models[].nameExpected output:
"llama3.1:8b"Connect OpenClaw to Ollama
If you set OLLAMA_URL=http://host.docker.internal:11434 in your .env file during Step 3, OpenClaw is already configured to reach Ollama. Restart the services to ensure the connection is active:
cd /opt/openclaw && docker compose restartIn the OpenClaw web interface, go to Settings > Providers > Ollama. You should see your installed models listed automatically. Click Test Connection to confirm.
Now in any chat, select a local model from the model dropdown. Conversations using Ollama models never leave your server -- not a single byte is sent to any external API.
Make Ollama Start on Boot
Ollama installs its own systemd service by default. Verify it is enabled:
systemctl is-enabled ollamaIf it says disabled, enable it:
systemctl enable ollamaAdvanced: Custom Tools and Plugins
OpenClaw's plugin system lets you extend the assistant with custom tools. Plugins are defined as JSON manifests with associated handler code.
Plugin Structure
Each plugin lives in a directory under /opt/openclaw/plugins/ (which is volume-mounted into the container). A basic plugin looks like this:
plugins/
my-weather-tool/
manifest.json
handler.jsmanifest.json:
{
"id": "my-weather-tool",
"name": "Weather Lookup",
"description": "Get current weather for any city",
"version": "1.0.0",
"tools": [
{
"name": "get_weather",
"description": "Returns the current weather for a given city name",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "The city name, e.g. 'London' or 'Tokyo'"
}
},
"required": ["city"]
}
}
]
}handler.js:
module.exports = { async get_weather({ city }) { const response = await fetch(https://wttr.in/${encodeURIComponent(city)}?format=j1); const data = await response.json(); const current = data.current_condition[0];
return { city, temperature_c: current.temp_C, feels_like_c: current.FeelsLikeC, condition: current.weatherDesc[0].value, humidity: current.humidity, wind_kph: current.windspeedKmph, }; }, };
After adding a plugin, restart the worker container:
docker compose restart workerThe new tool will appear in Tools > Custom Plugins in the web interface. Enable it, and the LLM will automatically invoke it when relevant -- for example, if you ask "What is the weather in Berlin?" it will call get_weather with {"city": "Berlin"}.
Community Plugins
The OpenClaw community maintains a plugin registry at plugins.openclaw.ai. Popular plugins include:
- Calendar -- Connect to Google Calendar or CalDAV to check and create events.
- Home Assistant -- Control smart home devices through natural language.
- Finance -- Track expenses, fetch stock prices, monitor crypto portfolios.
- Image Generation -- Route prompts to Stable Diffusion, DALL-E, or Flux.
cd /opt/openclaw/plugins
git clone https://github.com/openclaw-plugins/calendar-tool.git
docker compose restart workerSecurity Hardening
A self-hosted AI assistant stores sensitive conversations. Take these steps to secure your deployment.
Change Default Credentials
If you used simple credentials during initial setup, change them now:
Restrict Network Access with UFW
Configure the firewall to allow only necessary traffic:
ufw default deny incoming
ufw default allow outgoing
ufw allow 22/tcp comment "SSH"
ufw allow 80/tcp comment "HTTP (redirect to HTTPS)"
ufw allow 443/tcp comment "HTTPS"
ufw enableVerify the rules:
ufw status verbosePort 3000 is no longer exposed to the internet since Nginx proxies all traffic over 443. The Docker containers communicate internally on the Docker bridge network.
Disable Direct Port Exposure
By default, the docker-compose.yml maps port 3000 to the host. Once Nginx is configured, bind it to localhost only. Edit docker-compose.yml:
Change:
ports:
- "${PORT:-3000}:3000"To:
ports:
- "127.0.0.1:${PORT:-3000}:3000"Restart the stack:
cd /opt/openclaw && docker compose up -dEnable Nginx Rate Limiting
Add rate limiting to your Nginx configuration to prevent brute-force attacks on the login endpoint. Add this to the http block in /etc/nginx/nginx.conf:
limit_req_zone $binary_remote_addr zone=openclaw_login:10m rate=5r/m;Then in your site configuration, add a location block for the login API:
location /api/v1/auth/login {
limit_req zone=openclaw_login burst=3 nodelay;
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}Reload Nginx:
systemctl reload nginxKeep the System Updated
Set up unattended security updates for the host OS:
apt install unattended-upgrades -y
dpkg-reconfigure -plow unattended-upgradesUpdating OpenClaw
OpenClaw releases updates frequently. Updating is straightforward with Docker.
Backup Before Updating
Always back up before an update:
/opt/openclaw/backup.shPull and Restart
cd /opt/openclaw
docker compose pull
docker compose up -dDocker pulls the latest images and recreates the containers. Your data persists in the named volumes (openclaw-pgdata, openclaw-redis-data, openclaw-uploads, openclaw-plugins).
Verify the Update
Check the running version:
docker exec openclaw-web cat /app/version.txtOr check through the web interface at Settings > About.
Review the logs for any migration messages:
docker compose logs --tail=50 webRolling Back
If an update causes issues, roll back to the previous image:
cd /opt/openclaw
docker compose down
docker compose pull ghcr.io/openclaw-ai/openclaw:v1.x.x # specific version tag
docker compose up -dCheck the OpenClaw releases page for version tags and changelogs.
Troubleshooting
Container Won't Start
Check the logs for the failing container:
docker compose logs web
docker compose logs dbCommon causes:
- Port conflict. Another service is using port 3000. Check with
ss -tlnp | grep 3000and either stop the conflicting service or change thePORTin.env. - Database password mismatch. Ensure
POSTGRES_PASSWORDin.envmatches the password inDATABASE_URL. If you changed the password after the database was first created, you need to reset it inside the container:docker exec -it openclaw-db psql -U openclaw -c "ALTER USER openclaw PASSWORD 'new_password';". - Insufficient memory. Run
free -hto check available RAM. OpenClaw needs at least 2 GB free. If memory is tight, consider upgrading your VPS.
Can't Connect to LLM Provider
# Test Anthropic connectivity from inside the container
docker exec openclaw-web curl -s https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"claude-sonnet-4-20250514","max_tokens":10,"messages":[{"role":"user","content":"Hi"}]}' | head -c 200Common causes:
- Invalid API key. Verify the key is correct and has not expired.
- Network restrictions. Some VPS providers block outbound HTTPS by default. Check with
curl -I https://api.anthropic.comfrom the host. - Rate limiting. If you see 429 errors, you have exceeded your API tier's rate limit. Wait or upgrade your API plan.
Telegram Bot Not Responding
curl "https://api.telegram.org/bot<YOUR_TOKEN>/getMe"You should see your bot's details in the response.
curl "https://api.telegram.org/bot<YOUR_TOKEN>/getWebhookInfo"TELEGRAM_MODE=polling to .env and restarting.docker compose logs worker | grep -i telegramHigh Memory Usage
Check per-container memory consumption:
docker stats --no-streamIf the worker container is using excessive memory, it may be running too many concurrent tasks. Limit concurrency in .env:
WORKER_CONCURRENCY=2If Ollama is consuming too much RAM, try a smaller model (phi3:mini instead of llama3.1:8b) or set a memory limit:
OLLAMA_MAX_MEMORY=4GDatabase Connection Errors
If you see ECONNREFUSED or connection refused errors for the database:
# Check if the database container is healthy
docker inspect openclaw-db --format='{{.State.Health.Status}}'Check database logs
docker compose logs dbManually test the connection
docker exec openclaw-db pg_isready -U openclawIf the database volume is corrupted, restore from your latest backup:
# Stop the stack
cd /opt/openclaw && docker compose downRemove the corrupted volume
docker volume rm openclaw_openclaw-pgdataStart the database only
docker compose up -d dbWait for it to be healthy
sleep 10Restore from backup
gunzip < /opt/openclaw/backups/openclaw_LATEST.sql.gz | docker exec -i openclaw-db psql -U openclaw openclawStart the rest
docker compose up -dFAQ
Is OpenClaw free to use?
Yes. OpenClaw is open source under the Apache 2.0 license. There are no license fees, subscription charges, or usage limits imposed by the software. Your only costs are the VPS hosting (starting at $6.99/month on VPS-Server.host) and any LLM API usage. If you run local models through Ollama, there are zero API costs.
Which LLM provider gives the best results?
It depends on your use case. Claude (Anthropic) excels at writing, analysis, and following complex instructions. GPT-4o (OpenAI) is strong at coding and multimodal tasks. Local models like Llama 3.1 8B are surprisingly capable for general conversation and are completely free. Most users configure multiple providers and switch depending on the task. OpenClaw makes it easy to compare by letting you regenerate any response with a different model.
Is there a mobile app?
OpenClaw does not have a native mobile app, but you do not need one. The web interface is fully responsive and works well in mobile browsers. You can add it to your home screen as a PWA (Progressive Web App) for an app-like experience. The Telegram integration is arguably better than a dedicated app because it works natively within a messaging app you already use, with full notification support and no extra installation.
How much does it cost to run OpenClaw per month?
The total cost breaks down into two parts. The VPS hosting is a fixed cost -- a CloudCore Professional plan at VPS-Server.host runs $18.99/month and provides plenty of resources for OpenClaw plus Ollama. API costs vary by usage: a moderate user making 50-100 queries per day with Claude Sonnet spends roughly $3-8/month on API fees. If you rely entirely on local models through Ollama, the API cost is $0. Compared to a $20/month ChatGPT Plus subscription, self-hosting is both cheaper and more capable.
Where is my data stored?
All data is stored on your VPS in a PostgreSQL database managed by Docker. Conversation history, uploaded files, user accounts, and configuration all live in Docker volumes on your server's disk. Nothing is stored by OpenClaw on any external server. The only external communication happens when you send a prompt to a cloud LLM provider (Anthropic, OpenAI, etc.), and even then, the providers' data retention policies apply only to the individual API call, not to your full conversation history.
How does OpenClaw compare to ChatGPT Plus?
ChatGPT Plus gives you access to one provider (OpenAI) through a polished interface for $20/month. OpenClaw gives you access to every major provider through your own interface for the cost of a VPS plus API usage. The key differences: OpenClaw supports multiple LLMs in one interface, stores data on your server, offers Telegram/Slack integration, includes task automation and code execution, and has a plugin system. ChatGPT Plus has the advantage of zero setup and a native mobile app. For anyone who values privacy, multi-model access, or customization, OpenClaw is the clear choice.
Next Steps
Your OpenClaw installation is running and secured. Here are ways to get more out of it:
- Install additional Ollama models. Try
ollama pull codellama:13bfor a coding-focused model orollama pull mixtral:8x7bif you have 32+ GB RAM for near-GPT-4 quality at zero API cost. - Set up monitoring. Install Uptime Kuma on the same VPS to monitor OpenClaw's
/api/v1/healthendpoint and get alerts if it goes down. - Automate backups to off-site storage. Extend the backup script to upload to an S3-compatible bucket using
aws s3 cporrclone. This protects you against VPS-level failures. - Explore the task scheduler. Set up a daily morning briefing that summarizes your email, calendar, and news. Configure it under Tasks > New Task in the web interface.
- Join the community. The OpenClaw Discord and GitHub Discussions are active and welcoming. Share your plugins, report bugs, and get help from other self-hosters.
Need a VPS for OpenClaw? Our CloudCore Professional plan includes 6 vCPU, 12 GB RAM, and 100 GB NVMe SSD -- everything you need to run OpenClaw with Ollama at peak performance. Deploy Ubuntu 24.04 in under 60 seconds and follow this guide to have your personal AI assistant running today. Get started now.