How to set up a staging environment
Updated 11/29/2026
A staging environment is a copy of production where you test changes before they reach customers. It catches problems before they hurt.
What must be identical
- The same operating system and software versions.
- The same web server and database configuration.
- Representative test data (no real sensitive data).
1. A separate server
Cleanest is a dedicated VPS for staging. With hourly billing, you can start a staging server only while you test and delete it after, paying very little.
2. A separate subdomain
staging.example.com A STAGING_SERVER_IP
3. Protect it
Staging should not be indexed by Google or publicly accessible. Add basic authentication and a robots.txt that blocks indexing.
4. Copy data from production
Periodically bring a copy of the database, see migrating a database, but anonymize sensitive customer data.
The full flow
You develop locally, deploy to staging, test, then deploy to production, ideally through a CI/CD pipeline.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
Error tracking for your applications with GlitchTip
Catch production exceptions with the Sentry SDKs on a small server: the project, the DSN, alerts and uptime.
Updated 11/29/2026Dev environmentsTest your application's email with smtp4dev
Send the email from Laravel, WordPress, Node or Python to a test SMTP server and read it in a web inbox, without it ever reaching real customers.
Updated 11/29/2026Dev environmentsHow to build a CI/CD pipeline
Automate testing and deploying your code on every change, with a CI/CD pipeline on your server.
Updated 11/29/2026