Skip to main content
paulund

3 min read

#project-docs#devops#deployments

Environments

Every project runs in more than one place. Documenting your environments removes ambiguity, reduces the chance of deploying to the wrong target, and makes onboarding significantly faster.


Standard Environments

Most projects use some combination of the following:

EnvironmentPurpose
LocalIndividual developer machines. Each developer runs their own instance.
DevelopmentA shared environment for integration testing after code is merged. Sometimes called "dev".
StagingA production-like environment used for final verification before release. Traffic is not real.
ProductionThe live environment that serves real users.

Some teams also maintain a testing or QA environment that sits between development and staging. Add or remove rows to suit your project.


What to Capture for Each Environment

For every environment, document the following:

  • URL -- The base URL that developers and testers use to access the environment.
  • Credentials -- Do not store passwords or secrets in plain text in this file. Note where credentials are stored (for example, "in the team's shared password manager under the key staging-db") and how to request access.
  • Configuration differences -- Anything that differs from production: debug flags, third-party API keys pointing to sandbox accounts, feature flags, log verbosity, and so on.
  • Deployment method -- How code gets deployed to this environment (manual push, CI/CD pipeline, tagged release, and so on).
  • Owner / contact -- Who is responsible for keeping this environment healthy.

Template

Copy the sections below into your project documentation. Replace the placeholder text with real values.


Local

ItemValue
URLhttp://localhost:8000 (or as configured)
DatabaseSQLite file at database/database.sqlite (or as configured)
SetupSee README.md for initial setup instructions.
NotesEach developer runs their own independent instance.

Development

ItemValue
URL[Replace with dev environment URL]
CredentialsStored in [replace with location, e.g. shared password manager].
Deployed via[Replace: e.g. "GitHub Actions on push to develop"]
Config differences[Replace: e.g. "Debug mode enabled. Stripe sandbox keys in use."]
Owner[Replace with name or team]

Staging

ItemValue
URL[Replace with staging URL]
CredentialsStored in [replace with location].
Deployed via[Replace: e.g. "GitHub Actions on push to release/* branches"]
Config differences[Replace: e.g. "Production-like config. Uses sandbox payment gateway."]
Owner[Replace with name or team]

Production

ItemValue
URL[Replace with production URL]
CredentialsStored in [replace with location].
Deployed via[Replace: e.g. "GitHub Actions on tagged release"]
Config differencesNone -- this is the reference environment.
Owner[Replace with name or team]

Tips

  • Review this document every time you add or change an environment. Stale environment documentation causes as many problems as no documentation at all.
  • Never commit secrets. Use environment variables, a secrets manager, or a .env file that is listed in .gitignore.
  • Include a health-check URL for each shared environment so that monitoring can confirm it is up.

Related notes

  • A/B Testing Deployments

    How A/B testing deployments work by routing a percentage of traffic to a new version and comparing p...

  • Blue/Green Deployment

    How blue/green deployments work by maintaining two identical production environments to achieve zero...

  • Canary Deployment

    How canary deployments work by rolling out a new version to a small percentage of users before a ful...


Newsletter

A weekly newsletter on React, Next.js, AI-assisted development, and engineering. No spam, unsubscribe any time.