Skip to main content
Project 4 min read

OpenClaw Docker: AI Agent Runtime with Tailscale VPN

Docker Compose setup for OpenClaw AI agent runtime with Tailscale secure VPN, browser sandbox, and automated HTTPS configuration.

Originally published:

GitHub by iamEvanYT

OpenClaw Docker: Containerized AI Agent Runtime with Secure Remote Access

OpenClaw Docker provides a production-ready Docker Compose setup for deploying OpenClaw—an open-source AI agent runtime—with integrated Tailscale VPN for secure remote HTTPS access. This project eliminates the complexity of manual configuration by bundling the gateway, browser sandbox, data explorer, and VPN connectivity into a single automated deployment workflow.

Purpose and Significance

Running OpenClaw in containerized environments presents challenges: service orchestration, secure networking, certificate management, and data persistence. OpenClaw Docker solves these by providing a pre-configured Docker Compose stack that handles infrastructure concerns transparently. Developers and organizations can deploy a fully functional AI agent runtime in minutes rather than hours, with enterprise-grade security via Tailscale tunneling. This is particularly valuable for teams building AI workflows, autonomous agents, or exploring OpenClaw's capabilities without managing bare-metal infrastructure.

Key Features

  • Automated Setup — Single `setup.sh` script handles configuration, service initialization, and OpenClaw onboarding without manual intervention
  • Tailscale Integration — Built-in secure VPN tunnel with automatic HTTPS certificate generation via Tailscale's public key infrastructure
  • Multi-Service Stack — Includes OpenClaw gateway (AI runtime), browser sandbox (Chrome + noVNC for web automation), code-server explorer (data browsing), and Tailscale VPN client
  • Persistent Storage — Separate volumes for configuration, workspace, storage, Tailscale state, and browser profiles—data survives container restarts
  • Helper Scripts — Utility scripts for common operations: service restart, container shell access, log viewing, permission fixes, and image updates
  • Browser Automation Ready — Pre-configured Chrome DevTools Protocol (CDP) integration for OpenClaw agent web automation tasks
  • Security-First Design — Tailscale Funnel disabled by default, auth-key rotation support, and isolated browser container permissions

Getting Started

Prerequisites: Docker, Docker Compose, and a Tailscale account with an active auth key.

The quickest path:

  1. Clone the repository and navigate to the directory
  2. Run `sh ./setup.sh` and provide your Tailscale auth key when prompted
  3. Generate HTTPS certificates by running `sh ./scripts/ssh-tailscale.sh`, then `tailscale cert your-machine.your-tailnet.ts.net`
  4. Restart services with `sh ./scripts/restart.sh`
  5. Access your OpenClaw instance at `https://your-machine.tailnet.ts.net`

Who It's For

  • Developers building or testing AI agent applications with OpenClaw
  • DevOps Engineers deploying containerized AI infrastructure with security requirements
  • Teams needing remote, secure access to AI agent runtimes without VPN infrastructure setup
  • OpenClaw Evaluators wanting to quickly spin up a complete evaluation environment
  • Autonomous Systems Builders requiring browser automation and agent orchestration in production-like settings

Architecture Overview

The stack includes four core services orchestrated via Docker Compose:

  • Gateway — OpenClaw AI agent runtime; main API and dashboard interface
  • Tailscale — VPN client providing secure encrypted tunnel and HTTPS certificate management
  • Browser — Chromium sandbox with noVNC remote desktop for agent-driven web automation
  • Explorer — Code-server instance for browsing OpenClaw configuration, workspace, and data files

All services persist data to named volumes under `./volumes/` and communicate via Docker's internal network. Tailscale exposes services securely via your tailnet (Tailscale private network) on three HTTPS ports: 443 (gateway), 1443 (explorer), and 8443 (browser noVNC).

Configuration and Customization

For advanced users, manual setup is supported. Key configuration files:

  • gateway/.env — OpenClaw runtime environment variables and secrets
  • tailscale/.env — Tailscale auth key and VPN configuration
  • explorer-config.json — Code-server editor settings and workspace configuration
  • volumes/config/openclaw.json — OpenClaw feature flags, including browser automation CDP settings
  • volumes/tailscale/config/serve.json — Tailscale HTTPS routing rules and port mapping (advanced)

Browser automation requires explicit configuration in `openclaw.json` with CDP timeout settings, color branding, and profile names. This allows agents to interact with web interfaces programmatically.

Troubleshooting Quick Reference

  • Services won't start: Check logs with `docker compose logs -f`
  • Tailscale auth fails: Verify auth key validity and non-expiration; comment out `TS_AUTHKEY` if previously connected
  • HTTPS connection errors: Confirm HTTPS is enabled in Tailscale admin console and certificates were generated
  • Permission denied: Run `sh ./scripts/fix-perms.sh` to reset volume ownership
  • Update OpenClaw: Execute `sh ./scripts/update.sh` to pull the latest gateway image

Available Utility Scripts

The project includes shell scripts for common operations: `setup.sh` (initial deployment with onboarding), `startup.sh`/`shutdown.sh`/`restart.sh` (service lifecycle), `ssh-gateway.sh`/`ssh-tailscale.sh` (container shell access), `gateway-logs.sh` (log streaming), `update.sh` (image updates), and `fix-perms.sh` (permission correction).

Security Considerations

Tailscale Funnel is disabled by default—enable only if you intend public internet access and fully understand exposure implications. Rotate Tailscale auth keys periodically. The browser container runs with isolated permissions but should not visit malicious sites. All data persists in volumes; implement regular backups for production use.

Resources and Support

Source: iamEvanYT/openclaw-docker GitHub repository. Last updated February 2026.

Share:

Original Source

https://github.com/iamEvanYT/openclaw-docker

View Original

Last updated: