Skip to content

Run OpenClaw in a Docker container for enhanced security and isolation.

License

Notifications You must be signed in to change notification settings

jberclaz/docker-openclaw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenClaw Docker

Docker Image Size License: MIT GitHub Issues

Run OpenClaw in a Docker container for enhanced security and isolation.

Getting Started

Prerequisites

Quick Start

  1. Clone this repository

    git clone https://github.com/jberclaz/docker-openclaw.git
    cd docker-openclaw
  2. First run (interactive setup)

    On first run, you need to configure OpenClaw. Start an interactive terminal:

    docker compose run --rm openclaw bash

    The setup wizard will start automatically. Follow the prompts to set up your API keys and preferences. When done, exit the container.

  3. Start OpenClaw

    docker compose up -d
  4. Access OpenClaw

    OpenClaw runs on port 18789. Connect your OpenClaw client to:

    ws://localhost:18789
    

Configuration

After initial setup, your configuration is stored in the Docker volume. To modify settings:

docker compose exec openclaw bash
cd ~/.openclaw
 nano openclaw.json

Required Services

To use OpenClaw, you'll need to register for the following services:

1. LLM Provider

OpenClaw requires an LLM API for reasoning and task execution. Options include:

2. Brave Search API

Required for web search capabilities:

  1. Visit brave.com/api
  2. Sign up for a free account
  3. Create an API key

3. Telegram Bot (Optional)

To interact with OpenClaw via Telegram:

  1. Message @BotFather on Telegram
  2. Use /newbot to create a new bot
  3. Copy the bot token
  4. Start a chat with your new bot and visit https://t.me/YOUR_BOT_NAME to activate it

Stopping OpenClaw

docker compose down

To stop and remove the data volume (including all configuration):

docker compose down -v

Data Persistence

This setup uses a Docker named volume (openclaw_data) to persist:

  • OpenClaw configuration (~/.openclaw/)
  • Browser profile data
  • Any workspace files

The volume persists across container restarts and removals.

Security Benefits

Running OpenClaw in Docker provides:

  • Isolation: OpenClaw runs in an isolated environment
  • No host system pollution: All dependencies are contained
  • Easy cleanup: Remove the container and volume to cleanly uninstall
  • Resource control: Limit CPU/memory usage if needed

Ports

Port Description
18789 OpenClaw gateway WebSocket

Updating OpenClaw

To update OpenClaw to the latest version, pull the latest image and recreate the container:

docker compose pull
docker compose up -d

Troubleshooting

Check container logs

docker compose logs

Check if Chrome is running

docker compose exec openclaw curl http://127.0.0.1:9222/json/version

Rebuild from scratch

docker compose down -v
docker compose pull
docker compose up -d

File Structure

.
├── Dockerfile           # Container image definition
├── docker-compose.yml  # Container orchestration
├── start.sh           # Container startup script
├── LICENSE            # MIT License
└── README.md          # This file

About

Run OpenClaw in a Docker container for enhanced security and isolation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages