PostgreSQL plugin for Dokku
Pull request Compare This branch is 63 commits ahead, 55 commits behind Kloadut:master.
Latest commit 3336263 Mar 20, 2015 @jlachowski use config:set
Failed to load latest commit information. new option added Mar 19, 2015
commands use config:set Mar 20, 2015
defaults Create defaults Mar 19, 2015
install new persistent folder and linking Jan 24, 2014
post-delete set options update Mar 20, 2015
pre-build set options update Mar 20, 2015
pre-deploy set options update Mar 20, 2015
pre-release set options update Mar 20, 2015

PostgreSQL plugin for Dokku


Warning: This plugin is under development and still only tested with the below dependencies



cd /var/lib/dokku/plugins
git clone postgresql
dokku plugins-install


$ dokku help
    postgresql:enable <app>           Enable PostgreSQL for an <app> on next build / deploy
    postgresql:create <app>           Create a PostgreSQL container for <app>
    postgresql:clone <app> <trg>      Clone PostgreSQL container of <app> for <trg>
    postgresql:rebuild <app>          Rebuil PostgreSQL container of <app> (keep persistend data)
    postgresql:destroy <app>       Delete specified PostgreSQL container for <app>
    postgresql:info <app>             Display <app> PostgreSQL container informations
    postgresql:link <app> <pgsql>     Link an app to a PostgreSQL container
    postgresql:list                   Display list of PostgreSQL containers
    postgresql:logs <app>             Display last logs from <app> PostgreSQL container

Simple usage

Create a new DB:

$ dokku postgresql:create foo            # Server side
$ ssh dokku@server postgresql:create foo # Client side

Deploy your app with the same name (client side):

$ git remote add dokku git@server:foo
$ git push dokku master

Link your app to the database

dokku postgresql:link app_name database_name

Advanced usage

Inititalize the database with SQL statements:

cat init.sql | dokku postgresql:create foo

Deleting databases:

dokku postgresql:delete foo

Clone databases (foo to bar):

dokku postgresql:clone foo bar

Rebuilding container (preserves database):

dokku postgresql:rebuild foo

Linking an app to a specific database:

dokku postgresql:link foo bar

PostgreSQL logs (per database):

dokku postgresql:logs foo

Database informations:

dokku postgresql:info foo

List of containers:

dokku postgresql:list