Development, staging and production on a single VPS: practical isolation
Published on 2026-11-14 by frfrand
How to separate data, secrets, domains, deployments, and limits without paying for three servers.

Three environments don't have to mean three servers
In small projects it may be reasonable to share a VPS for development, staging, and production. Infrastructure savings come at a price: all share CPU, memory, disk, network, and a single point of failure. Logical separation reduces accidents, but never equals physical isolation.
Define the purpose of each environment
Development supports frequent changes, testing, and dummy data. Staging should resemble the production deployment as much as the budget allows, to verify versions and configuration changes. Production contains real traffic and data: its changes require stricter controls.
Use explicit names, domains, and services: dev.ejemplo.com, staging.ejemplo.com, and ejemplo.com. If dev or staging should not be public, protect them via VPN, authentication, or access lists, and exclude them from indexing; robots.txt is not a security measure.
Separate state before code
Never make staging write to the production database. Use separate databases or instances, dedicated users with minimal permissions, distinct buckets, and specific integration credentials. If you copy production data for testing, anonymize personal information before exposing it in a lower-trust environment.
For each service, create its own configuration file outside Git, execution account, persistent volume, and backup policy. You can use Docker Compose with differentiated projects and networks or systemd services with separate users and directories. The specific option depends on the stack and the team's access level.
Resources: prevent a test from taking down production
The classic mistake is starting a heavy build that consumes all RAM. Define effective CPU and memory limits; control the number of processes, PostgreSQL connections, disk space, log rotation, and worker consumption. Compose limits depend on the deployment mode and implementation: check the supported parameters in your version before assuming they were applied.
Reserve capacity for production spikes. Schedule heavy test tasks outside critical hours or run them on an external runner. Monitor memory usage, swap, storage, and restarts.
Deployments with different permissions
A developer can publish to dev and staging without having full access to production. Configure identities per environment and approval controls for production releases. In GitHub Actions, use separate environments and consider temporary credentials instead of copying an administrator SSH password to all repositories.
Launch checklist
1. Inventory each service and its dependency. 2. Create domain, data, variables, and credentials exclusive per environment. 3. Test an update in staging, including migrations and rollback. 4. Verify that an induced failure in development does not interrupt production.
The existing guide on development, staging, and production environments explains the general concepts. This scheme adds a concrete proposal for budgets that only allow one VPS. You can manage deployment from GitHub and administer the server with ArduMaker tools, verifying beforehand which functions your configuration supports.
Frequently asked questions
### When to separate production into another VPS? When the impact of an outage or a data leak justifies the investment, or when shared resources are insufficient. ### Can I clone the production database? Only after applying appropriate security and anonymization controls. ### Should staging have the same domain as production? No: it should have its own name and restricted access.