This is how NextJS loads environment files. process.env .env.$(NODE_ENV).local .env.local (Not checked when NODE_ENV is test.) .env.$(NODE_ENV) .env