I’m working on Windows 11 with WSL Ubuntu and want to run Claude Code without doing a traditional installation. I like to keep my system clean by avoiding direct software installs that might cause conflicts later.
My goal is to:
Set up Claude Code through Docker containers in my WSL environment
Include Node.js and npm in the containerized setup
Access it through VSCode running on Windows using the Claude Code extension
I’ve heard about VSCode Dev Containers which might work for this use case. The idea is to have everything contained so I can easily remove it later without leaving traces on my system.
Has anyone successfully configured Claude Code this way? I’m looking for either a Docker Compose configuration or a Dev Container setup that would let me use Claude Code through VSCode while keeping everything portable and contained.
I asked some AI assistants about this but they said it wasn’t possible. However, I wanted to check with the community since sometimes there are workarounds that aren’t immediately obvious.
Any working examples or configuration files would be really helpful. Thanks in advance!
Look, containers are fine but you’re overcomplicating this. Been there myself.
The real problem isn’t just getting Claude Code in Docker. It’s managing auth, API keys, file syncing, and updates. Plus you’ll hit networking and volume mounting issues that’ll make you want to pull your hair out.
I skip containers entirely and automate the whole dev environment setup/teardown instead. Built a workflow that installs Claude Code, configures Node.js, handles dependencies, and creates isolated project spaces. When I’m done, another script nukes everything and resets the system.
Best part? It handles WSL quirks automatically. File permissions, path mapping, VSCode integration - all sorted without container bloat. Takes 30 seconds to spin up fresh and 15 to completely tear down.
I use this for tons of dev tools now. Way cleaner than Docker configs and more reliable than hoping containers behave with WSL and Windows VSCode.
Yeah, I hit this same issue last year containerizing my dev workflow. The Docker setup isn’t the problem - it’s how Claude Code handles auth and API calls inside containers. I got it working by using the official Node.js image as my base, then installing Claude Code globally in the container. You need to map your auth credentials properly and make sure the container can reach the internet for API calls. Heads up though - some Claude Code features that work with local files can act weird in containers. Just mount your workspace as a volume and set the right working directory, that fixes most problems. If you’re on WSL, it’s actually easier since Docker Desktop handles the file mapping between Windows and Linux containers really well.
Got this working after weeks of fighting the same setup! Here’s what everyone’s missing: you don’t need Claude Code inside the container - just containerize your dev environment. Set up a containerized Node.js workspace that VSCode connects to via Remote-Containers. Install Claude Code on your regular Windows VSCode like normal. The extension talks through the remote connection and works great with containerized code. Just create a basic devcontainer with Node.js, mount your project folder, and let Claude handle API calls from Windows. Skips all the auth nightmares and networking issues while keeping your dependencies isolated. Works perfectly in WSL2 and you get that clean separation you want.
i see where you’re coming from, but have you thought about using a different environment? it could help keep things tidy if any issues come up. just a thought, could save some headaches down the road.
I’ve been running this setup for six months - it works great. Use VSCode’s Remote-Containers extension with a custom devcontainer config. Just create a .devcontainer folder in your project root with a devcontainer.json file for your Node.js environment and Claude Code dependencies. The authentication tokens are the tricky part, but if you mount the right config directories as volumes, the Claude API calls work fine. Performance is better than expected, and cleanup’s perfect; just delete the container when done. I’m happy to share my working devcontainer.json if you want, though you’ll need to tweak the Node version and packages for your setup.
the auth stuff gets everyone, but there’s an easier fix. use docker-compose with env vars for your claude api key and mount your ssh/config folders. I got this working in wsl2 last month - just use the vs code remote containers extension like emma said. don’t overcomplicate the devcontainer.json file.