Configure Production Environment Variables

Production applications should use environment-specific configuration.

Do not hardcode ports, credentials, database URLs, or authentication secrets in source files.

Example production configuration:

NODE_ENV=production
PORT=3000
REDIS_URL=redis://username:password@redis-host:6379
JWT_SECRET=replace-with-a-secure-secret

This is an illustrative configuration. Use your hosting platform's secret manager or environment-variable management system for actual production credentials.

For production Redis, prefer TLS-enabled connection URLs when supported by your provider.

Keep local development and production configuration separate.

Production Configuration

NODE_ENV

production

PORT

Hosting platform port

REDIS_URL

Private Redis connection

JWT_SECRET

Secure server-side secret

Never Commit Production Secrets

Production credentials must be managed using secure environment configuration or a secret manager. Do not put real credentials into source code, example files, or public repositories.

Key Takeaways
  • Separate development and production configuration.

  • Store credentials securely.

  • Use private infrastructure for Redis.