← BlogFeature Flags

Stop Using .env for Feature Flags

February 3, 2026·4 min read
Start small. Then scale.

Config changes require deploy. Flags don’t.

The Problem with .env

Many teams use environment variables like:

.env.production
ENABLE_NEW_CHECKOUT=true

This looks like a feature flag — but it's not. It's a configuration value, and the difference matters more than it seems.

Config vs. Feature Flags

Configuration

→ static
→ requires deploy
→ global — same for every user

Feature Flags

→ dynamic
→ no deploy required
→ user-aware — per user or segment
Capability
Env Variables
Feature Flags
Runtime changes
❌
✅
Requires deploy
✅
❌
Per-user targeting
❌
✅
Rollback speed
Slow (redeploy)
Instant
Gradual rollout
❌
✅
Audit log
Limited
Full

Why .env Breaks Down

Using .env for feature control means:

→no instant rollback
→no targeting
→no safe experimentation

Real Scenario

A new feature introduces a bug in production.

With .env

1. update config
2. redeploy
3. wait for pipeline

With feature flags

1. open dashboard
2. disable instantly
3. no pipeline involved

When to Use Config vs. Flags

Use config for

Infrastructure settings — database URLs, timeouts, log levels, rate limits. Values that are the same for every user and only change during a deploy.

Use feature flags for

User-facing behavior, experiments, rollout control — anything that must change instantly or target specific users without a deploy.

FAQ

Can .env be used as feature flags?

Only in very small systems — not at scale. You lose runtime control, targeting, and safe rollback.

Why are feature flags better than env variables?

Because they allow instant changes, per-user targeting, and controlled rollouts without touching your pipeline.

Do feature flags replace configuration?

No — configuration and feature flags solve different problems. Use both.

Better Alternative

Use a feature flag system designed for runtime control. Release Anchor gives you instant flag evaluation, per-user targeting, and gradual rollouts — without changing your deploy pipeline.

Related topics

#feature flags#environment variables#runtime control#deployment safety#release management#instant rollback