Install OpenClaw on DigitalOcean
This guide shows how to install openclaw on digitalocean using Ubuntu 24.04, Docker, and Node.js. You’ll get a clear, command-focused path to provision a droplet, install dependencies, deploy OpenClaw, keep the system updated, and secure your server. Follow the commands exactly and replace placeholders (like YOUR_DOMAIN and REPO_URL) with your values.
Prerequisites
- DigitalOcean account and ability to create a Droplet (the provider covered here is DigitalOcean).
- Ubuntu 24.04 Droplet (or compatible VPS) with SSH access.
- Basic familiarity with the terminal, SSH keys, and editing files (nano, vim).
- OpenClaw source or Docker image access — obtain the official repository or image before starting.
- See server sizing guidance below and check server requirements for minimum specs.
Install OpenClaw on DigitalOcean — quick checklist
- Create a Droplet (choose Ubuntu 24.04) and add your SSH key.
- Update the system and create a non-root user.
- Install Docker, Docker Compose, and Node.js.
- Clone/configure OpenClaw, set environment variables, and start containers.
- Enable UFW, configure firewall rules, and verify HTTPS if using a domain.
Provision a Droplet and initial setup
Use the DigitalOcean control panel or the doctl CLI to create a droplet. For beginners the control panel is simplest. Choose an SSH key at creation time so you can log in as root via SSH and then create a non-root user.
# SSH into your new droplet (replace with your IP)
ssh root@YOUR_DROPLET_IP
# Update package index and upgrade
apt update && apt upgrade -y
# Create a non-root user (replace 'deploy')
adduser deploy
usermod -aG sudo deploy
# Set up basic firewall to allow SSH (adjust if you use different SSH port)
ufw allow OpenSSH
ufw enable
Resource tiers and sizing guidance
Choose a droplet tier based on expected load. Typical starter guidance:
- Small: 1 vCPU, 1–2 GB RAM — suitable for development or low-traffic testing.
- Medium: 2 vCPU, 4 GB RAM — better for small production or light automation workloads.
- Large: 4+ vCPU, 8+ GB RAM — for higher concurrency and heavier background tasks.
Adjust disk and bandwidth according to data retention and expected traffic. If you need recommendations on hosting, review our best hosting guide for OpenClaw-specific considerations.
Install Docker, Docker Compose, and Node.js
Ubuntu 24.04 can install Docker from the official repository and Node.js from NodeSource or nvm. Below are common commands; run them as your non-root sudo user.
# Install dependencies and Docker repository
sudo apt update
sudo apt install -y ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
# Allow your deploy user to run Docker commands without sudo
sudo usermod -aG docker $USER
newgrp docker
# Install Node.js (example: Node 18 LTS via NodeSource)
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs
# Verify versions
docker --version
docker compose version
node -v
npm -v
Clone OpenClaw, configure environment, and deploy
Obtain the official OpenClaw repository or a provided Docker Compose bundle. Replace REPO_URL with the official source.
# Clone the source or sample docker-compose
git clone REPO_URL openclaw
cd openclaw
# Copy env template and edit values
cp .env.example .env
# Edit .env with your domain, secrets, DB credentials, etc. (use nano or vim)
nano .env
# If OpenClaw is containerized (docker-compose.yml present)
docker compose pull
docker compose up -d --build
# If the project requires Node build steps (non-containerized)
npm install
npm run build
npm start
After deployment, check container status and logs:
docker compose ps
docker compose logs -f # stream logs
docker logs CONTAINER_NAME # container-specific logs
Update section
Keep the OS and containers updated. For system updates and to refresh containers:
# Update OS packages
sudo apt update && sudo apt upgrade -y
# Pull newer container images and restart
cd /path/to/openclaw
docker compose pull
docker compose up -d --remove-orphans --build
# If using Node-managed app
git pull origin main
npm install
npm run build
pm restart # or use your process manager (systemd / pm2)
Security
Secure the droplet before exposing OpenClaw publicly:
- Use UFW to allow only needed ports (SSH, HTTP, HTTPS):
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
- Disable root SSH login and use key-based auth (edit /etc/ssh/sshd_config).
- Install fail2ban to mitigate brute-force attempts.
- Run containers with least privileges; avoid mounting sensitive host paths into containers.
- Use HTTPS (Let’s Encrypt certs via Certbot or a reverse proxy like Traefik). If you want HTTPS automation, configure and test certificate issuance on a staging domain first.
Screenshots checklist
- Droplet creation summary (image, region, SSH key) — screenshot.
- SSH session showing successful login and sudo access.
- Output of
docker compose psorsystemctl statusfor the service. - .env file (with secrets redacted) showing required variables set.
- Browser view of the running OpenClaw web interface (after HTTPS is configured).
Troubleshooting
- Container won’t start: Check
docker compose logsanddocker inspectfor health checks. - Port conflicts: Verify no host service uses ports 80/443, or change your reverse proxy mapping.
- Permission errors with volumes: Ensure files are owned by the user Docker expects (or adjust UID/GID mappings).
- Node build failures: Confirm Node version and rebuild:
npm cithennpm run build. - Database connection errors: Confirm DB host, port, credentials in the .env and that the DB network is reachable from the app.
Useful diagnostic commands:
docker compose logs --tail 200
journalctl -u docker.service --since "1 hour ago"
ss -tuln | grep LISTEN
systemctl status
Who to contact and additional resources
Check official OpenClaw documentation and community channels for feature-specific questions. For hosting and hardening advice see our secure VPS guide and the best hosting write-up for more context on provider trade-offs.
Recommendation and next steps
If you’re ready to follow this guide hands-on, Start a DO Droplet and choose an Ubuntu 24.04 image with a tier that matches the resource guidance above. Use SSH keys, enable UFW, and deploy via Docker compose as shown. DigitalOcean provides a straightforward UI and droplets that are well-suited for starting automation projects like OpenClaw — evaluate the appropriate tier and snapshot your droplet after a successful configuration.