This was expanded from Running Slack Bots on DigitalOcean with Dokku.
Let’s run MongoDB inside Dokku on DigitalOcean.
Install the Plugin
Create a MongoDB Instance
This starts a MongoDB instance which is not accessible from the outside world. Replace
database-name with your own.
Link the Instance to an App
Logically connect the MongoDB instance with an app and publish a
MONGO_URL configuration setting to it. Replace
app-name with your own.
In the future you might want to upgrade both the plugin and the MongoDB instance itself.
Upgrade the Plugin
Upgrade the Database
This was discussed in dokku-mongo#74.
For a minor upgrade in which the database version doesn’t require any intervention (eg. 3.2.9 to 3.4.9) you can do the following.
See Backing up MongoDB Databases in Dokku Containers to Dropbox.