All documentation

Staging Environment

Configure a staging environment that mirrors production for pre-launch validation.

Staging exists to rehearse migrations and upgrades against realistic data. Start from backend/.env.staging.example, which mirrors production with safer defaults.

What must differ from production

  • Its own database and Redis instance — never point staging at production data stores.
  • Its own domains, and matching SANCTUM_STATEFUL_DOMAINS and CORS_ALLOWED_ORIGINS.
  • Payment gateways in sandbox or test mode.
  • Mail captured rather than delivered, so test runs cannot email real clients.
  • Its own license. A license is bound to a domain and installation, so production's will not validate on staging.
NoteIf you restore a production dump into staging, clear or redirect outbound mail and switch gateways to test mode before starting the queue worker. Otherwise scheduled billing will email real customers from staging.
Staging Environment | Hostinvo