🦞 Clawbase
← Back to blog

March 25, 2026

How to Set Up Openclaw with Docker Compose: A Practical Guide

Learn how to deploy Openclaw using Docker Compose, covering setup, configuration, and troubleshooting common issues like permissions, volumes, and upgrades.

Introduction

Openclaw is an open-source, self-hosted LLM orchestration platform designed for developers and teams who want to run, fine-tune, and manage language models on their own infrastructure. If you're looking for a straightforward way to get Openclaw up and running, Docker Compose offers a reliable, reproducible installation path. This guide walks you through setting up Openclaw using Docker Compose, with practical tips on configuration, troubleshooting, and upgrades.

Note: This article focuses on Docker-first installation. For those interested in managed hosting, check out Clawbase, which offers a cloud-hosted Openclaw experience.


Why Use Docker Compose for Openclaw?

Docker Compose simplifies the deployment of multi-container applications like Openclaw. Instead of manually managing each container, you define your stack in a single docker-compose.yml file. This approach ensures:

  • Consistency: Everyone on your team runs the same setup.
  • Isolation: Dependencies don't interfere with your host system.
  • Easy Upgrades: Updating Openclaw is as simple as pulling new images.
  • Portability: Move your setup between environments with minimal hassle.

Prerequisites

Before you start, make sure you have:

  • Docker (version 20.10+ recommended)
  • Docker Compose (v2+)
  • A host machine (Linux, macOS, or Windows with WSL2)
  • At least 4GB RAM (8GB+ for production workloads)

If you need to install Docker and Docker Compose, refer to the official Docker documentation.


1. Clone the Openclaw Repository

Start by cloning the Openclaw GitHub repository, which contains the official docker-compose.yml file:

git clone https://github.com/openclaw/openclaw.git
cd openclaw

You can review the latest docker-compose.yml here.


2. Understanding the docker-compose.yml File

The core of your deployment is the docker-compose.yml file. It typically defines services like:

  • openclaw: The main application container.
  • postgres: Database backend.
  • redis: Caching and task queuing.
  • Optional: nginx for reverse proxying, or other sidecars.

Here’s a simplified example:

version: '3.8'
services:
  openclaw:
    image: openclaw/openclaw:latest
    ports:
      - "8080:8080"
    environment:
      - DATABASE_URL=postgresql://user:password@postgres:5432/openclaw
      - REDIS_URL=redis://redis:6379/0
    volumes:
      - ./data:/app/data
    depends_on:
      - postgres
      - redis
  postgres:
    image: postgres:15
    environment:
      - POSTGRES_DB=openclaw
      - POSTGRES_USER=user
      - POSTGRES_PASSWORD=password
    volumes:
      - ./pgdata:/var/lib/postgresql/data
  redis:
    image: redis:7
    volumes:
      - ./redisdata:/data

Key points:

  • Volumes ensure data persists across container restarts.
  • Environment variables configure connections between services.
  • Ports expose Openclaw's web UI and API.

You can customize this file as needed. For advanced scenarios (SSL, custom networks, etc.), see the Openclaw Docker guide.


3. Configure Environment Variables

Before launching, set your secrets and configuration. You can do this in the docker-compose.yml file or in a separate .env file (recommended for sensitive values).

Ready for your own?

🦞 Hire an AI employee that works 24/7

Plans from less than $1/day. Dedicated cloud host, top models, and messaging on Telegram, Slack, or Discord. No API keys to manage.

See plans · Cancel anytime

Example .env:

POSTGRES_USER=youruser
POSTGRES_PASSWORD=yourpassword
POSTGRES_DB=openclaw
DATABASE_URL=postgresql://youruser:yourpassword@postgres:5432/openclaw
REDIS_URL=redis://redis:6379/0

Make sure to update your docker-compose.yml to reference these variables:

environment:
  - DATABASE_URL=${DATABASE_URL}
  - REDIS_URL=${REDIS_URL}

4. Launch Openclaw with Docker Compose

With your configuration in place, start the stack:

docker compose up -d
  • -d runs containers in the background.
  • The first launch may take a few minutes as images are downloaded.

Check logs to ensure everything started correctly:

docker compose logs -f openclaw

If all goes well, Openclaw should be accessible at http://localhost:8080.


5. Managing Volumes and Data Persistence

Persistent storage is crucial for Openclaw’s functionality. By default, the docker-compose.yml mounts local directories (./data, ./pgdata, ./redisdata) to container paths. This ensures that:

  • Uploaded files, model weights, and user data aren't lost between restarts.
  • Database and cache data persist across upgrades.

Best practices:

  • Use absolute paths in production to avoid confusion.
  • Regularly back up these directories.
  • For cloud servers, consider mounting external volumes (e.g., EBS on AWS).

6. Common Issues & Troubleshooting

File Permissions

Problem: You see errors like Permission denied when Openclaw tries to write to a volume.

Solution:

  • Ensure the local directories (e.g., ./data) are writable by Docker.
  • On Linux, you may need to adjust ownership:
    sudo chown -R 1000:1000 ./data ./pgdata ./redisdata
    
    Replace 1000:1000 with the UID:GID of the user running the container (often 1000 for the default user).
  • On macOS/Windows, permissions are usually handled automatically, but check your Docker Desktop settings if issues persist.

Port Conflicts

Problem: Bind for 0.0.0.0:8080 failed: port is already allocated

Solution:

  • Change the host port mapping in docker-compose.yml, e.g., - "8081:8080".
  • Restart Docker Compose.

Database Initialization Errors

Problem: Openclaw fails to connect to Postgres, or migrations fail.

Solution:

  • Check that the postgres container is healthy (docker compose ps).
  • Ensure credentials in DATABASE_URL match the Postgres service.
  • If you need to reset the database (for development), stop the stack and remove the ./pgdata directory.

Upgrading Openclaw

To upgrade to a newer Openclaw version:

  1. Pull the latest images:
    docker compose pull
    
  2. Restart the stack:
    docker compose down
    docker compose up -d
    
  3. Run any required migrations (check Openclaw’s release notes).

Tip: Always back up your volumes before upgrading.

Cleaning Up

To stop and remove all containers, networks, and volumes:

docker compose down -v

Warning: This deletes all data. Use with caution!


7. Advanced Configuration

Openclaw is highly customizable. Some common tweaks include:

  • Custom Model Paths: Mount additional host directories for model storage:
    volumes:
      - /mnt/models:/app/models
    
  • Reverse Proxy: Use Nginx or Traefik to handle SSL and domain routing.
  • Scaling: For higher loads, scale out worker containers or move services to managed databases.

For a managed, production-ready deployment, Clawbase offers Openclaw hosting with zero setup.


8. Frequently Asked Questions

Can I run Openclaw on ARM devices?

Check if the official images support ARM (linux/arm64). If not, you may need to build from source.

How do I access the Openclaw API?

Once running, the API is available at /api under your server’s base URL (e.g., http://localhost:8080/api).

Where are logs stored?

Use docker compose logs [service] to view logs. For persistent logs, mount a host directory to /app/logs in your openclaw service.

How do I add authentication or SSL?

Deploy a reverse proxy (e.g., Nginx) in front of Openclaw, and configure HTTPS and authentication there.


Conclusion

Deploying Openclaw with Docker Compose is the fastest way to get started with local or on-prem LLM orchestration. By following the steps above, you’ll have a robust, reproducible setup that’s easy to upgrade and maintain. For advanced clustering, multi-node deployments, or if you want to avoid infrastructure management, explore Clawbase for a managed Openclaw experience.

For more details, always refer to the official Openclaw documentation and community forums. Happy hacking!