I’m currently using DigitalOcean App Platform to deploy a web app and would like to set up both staging and production environments.
I’m wondering what the recommended approach is for managing multiple environments. Should I use separate apps? Separate branches with auto-deploy rules? How do you handle secrets, environment variables, and database connections for each environment?
Would love to hear how others are structuring this
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Hey!
A common approach is to create two separate App Platform apps, one for staging and one for production. This gives you clean isolation and lets you manage environment variables and databases independently.
You can connect each app to a different branch (e.g., main
for prod, develop
or staging
for staging) and enable auto-deploy per branch.
For secrets and configs, define separate environment variables for each app in the dashboard.
If you’re using Managed Databases, you can spin up two instances or one with separate databases for each environment.
Hope that this helps!
- Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.