This will install node js and allow you to use claude code in a docker container on unraid use the compose manager plugin.
Use at your own riskThis will give AI access to whatever files you pass to the container (if using filesystem mcp).
services:
claude-code:
image: node:20-alpine
container_name: claude-code-simple
restart: unless-stopped
command: sh -c "apk add --no-cache bash && npm install -g @anthropic-ai/claude-code && tail -f /dev/null"
volumes:
- /mnt/user/appdata:/appdata:rw
- /mnt/user/downloads:/downloads:rw
- /mnt/user/media:/media:rw
- /mnt/user/claude-workspace:/workspace:rw
- /var/run/docker.sock:/var/run/docker.sock:rw
working_dir: /workspace
user: root
environment:
- NODE_ENV=development
- SHELL=/bin/bash
labels:
- "com.unraid.docker.managed=composeman"
- "com.unraid.docker.icon=https://nodejs.org/static/images/logo.svg"
- Go to Docker Compose Manager in Unraid - Create a new stack called "claude-code"
- Paste the compose file above
- Click "Compose Up"
SSH into your server and run:
docker exec -it claude-code-simple sh
echo '#!/bin/bash' > /usr/local/bin/claude-code
echo 'node /usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js "$@"' >> /usr/local/bin/claude-code
chmod +x /usr/local/bin/claude-code
claude-code
Normally you just run claude for claude code, but its aliased claude-code in our wrapper script
If the container gets stopped/restarted:
Access the container:docker exec -it claude-code-simple sh
Create wrapper script(run step 3 above)** Start Claude Code**:claude-code
to add the filesystem mcp server to give claude access to your files, you can run:
claude-code mcp add filesystem -s user -- npx -y @modelcontextprotocol/server-filesystem /appdata /downloads /media
or whatever directories you want it to have access too
- Bash and Claude Code are automatically installed on container startup
- The wrapper script needs to be recreated after each container restart
- All your Unraid directories are accessible within the but for Claude Code to actually access them, you'll need to use the File System MCP.