

Upgrade Dev Database to Managed DatabaseĬlick the dev database you would like to upgrade to a managed database and click the Upgrade to a Managed Database button. You should see this it in the details for your service resource, set to a value such as: you can see, DATABASE_URL is in fact wrapping several environment variables that you can also access individually, such as db.USERNAME, db.PASSWORD, etc. The full connection string for your database is also be available as a runtime environment variable named DATABASE_URL which you can use in your application code. The connection information for your database is provided in the Connection Details section. Go to, click on your app, and click on the Settings tab.Ĭlick on your database to view its details.

When you are ready to proceed, click Create and Attach to confirm your choices. You need to add other sources explicitly to the trusted sources list as described in the Managed Databases documentation. This starts an app redeployment that enables a connection restricted from that app to the database.Įnabling an app as a trusted source blocks any other connections. If trusted source is disabled for your managed database, select the Add app as a trusted source option to add the app as a trusted source.Īlternatively, you can specify an app in the Trusted sources section in the Settings tab of the database in the cloud control panel. Similarly, if your existing managed database has trusted sources enabled, the app is automatically added as a trusted source. This creates a secure connection to the database and it accepts traffic only from the app. Your app is added as a trusted source to the dev database.

You can add a dev database or an existing managed database from your DigitalOcean account.Īll DigitalOcean database clusters support apps as trusted sources. Select your database configuration, choosing from the available engines and plans.

Add a database resource by choosing the Create/Attach Database option. In the Apps section of the DigitalOcean Control Panel, click your app, then click the Create dropdown. H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \Īdd a Database to an App Using the Control Panel To add a database to an app with cURL, call:
