How to manage environments: development, staging and production
Published on 2026-09-12 by frfrand
What each one is for, what they have to share and what they never should, how to have staging without paying for a second server, and the data error that is always made.

Short answer: development is for writing and breaking, staging is for rehearsing deployment under conditions similar to production, and production is for users. They can share server, versions, and configuration method, but never the database. For most projects, staging fits on the same VPS as production.
"Environment" sounds like jargon and describes something quite simple: a copy of the system running with another configuration and other data, to answer a different question.
What question each one answers
Development answers "does what I'm writing work?". It runs on your machine, restarts in seconds, has logs at maximum, and the data is fake. It's designed to break all the time.
Staging answers "will it work there?". It's the dress rehearsal: configured as similarly as possible to production, with the same versions and the same variables. It's where migrations are tested before they touch real data.
Production answers "are users okay?". It's the only one that really matters.
When someone skips staging, they're not saving a step: they're moving the question "will it work there?" to production, with users inside.
The non-negotiable rule
Databases are separate. Always.
It sounds obvious until the concrete temptation arises: "to test properly I need real data, I'll point staging to the production database for a while." And then a test migration runs on real data, or a cleanup script deletes what it shouldn't.
If you need to test with data similar to real data, the answer is an anonymized copy, not the live database. It takes an afternoon to build the script that generates it, and it pays for itself the first day it prevents a disaster.
What should indeed be the same
This is what makes staging useful, and where it usually fails:
- The same versions. Of language, of database, of dependencies. A staging with a different Postgres version doesn't test anything about migrations.
- The same configuration method. If production reads environment variables, staging does too, with different values.
- The same deployment path. If staging is uploaded manually and production through the automatic pipeline, staging isn't testing the deployment, which is exactly one of the things that breaks most often.
You don't need to pay for two servers
A recurring idea is that having staging implies duplicating infrastructure. For most projects, it doesn't.
It's enough, on the same VPS:
- Two folders, one per branch.
- Two systemd services, with different ports.
- Two domains or subdomains (app.midominio.com and staging.midominio.com).
- Two databases on the same engine.
Each push to the development branch updates staging; each push to the production branch updates the live site.
The only thing they don't share is the database. That's non-negotiable, even here.
The price of saving yourself the second server is that staging and production share CPU and memory: a heavy build or a load test on staging shows up on the live site.
Two precautions that prevent scares
Make it obvious where you are. A colored bar, a prefix in the title, something visible. Editing data thinking you're in staging is a classic mistake, and it's cheap to prevent.
Make it impossible to index or notify. Staging with a robots file that blocks everything, and with email sending turned off or redirected. Sending a real email to a client from a test is an anecdote nobody finds funny.
When two are enough
For a one-person project with few users, development and production may be sufficient. Staging starts to pay off when there's more than one person touching the code, when there are frequent migrations, or when an outage has a real cost.
At ArduMaker, the same repository can be deployed twice on the same VPS, each deployment with its branch, its folder, its domain, and its service (what you can't do is link the same repository with the same branch twice on the same VPS). It's the setup above without assembling it manually; you create the two databases separately.
Separating environments also means separating data
Development, staging, and production should not share the same credentials nor write to a single real database. In ArduMaker you can organize environments and applications on VPS and differentiated projects according to isolation and cost needs.
Try deployments in staging with fictional or anonymized data before publishing changes. A migration that works with ten records may behave differently with millions; prepare an appropriate recovery plan for production.
Related: What is CI/CD · What is an environment variable.
Frequently Asked Questions
Can Staging use the production database "for a little while"? No. It is the most common way for a test migration or a cleanup script to touch real data. If you need similar data, use an anonymized copy.
Do I need a second server to have staging? Usually not: another folder, another service, another subdomain and another database on the same server is enough. In return, they share resources.
When is staging needed? When more than one person is working on the code, there are frequent migrations, or an outage has a real cost. For a personal project with few users, development and production may be enough.