# Claude Code on Unraid.md

> Source: <https://gist.github.com/bluesky509/76885e12629826ef523f547086529bd9>
> Published: 2026-07-13 22:27:23+00:00

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
    
    # Keep container running and install Claude Code on startup
    command: sh -c "apk add --no-cache bash && npm install -g @anthropic-ai/claude-code && tail -f /dev/null"
    
    # Volume mappings for Unraid access
    volumes:
      # Core Unraid directories - put whatever you want here
      - /mnt/user/appdata:/appdata:rw
      - /mnt/user/downloads:/downloads:rw
      - /mnt/user/media:/media:rw
      
      # Workspace for your projects
      - /mnt/user/claude-workspace:/workspace:rw
      
      # Docker socket access
      - /var/run/docker.sock:/var/run/docker.sock:rw
    
    # Working directory
    working_dir: /workspace
    
    # Run as root to avoid permission issues
    user: root
    
    # Environment
    environment:
      - NODE_ENV=development
      - SHELL=/bin/bash
    
    # Labels
    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.
