{"post":{"slug":"how-to-set-up-a-dev-environment-2026","title":"How to set up a dev environment in 2026: tools, containers, and reproducibility","excerpt":"A dev environment that differs from production is a bug factory. This guide covers reproducible local setups with containers, dotfiles, and modern tooling.","category":"code","date":"April 17, 2026","author":"ByteLedger Team","content":"<span class=\"dropcap\">A</span> dev environment set up carelessly causes weeks of lost time — subtle version differences between machines, dependencies that install differently on macOS and Linux, \"it broke on CI but works here\" investigations that consume entire afternoons. The investment in a reproducible, code-defined setup pays back every time someone new joins the team or a machine needs rebuilding.\n\n## What changed in 2026\n\n- **`mise` (formerly rtx) replaced asdf** as the preferred polyglot version manager — faster, written in Rust, reads `.tool-versions` and `.mise.toml` files.\n- **Devcontainers are mainstream** — VS Code, Cursor, JetBrains Rider, and GitHub Codespaces all support the devcontainer spec natively.\n- **Nix + `nix develop`** is the choice for teams that need hermetic, byte-identical environments, especially those doing reproducible builds.\n- **Docker Desktop 5.x** ships with Compose v2 built in (`docker compose` not `docker-compose`).\n- **AI coding assistants** work best in well-structured environments; a working LSP, formatter, and test runner pay off more than ever in 2026.\n\n## Step 1 — runtime version management with mise\n\n```bash\n# Install mise\ncurl https://mise.run | sh\n\n# .tool-versions (in project root — checked into git)\nnode 22.4.0\npython 3.12.4\ngo 1.23.0\n\n# Install all versions declared in .tool-versions\nmise install\n\n# Verify\nnode --version  # 22.4.0\npython --version  # 3.12.4\n```\n\n`mise` activates the correct versions automatically when you `cd` into the project directory. No more `nvm use` before every command.\n\n## Step 2 — services via Docker Compose\n\n```yaml\n# docker-compose.yml\nservices:\n  postgres:\n    image: postgres:17-alpine\n    environment:\n      POSTGRES_USER: dev\n      POSTGRES_PASSWORD: dev\n      POSTGRES_DB: myapp_dev\n    ports:\n      - \"5432:5432\"\n    volumes:\n      - postgres_data:/var/lib/postgresql/data\n\n  redis:\n    image: redis:7-alpine\n    ports:\n      - \"6379:6379\"\n\nvolumes:\n  postgres_data:\n```\n\n```bash\ndocker compose up -d       # start services\ndocker compose down -v     # stop and remove volumes\ndocker compose logs -f     # follow logs\n```\n\nRun the language runtime on the host (via mise), run dependencies in containers. This gives you fast native code execution and clean service isolation.\n\n## Step 3 — environment variables\n\n```bash\n# .env.example — COMMIT THIS to git\nDATABASE_URL=postgres://dev:dev@localhost:5432/myapp_dev\nREDIS_URL=redis://localhost:6379\nAPI_KEY=your_key_here\nLOG_LEVEL=debug\n\n# .env — DO NOT COMMIT (add to .gitignore)\n# Copy from .env.example and fill in real values\ncp .env.example .env\n```\n\nUse `dotenv-cli`, `direnv`, or your framework's built-in `.env` loading. `direnv` auto-exports variables when you enter the directory:\n\n```bash\n# .envrc\ndotenv .env\n```\n\n## Step 4 — devcontainer for full reproducibility\n\n```json\n// .devcontainer/devcontainer.json\n{\n  \"name\": \"My App\",\n  \"image\": \"mcr.microsoft.com/devcontainers/javascript-node:22\",\n  \"features\": {\n    \"ghcr.io/devcontainers/features/docker-in-docker:2\": {}\n  },\n  \"forwardPorts\": [3000, 5432, 6379],\n  \"postCreateCommand\": \"npm ci\",\n  \"customizations\": {\n    \"vscode\": {\n      \"extensions\": [\"esbenp.prettier-vscode\", \"dbaeumer.vscode-eslint\"]\n    }\n  }\n}\n```\n\nGitHub Codespaces picks this up automatically. New team members are one button click from a working environment.\n\n## Comparison of environment approaches\n\n| Approach | Reproducibility | Complexity | Best for |\n| --- | --- | --- | --- |\n| System packages + mise | Medium | Low | Small teams, personal projects |\n| Docker Compose + mise | High | Low-medium | Most production teams |\n| Devcontainer | Very high | Medium | Teams with diverse OS/machines |\n| Nix + `nix develop` | Near-perfect | High | Reproducible builds, infra teams |\n| Remote dev (Codespaces) | Very high | Low (hosted) | Onboarding, ephemeral work |\n\n## VS Code / Cursor extensions to install\n\n| Extension | Purpose |\n| --- | --- |\n| `esbenp.prettier-vscode` | Auto-format on save |\n| `dbaeumer.vscode-eslint` | Inline lint errors |\n| `ms-python.python` | Python LSP, debugger |\n| `golang.go` | Go LSP, test runner |\n| `mtxr.sqltools` | Database query UI |\n| `ms-azuretools.vscode-docker` | Docker Compose UI |\n\nStore these in `.vscode/extensions.json` so VS Code recommends them to teammates.\n\n## How to pick\n\n1. **Solo project or prototype** → mise + `.env` + `docker compose` for services. Done in 30 minutes.\n2. **Team of 3–10 with mixed OS** → Add a devcontainer spec. Eliminates cross-platform issues.\n3. **Monorepo with many services** → Nix or devcontainer per service, orchestrated with Tilt or Skaffold.\n4. **Regulated environment, auditable builds** → Nix with flakes for byte-identical reproducibility.\n\n## Common mistakes\n\n**`node_modules` on a Docker volume mount.** Bind-mounting source code into a container while the container also installs `node_modules` inside it leads to platform-mismatched binaries. Either build a proper image or develop on the host.\n\n**No `.env.example`.** New engineers spend hours figuring out required variables. The template takes 5 minutes to write and saves hours across the team's lifetime.\n\n**Installing runtime versions globally with Homebrew.** `brew install node` gives you one version system-wide. When project A needs Node 20 and project B needs Node 22, things break.\n\n**Not committing editor config.** `.editorconfig`, `.vscode/settings.json`, and `.vscode/extensions.json` should be in git — they ensure consistent formatting before the linter even runs.\n\n**Long onboarding docs instead of automated setup.** If setup requires reading a 20-step document, replace it with a `make bootstrap` or `./scripts/setup.sh` that runs those steps.\n\n## What to skip\n\n- **Vagrant** for new projects — heavy, slow to boot, largely replaced by devcontainers and Colima.\n- **Installing Postgres directly on macOS with Homebrew** for team projects — Docker Compose ensures everyone runs the same version.\n- **A different `.env` per person with no `.env.example`** — environment sprawl and missing variable bugs follow.\n\n## FAQ\n\n**What is the difference between mise and nvm/pyenv/rbenv?**\nThose are runtime-specific managers. `mise` replaces all of them with one tool and one config file (`.tool-versions`). It is faster and polyglot.\n\n**Should I run my app inside Docker or on the host?**\nFor development, running the app on the host (via mise) gives faster iteration — no rebuild cycle. Run services (DB, cache, queues) in Docker. Run the full stack in Docker only for integration/E2E testing.\n\n**How do I share environment variables across the team securely?**\nUse a secrets manager (1Password Secrets Automation, Doppler, or AWS Secrets Manager) and never put real secrets in git. The `.env.example` is the template; real values come from the secrets manager.\n\n**What about Windows developers?**\nWSL2 (Windows Subsystem for Linux) with a devcontainer is the recommended path — the container runs on Linux inside WSL2, giving full parity with macOS/Linux setups.\n\n## Where to go next\n\n- [How to set up pre-commit hooks in 2026](/blog/how-to-set-up-pre-commit-hooks-2026)\n- [How to containerize an app in 2026](/blog/how-to-containerize-an-app-2026)\n- [How to write a GitHub Action in 2026](/blog/how-to-write-a-github-action-2026)","hue":316,"metaTitle":"How to Set Up a Dev Environment in 2026: Reproducible Setup","metaDescription":"Set up a dev environment in 2026 — mise for runtimes, Docker Compose for services, devcontainers, dotfiles, and reproducible tooling across teams.","keywords":["how to set up a dev environment 2026","developer environment setup 2026","mise rtx version manager","devcontainer setup","docker compose local development","reproducible dev environment","dotfiles setup 2026","local development best practices","nix development environment","dev environment as code"],"tldr":["**Use a version manager for runtimes** — `mise` (formerly rtx) manages Node, Python, Go, and more from a single `.tool-versions` file.","**Run dependencies in Docker Compose** — Postgres, Redis, and message brokers should never be installed directly on the host.","**Check your `.env.example` into git** — the template of required variables is part of the project; the actual values are not.","**Use devcontainers or Nix for fully reproducible environments** — eliminates \"works on my machine\" across the whole team.","**Skip:** installing language runtimes with system package managers (`apt install nodejs`) — they lag behind and cannot be version-pinned per project."],"readTime":"5 min read","wordCount":1046},"related":[{"slug":"how-to-set-up-postgres-locally-2026","title":"How to set up Postgres locally in 2026: Docker, pgvector, and dev workflow","excerpt":"Running Postgres locally in 2026 means Docker Compose, pgvector for AI workloads, and a repeatable seed script. This guide gets you from zero to a productive dev database.","category":"code","date":"March 16, 2026","author":"ByteLedger Team","readTime":"4 min read","hue":322},{"slug":"best-security-tools-for-homelabs-2026","title":"Best security tools for self-hosted homelabs in 2026","excerpt":"Self-hosting is having a moment in 2026 — but most homelab tutorials skip the security parts that actually matter. Here are the tools that turn a weekend Docker stack into something you can sleep through the night with.","category":"code","date":"January 29, 2026","author":"ByteLedger Team","readTime":"4 min read","hue":315},{"slug":"best-vs-code-extensions-2026","title":"Best VS Code Extensions in 2026: Install These First","excerpt":"The best VS Code extensions in 2026 are a small, fast core, not a bloated pile. Here is the lean set worth installing and the categories safe to skip.","category":"code","date":"June 12, 2026","author":"ByteLedger Team","readTime":"3 min read","hue":212}],"sameCategory":[{"slug":"bazel-build-explained-2026","title":"Bazel Explained: What Hermetic Builds Actually Cost","excerpt":"Bazel delivers reproducible, precisely cached builds and demands that you describe everything. Here is what you get, what it costs, and who should say no.","category":"code","date":"August 19, 2026","author":"ByteLedger Team","readTime":"3 min read","hue":145},{"slug":"graphql-federation-2026","title":"GraphQL Federation: One Graph, Many Teams","excerpt":"Federation composes independently-owned subgraphs into a single API. Here is what it solves, the operational cost it adds, and when a simpler gateway is enough.","category":"code","date":"August 19, 2026","author":"ByteLedger Team","readTime":"3 min read","hue":300},{"slug":"hermetic-builds-explained-2026","title":"Hermetic Builds Explained: Same Inputs, Same Output","excerpt":"A hermetic build depends only on declared inputs. Here is what that property gives you, the common leaks that break it, and how to move toward it incrementally.","category":"code","date":"August 19, 2026","author":"ByteLedger Team","readTime":"3 min read","hue":130},{"slug":"monorepo-tooling-compared-2026","title":"Monorepo Tooling Compared: What You Actually Need","excerpt":"Monorepo tools solve task orchestration and caching, not repository layout. Here is what each tier provides and how to tell when you have outgrown the simple option.","category":"code","date":"August 19, 2026","author":"ByteLedger Team","readTime":"3 min read","hue":150}],"newer":{"slug":"how-to-set-up-a-bond-ladder-2026","title":"How to set up a bond ladder in 2026: a practical step-by-step guide","excerpt":"A bond ladder turns fixed-income investing into predictable cash flow without locking up all your money at once. Here is how to build one in 2026.","category":"finance","date":"April 17, 2026","author":"ByteLedger Team","readTime":"5 min read","hue":300},"older":{"slug":"how-to-set-up-a-guest-network-2026","title":"How to set up a guest network in 2026: isolate visitors from your main devices","excerpt":"A guest network keeps visitors on the internet without exposing your smart home, NAS, or work devices. Here is how to set one up correctly on any modern router in 2026.","category":"tech","date":"April 17, 2026","author":"ByteLedger Team","readTime":"6 min read","hue":234}}