Q: How do I run OpenClaw in Docker for the first time?
Pull and run the official image with: docker pull openclaw/openclaw:latest && docker run -it --rm -p 7400:7400 openclaw/openclaw:latest openclaw sim --demo. This launches a simulated UR5e arm in the built-in physics simulator within seconds. For GPU-accelerated simulation add --gpus all to the docker run command.
Q: How do I connect a physical robot to an OpenClaw Docker container?
Use host networking mode (--network host) or expose the robot port explicitly (-p 30002:30002 for Universal Robots). Mount the robot config file: -v ./robot.yaml:/openclaw/config/robot.yaml. Start with: docker run --network host -v ./robot.yaml:/openclaw/config/robot.yaml openclaw/openclaw:latest openclaw run --config /openclaw/config/robot.yaml.
Q: Can I run OpenClaw in Docker on Windows and macOS?
Yes. Docker Desktop for Windows and macOS runs OpenClaw containers transparently. Note that on macOS and Windows, GPU passthrough requires additional configuration (WSL2 GPU support on Windows; macOS Metal GPU passthrough is not yet supported in Docker Desktop for robotics simulation). CPU-only simulation works on all platforms.
Q: How do I build a custom OpenClaw Docker image with my own plugins?
Start from the official base image: FROM openclaw/openclaw:3.1-runtime. Copy your plugin shared library into /openclaw/plugins/. Copy your config file to /openclaw/config/. Run RUN openclaw plugin install --scan /openclaw/plugins/ to register the plugin. Build and tag: docker build -t my-org/openclaw-custom:1.0 . Then test with docker run my-org/openclaw-custom:1.0 openclaw plugin list.
Q: What Docker Compose file do I need for OpenClaw with ROS 2?
Use a three-service compose file: the openclaw/openclaw:latest service exposes port 7400; the ros:humble service sources /opt/ros/humble/setup.bash and runs the openclaw_ros2 bridge; a redis:7-alpine service stores shared state. Mount a shared volume between OpenClaw and ROS 2 services for log and config sharing. Set ROS_DOMAIN_ID as an environment variable on both ROS 2 services.
Q: How do I persist OpenClaw logs and configuration data across Docker container restarts?
Define named volumes in docker-compose.yml: openclaw_config: and openclaw_logs:. Mount them in the service: volumes: - openclaw_config:/openclaw/config - openclaw_logs:/openclaw/logs. Named volumes survive container removal (docker rm) but are removed by docker-compose down -v, so use docker-compose down without -v for maintenance restarts.
Q: How do I enable GPU passthrough for OpenClaw simulation in Docker?
Install the NVIDIA Container Toolkit on the host, then add to docker run: --gpus all --runtime=nvidia. In docker-compose.yml, set: deploy: resources: reservations: devices: - capabilities: [gpu]. Verify GPU access inside the container with: openclaw sim --check-gpu. Bullet physics simulation performance scales linearly with GPU capability.
Q: What is the difference between openclaw/openclaw:runtime and openclaw/openclaw:dev Docker images?
The :runtime image (~800 MB) includes only production runtime files, shared libraries, and the CLI. The :dev image (~2.4 GB) adds C++ headers, CMake, GCC, Python development packages, and testing tools needed to build plugins or the SDK from source. Use :runtime in production and :dev for development environments where you are writing custom drivers or plugins.
Q: How do I update OpenClaw inside a Docker container?
Update by pulling the new image tag: docker pull openclaw/openclaw:3.2. Update your docker-compose.yml image field to the new tag and run docker-compose up -d. Containers are stateless, so configuration changes should be managed through mounted volumes rather than inside the container to ensure updates are non-destructive.