A firewalled devbox for Claude Code. The container starts as root, applies an outbound allow-list, and then
runs the workload as node.
The files of this repo land in the project as the .devbox directory. The Dockerfile, the compose
file and the scripts assume that name.
- In the project root, run:
git subtree add --prefix=.devbox git@github.com:codeborne/devbox-template.git main --squashIf you reach GitHub through an SSH alias from~/.ssh/config, put the alias in place ofgit@github.com. - Set
COMPOSE_PROJECT_NAMEin.devbox/.env. - Add the hosts of the project to
.devbox/allowed-domains.conf. - If you want to connect to a server running inside the devbox, add the port to
.devbox/inbound-ports.conf. - If the project needs a JDK other than 25, change
TEMURIN_VERSIONin theDockerfile. - Run
.devbox/restart.shon the host.
--squash keeps the history of this repo out of the project. The project gets one commit with the
template files and one merge commit. The squash commit records the template commit it came from, so a
later git subtree pull merges only what changed since.
All scripts live in .devbox and run on the host.
.devbox/restart.shreadsGH_TOKENfrom 1Password, then rebuilds and starts the container. It needs theopCLI. Claude Code installs its plugin from GitHub with this token..devbox/shell.shopens a shell asnode..devbox/firewall-restart.shapplies the allow-list again without a rebuild..devbox/start-rc.shrunsrestart.sh, then starts Claude Code in the container with Remote Control. Arguments go toclaude remote-control.
Run .devbox/update.sh. It pulls the template with git subtree pull --squash, which merges only
what changed since the last pull and keeps the project's own edits. If the project and the template
changed the same lines, git leaves conflict markers. Resolve them and commit.
With an SSH alias: GITHUB_SSH=github-cb .devbox/update.sh.
The build context is the repository root, so the image can read
package-lock.json. If the lock file pins Playwright, the image installs the
Chromium build of that version. If not, it installs the newest one.
Dockerfile.dockerignore limits the build context to the files the image needs.