Report this

What is the reason for this report?

Best practices for setting up staging and production environments on App Platform?

Posted on May 26, 2025

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!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
0

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.