Claude Code is Anthropic's command-line AI that can write code, run commands, and build projects for you. This guide gives you a sandboxed setup where Claude has everything it needs — but can't touch anything on your computer except one shared folder.
Prerequisites
- Docker Desktop — install for Mac, Windows, or Linux. Open it and wait until it says "running".
- An Anthropic API key — get one at console.anthropic.com. You'll need to add credits. Your key starts with
sk-ant-.
Quick start
Open a terminal and run:
docker run -it --rm \
-e ANTHROPIC_API_KEY=sk-ant-your-key-here \
-v "$HOME/claude-projects:/projects" \
-p 3000-9000:3000-9000 \
registry.ibrahim.ws/claude-code:latest
That's it. You're in Claude Code. Ask it to build something.
What this does
Shared folder. The -v flag links ~/claude-projects on your computer to /projects inside the container. Claude reads and writes files there. Everything else on your machine is invisible to it. If the folder doesn't exist, Docker creates it.
Filesystem sandbox. Claude cannot access your home directory, documents, SSH keys, browser data, or anything outside /projects. It can't run commands that affect your computer. When you exit, the container is deleted (--rm).
Dev server ports. Ports 3000 through 9000 are forwarded, so if Claude starts a dev server you can open it in your browser at localhost:3000 (or whatever port it picks). This covers the defaults for React, Vite, Flask, Django, Express, and most other frameworks.
Pre-installed tools. The image includes Node.js 22, Python 3, Bun, pip, git, curl, and build essentials. Claude can install more packages inside the container as needed — they won't affect your system.
Tips
Save your API key. To avoid pasting it every time, set it in your shell profile:
# Add to ~/.bashrc or ~/.zshrc
export ANTHROPIC_API_KEY=sk-ant-your-key-here
Then the command simplifies to:
docker run -it --rm \
-e ANTHROPIC_API_KEY \
-v "$HOME/claude-projects:/projects" \
-p 3000-9000:3000-9000 \
registry.ibrahim.ws/claude-code:latest
Files persist in the shared folder. Anything Claude saves to /projects stays in ~/claude-projects after the container exits. Anything saved elsewhere inside the container is lost.
Windows users: Replace $HOME/claude-projects with %USERPROFILE%\claude-projects in Command Prompt, or $env:USERPROFILE\claude-projects in PowerShell.