This repository contains Docker configurations and scripts to run Claude Code in a Docker container, primarily intended for Windows users who need to use Claude Code in a containerized environment.
For development and architecture details, see DEVELOP.md.
wget https://raw.githubusercontent.com/idachev/claude-code-docker/master/claude-code-docker-run.sh -O claude-code-docker-run.sh && chmod +x claude-code-docker-run.shInvoke-WebRequest -Uri https://raw.githubusercontent.com/idachev/claude-code-docker/master/claude-code-docker-run.ps1 -OutFile claude-code-docker-run.ps1./claude-code-docker-run.shYou can set a custom location for Claude configuration files:
CLAUDE_CODE_HOME=/path/to/custom/dir ./claude-code-docker-run.shBefore running Claude Code in Docker on Windows, ensure that:
-
Virtual Machine Platform is enabled (required for Docker):
# Run as Administrator in PowerShell Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
-
PowerShell execution policy is set appropriately:
# For the current process only Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass # Or for the current user (more permanent) Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
.\claude-code-docker-run.ps1You can set a custom location for Claude configuration files:
$env:CLAUDE_CODE_HOME = "D:\path\to\custom\dir"
.\claude-code-docker-run.ps1When Claude Code completes an auto-update, you can:
- Type
exitonce to exit Claude Code, which will return you to the Docker container's bash shell - Start Claude Code again to use the updated version by running
claudewithin the bash shell - To completely exit the Docker container, type
exita second time in the bash shell
This allows you to restart Claude with the updated version without having to restart the entire Docker container.