.env Example for Node.js and PostgreSQL

A sanitized .env.example template for documenting local development variables without committing real secrets.

.env.example
NODE_ENV=development
APP_URL=http://localhost:3000
PORT=3000
DATABASE_URL=postgres://app:app_local_password@postgres:5432/app
REDIS_URL=redis://redis:6379
API_KEY=replace_me_locally

How to use this example

  1. Commit this as .env.example, not .env.
  2. Generate real secrets in a trusted local environment.
  3. Document required variables in README or deployment notes.

Notes

  • Never commit real credentials.
  • Keep local and production variables clearly separated.

Related tools and fixes

Last updated: May 18, 2026