Skip to content
100% local

devcontainer.json generator

Build a devcontainer.json for VS Code Dev Containers, with an optional Dockerfile.

Output

devcontainer.json generator

Pick a language and this tool builds a ready-to-use devcontainer.json for VS Code's Dev Containers extension (and GitHub Codespaces, which reads the same file). Choose Node.js, Python, Go, PHP, Java or a plain Ubuntu base image, set the version, and the generator fills in the matching Microsoft devcontainers image, a sensible default container user and a default port to forward.

The options map straight onto the fields a real devcontainer.json needs. Toggle the Git and Docker-in-Docker features, or add Node.js to a non-Node container, and they land in the "features" object with the right ghcr.io reference. List forwarded ports, a postCreateCommand and a postStartCommand to run setup steps automatically when the container starts. VS Code extensions and settings go under "customizations.vscode", one extension id or one key=value setting per line. Turning on "Mount a cache volume" adds a named volume for the language's dependency cache — node_modules, pip's cache, Go's module cache — so a rebuild doesn't start from zero. Turning on "Also generate a Dockerfile" swaps the "image" field for a "build" reference and produces a matching Dockerfile alongside it.

Invalid entries are dropped rather than breaking the file: a malformed port, an extension id that isn't in the publisher.name shape, or a settings line with no "=" is simply skipped, and the version field strips anything that isn't a letter, digit, dot or dash before it reaches the image tag. The result is always valid, parseable JSON, and the live tally below the output shows how many files, features and characters were generated as you adjust the options.

Everything runs locally in your browser — no project details, extension list or environment setup ever leaves your machine. Copy the result, download it as a .txt file to paste into .devcontainer/devcontainer.json (and Dockerfile, if you generated one), or send it to another tool's input to keep working on it.

FAQ

Where does this file go in my project?
Save it as .devcontainer/devcontainer.json. If you generated a Dockerfile too, save it as .devcontainer/Dockerfile in the same folder.
What are "features" in a devcontainer.json?
Features are small, reusable pieces of setup — installing Git, enabling Docker-in-Docker, adding a language runtime — that are added to the base image without you writing a Dockerfile.
What happens if I leave the version field empty?
The generator uses that language's current default image tag, so the file is always valid without you having to look one up.
Why did my extension ID or port disappear from the output?
An entry that doesn't match the expected shape — an extension id without a publisher.name format, or a port outside 1–65535 — is dropped so the generated file always stays valid.
Is my project configuration uploaded anywhere?
No. The devcontainer.json (and Dockerfile) are generated entirely in your browser from the options you choose — nothing is sent to a server.