How-To Guides
Multi-Environment Deployment

Multiple Environment Deployment on Same Server

Deploy development, staging, and production environments on a single server.


Why Multiple Environments?

  • ✅ Test changes safely before going live
  • ✅ Show clients work-in-progress on staging
  • ✅ Keep costs low by sharing one server
  • ✅ Maintain separate configs per environment

How It Works

OEC.sh runs each environment in isolated Docker containers on the same server. Each gets its own:

  • Database (PostgreSQL container)
  • Odoo application container
  • Subdomain (e.g., project-dev.apps.oec.sh, project-staging.apps.oec.sh)

They share the server's CPU, RAM, and disk — you control how much each environment gets.


Step 1: Set Up Your Project

If you haven't already, create a project with your Git repository.


Step 2: Create Multiple Environments

  1. Open your project
  2. Go to Environments tab
  3. Click Add Environment for each:
EnvironmentTypeSuggested Resources
DevelopmentDevelopment1 CPU, 2 GB RAM, 10 GB disk
StagingStaging2 CPU, 4 GB RAM, 20 GB disk
ProductionProduction2-4 CPU, 4-8 GB RAM, 30+ GB disk
  1. Select the same server for all environments
  2. Deploy each environment

Step 3: Configure Per Environment

Each environment can have different:

  • Git branchdev, staging, main
  • Odoo config — debug mode, workers, log level
  • Custom domain — staging.yoursite.com, app.yoursite.com
  • Addons — test modules on dev without affecting production

Resource Planning

For a single server, plan your total resources:

Server SizeRecommended Environments
4 CPU / 8 GB2-3 environments
8 CPU / 16 GB4-6 environments
16 CPU / 32 GB8-10 environments

Tip: Development environments can share resources more aggressively since they're not always active.


Best Practices

  1. Use branches — Map each environment to a Git branch (dev → development, staging → staging, main → production)
  2. Clone for fresh data — Periodically clone production to staging for realistic testing
  3. Set up backups — At minimum, back up production daily
  4. Monitor resources — Check server monitoring to ensure environments aren't competing for resources
  5. Clean up — Delete temporary environments when done to free resources

Next Steps