Every Node.js project starts with a .env file. That is fine. The problem is when the .env approach never evolves — when you still have a single .env.production manually SCP'd to a server at 2 AM before a launch, when a new developer spends three hours figuring out which environment variables are required, when a secret rotates and you realize you have no idea how many places it is set.
Config management is not glamorous but it is the foundation everything else sits on. This guide covers the full system: validated environment variables, environment-specific config, secrets that never touch your codebase, and the patterns that work from a single VPS to a multi-environment deployment.
The Problem With Unmanaged Config
Most teams have at minimum four environments: local development, CI, staging, and production. Each has different values for dozens of variables. Without a system:
Variables that exist in production but not in .env.example cause 3 AM surprises






