Want us to handle everything? Get fully managed hosting, free to start.
Linux Server
Ubuntu, Debian, CentOS, and more
Deploy OpenClaw on any Linux server for maximum flexibility and control. Works with any distribution that supports Docker.
Supported Distributions
Ubuntu
20.04, 22.04, 24.04
RecommendedDebian
11, 12
CentOS / RHEL
8, 9, Stream
Fedora
38, 39, 40
Arch Linux
Rolling release
Alpine
3.18+
Pros and Cons
Advantages
- ✓Maximum flexibility - Run any Linux distro, any configuration
- ✓Native Docker support - No virtualization overhead, best performance
- ✓Use any hardware - Old laptops, Intel NUC, server hardware all work
- ✓Flexible messaging setup - Web chat and your preferred messaging flow can be configured on self-hosted installs
- ✓Complete privacy - Data stays on your hardware
- ✓Full customization - Configure everything exactly how you want
- ✓Free OS - No Windows license required
Disadvantages
- ✗Requires Linux knowledge - Command line familiarity needed
- ✗Self-managed - You handle updates, security, troubleshooting
- ✗Hardware dependent - Reliability depends on your hardware quality
- ✗Network setup required - Need to configure firewall, remote access
- ✗No GUI by default - Server distros are command-line only
Things to Consider
Which Distribution?
Ubuntu 24.04 LTS (Recommended): Most documentation, largest community, 5-year support.
Debian 12: More stable, lighter, good for minimal installs.
CentOS Stream / Rocky / Alma: RHEL-compatible, enterprise-focused.
Alpine: Ultra-minimal, great for containers but requires more Linux knowledge.
Hardware Options
Intel NUC / Mini PC (~$200-400): Compact, low power, perfect for always-on.
Old laptop: Free if you have one, but higher power use and potential fan noise.
Old desktop: More powerful but louder and uses more power.
Server hardware: Overkill for OpenClaw, but if you have it, why not?
Storage Choice
SSD is strongly recommended over HDD. Docker image pulls and container startup are significantly faster on SSD. A 120GB SSD is plenty - you can find them for under $20.
Security Hardening
Essential security steps: Use SSH keys (not passwords), change default SSH port, set up fail2ban, configure ufw firewall, keep system updated. For remote access, Cloudflare Tunnel is more secure than opening ports directly.
Headless vs Desktop
For a dedicated server, use a minimal/server install without a desktop environment. This saves 500MB+ RAM and reduces attack surface. You'll manage everything via SSH - which is actually easier for server administration.
Requirements
Minimum
- • 1 CPU core
- • 1GB RAM
- • 10GB storage
- • 64-bit architecture
Recommended
- • 2+ CPU cores
- • 2GB+ RAM
- • 20GB+ SSD storage
- • Static IP or domain
Quick Install (One Command)
For Ubuntu/Debian systems, run this single command to install everything:
curl -fsSL https://get.openclawvps.com | shThis installs Docker (if needed), creates the configuration, and starts OpenClaw.
Manual Installation
Step 1: Install Docker
Ubuntu / Debian:
# Install Docker
curl -fsSL https://get.docker.com | sh
# Add current user to docker group
sudo usermod -aG docker $USER
# Apply group changes (or log out and back in)
newgrp dockerCentOS / RHEL / Fedora:
# Install Docker
sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
# Start Docker
sudo systemctl enable --now docker
# Add current user to docker group
sudo usermod -aG docker $USER
newgrp dockerArch Linux:
sudo pacman -S docker docker-compose
sudo systemctl enable --now docker
sudo usermod -aG docker $USER
newgrp dockerStep 2: Verify Docker installation
docker run hello-worldYou should see "Hello from Docker!" if everything is working.
Step 3: Create OpenClaw directory
mkdir -p ~/openclaw && cd ~/openclawStep 4: Create docker-compose.yml
cat > docker-compose.yml << 'EOF'
version: '3.8'
services:
openclaw:
image: openclaw/openclaw:latest
container_name: openclaw
restart: unless-stopped
ports:
- "8080:8080"
environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- GATEWAY_TOKEN=${GATEWAY_TOKEN}
volumes:
- ./data:/app/data
EOFStep 5: Create .env file
cat > .env << EOF
OPENROUTER_API_KEY=sk-or-your-key-here
GATEWAY_TOKEN=$(openssl rand -hex 32)
EOFReplace sk-or-your-key-here with your actual BYOK provider API key.
Step 6: Start OpenClaw
docker compose up -dOpenClaw will be available at http://localhost:8080 or http://YOUR_SERVER_IP:8080
Auto-Start with Systemd
Create a systemd service to automatically start OpenClaw on boot:
sudo cat > /etc/systemd/system/openclaw.service << 'EOF'
[Unit]
Description=OpenClaw AI Assistant
After=docker.service
Requires=docker.service
[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/home/YOUR_USER/openclaw
ExecStart=/usr/bin/docker compose up -d
ExecStop=/usr/bin/docker compose down
User=YOUR_USER
Group=docker
[Install]
WantedBy=multi-user.target
EOF
# Replace YOUR_USER with your username
sudo sed -i "s/YOUR_USER/$USER/g" /etc/systemd/system/openclaw.service
# Enable and start the service
sudo systemctl daemon-reload
sudo systemctl enable openclaw
sudo systemctl start openclawFirewall Configuration
If you have a firewall enabled, allow port 8080:
UFW (Ubuntu/Debian):
sudo ufw allow 8080/tcpfirewalld (CentOS/Fedora):
sudo firewall-cmd --permanent --add-port=8080/tcp
sudo firewall-cmd --reloadFor production, we recommend using a reverse proxy (nginx/Caddy) with HTTPS instead of exposing port 8080 directly.
HTTPS with Reverse Proxy (Recommended)
Option A: Caddy (Easiest)
# Install Caddy
sudo apt install -y caddy
# Configure Caddy
sudo cat > /etc/caddy/Caddyfile << 'EOF'
your-domain.com {
reverse_proxy localhost:8080
}
EOF
# Restart Caddy
sudo systemctl restart caddyCaddy automatically handles SSL certificates with Let's Encrypt.
Option B: Cloudflare Tunnel (Most Secure)
No ports to open, DDoS protection included, and hides your server IP.
Follow our Cloudflare Tunnel guide →Useful Commands
View logs
docker compose logs -fCheck status
docker compose psUpdate to latest version
docker compose pull
docker compose up -dBackup data
tar -czvf openclaw-backup.tar.gz ~/openclaw/dataNeed Help?
Don't want to set it up yourself? We can help.