Digital Ocean offers a pre-installed Dokku image. You can run this image on any sized droplet, although larger droplets will allow you to run larger applications.
When choosing your Droplet configuration please disable IPv6. There are known issues with IPv6 on Digital Ocean and Docker, and many have been reported to the Dokku issue tracker. If you would like to run Dokku on an IPv6 Digital Ocean Droplet, please consult this guide.
-
Login to your Digital Ocean account
-
Click Create a Droplet
-
Under Choose an image > One-click apps and choose Dokku 0.6.5 on 14.04 (version numbers may vary)
-
Under Choose a size and select your a machine spec
-
Under Choose a datacenter region select your region
-
Under Add your SSH keys click New SSH Key (this opens a dialog)
-
From your terminal, execute
cat ~/.ssh/id_rsa.pub
-
Copy the output and paste it into the New SSH Key dialog, provide a name and click Add SSH Key
-
Under Finalize and create, give your droplet a hostname (not required) and click Create
-
Once created, copy the IP address to your clipboard
-
From your terminal, verify you can connect by executing
ssh root@ip-address
- then disconnect usingexit
-
From your terminal execute
cat ~/.ssh/id_rsa.pub
to get your public key and copy it's output to your clipboard -
Open a text editor and build the following line:
echo "paste ssh key from clipboard" | sshcommand acl-add dokku user
(removing line breaks) -
From terminal execute
ssh root@ip-address
to reconnect to your server -
From your server, execute
echo "your ssh key without line breaks should be in here" | sshcommand acl-add dokku user
-
Then execute
exit
to disconnect from your server -
Now try to connect as the dokku user
ssh dokku@ip-address
(this should return dokku help and disconnect) -
Now, go into your git project and add git remote host
git remote add dokku dokku@ip-of-host:appname
-
You should now be able to execute
git push dokku master
-
From terminal execute
ssh root@ip-address
to reconnect to your server -
Then execute
sudo dokku plugin:install https://github.com/dokku/dokku-mongo.git mongo
-
Then execute
dokku mongo:create databaseName
-
Copy dns value, this is your connection string
-
Then execute
dokku mongo:link databaseName appName
-
Execute
exit
to terminate your SSH session. -
Modify your application to use the new connection string obtained from dns
-
Execute
git push dokku master
to deploy your changes.
Should you have any issues, please visit the freenode chat