This project provides a secure, sandboxed environment for running moltbot (built from source) and other software using Docker. It isolates the execution from your host system to prevent any accidental damage or unauthorized access.
- Docker
- Docker Compose
- Build and Start the Jail:
# Ensure wrapper is executable chmod +x molt # Build image (builds moltbot from source) and start background service docker compose build docker compose up -d
The ./molt wrapper script is your primary interface. It runs commands inside the secure container.
To use the installed moltbot CLI:
# Check version
./molt "moltbot --version"
# Run help
./molt "moltbot --help"
# First Time Setup
If you need to configure the bot interactively:
./molt "moltbot onboard"
# Run any moltbot command
./molt "moltbot <command>"To enter the container shell for interactive session:
./molt
# You are now inside the jail as 'moltuser'
# Type 'exit' to return to hostThe workspace/ directory in this project root is mounted into the container at ~/workspace.
- Input: Place scripts or files you want to process in
workspace/on your host. - Output: Any files written to
~/workspaceinside the container will appear inworkspace/on your host.
Example: Running a python script
- Create a script on your host:
echo 'print("Hello from inside the jail")' > workspace/hello.py
- Run it securely:
./molt "python3 hello.py"
The container is configured to allow:
- Outbound Internet: You can download files, access APIs, etc.
- Host Access: You can access services running on your host machine (like a local LLM server) using the hostname
host.docker.internal.
Example: Connecting to local Ollama/LM Studio
If your LLM is running on localhost:11434 on your machine, access it from inside the jail via:
http://host.docker.internal:11434
Moltbot's internal state (configuration, memory, sessions) is stored in a Docker volume named moltbot_data. This ensures that your bot remembers its configuration even if you restart or rebuild the jail.
This setup uses a "paranoid" configuration to ensure safety:
- Read-Only Root Filesystem: The container's OS files cannot be modified. Malicious scripts cannot install rootkits or modify system binaries.
- Non-Root User: Processes run as
moltuser(UID 1000) with nosudoaccess. - Dropped Capabilities: All Linux kernel capabilities (like
CAP_NET_ADMIN) are dropped. - Resource Limits:
- RAM: Limited to 512MB
- CPU: Limited to 1 core
- This prevents runaway processes from crashing your host computer.
- Ephemeral Tmp:
/tmpis mounted as atmpfs(RAM disk). Data written there is lost when the container stops.
- Stop the jail:
docker compose stop - Rebuild (e.g., after Dockerfile changes):
docker compose build && docker compose up -d - View logs:
docker compose logs -f