This Gist: http://is.gd/dokkudjango
DigitalOcean: https://www.digitalocean.com/
Dokku: https://github.com/progrium/dokku
Dokku-Postgres: https://github.com/Kloadut/dokku-pg-plugin
Add an SSH key to DigitalOcean before hand to make SSHing into you new box easier and more secure.
- Click "Create"
- Enter hostname, select size and region
- Select Ubuntu 13.04 x64 as the Image
- Select your SSH key
- Click "Create Droplet"
- Add a blank A Record pointing to the IP Address of your new Droplet
- Add a wildcard (*) A Record pointing to the same domain to capture all of the subdomains.
- SSH into your Droplet. Just
ssh [email protected]
should work if you add an SSH Key. If not, DigitalOcean emailed you a root password. - Copy and Paste and oneline installer from the Dokku Repo README. Something like this
wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
- Wait 5 minutes.
- Associate an SSH key with a git user as the installer instruct you to. Something like this
cat ~/.ssh/id_rsa.pub | ssh [email protected] "gitreceive upload-key alex"
- Add domain to
VHOST
cd /home/git
echo yourdomain.com >> VHOST
Install the Postres Plugin. From inside your Droplet:
cd /var/lib/dokku/plugins
git clone https://github.com/Kloadut/dokku-pg-plugin
dokku plugins-install
Create a new container which contains Postgres. We are going to deploy our Django app to this container in the future.
dokku postgresql:create myapp
Dokku uses Heroku's BuildPack system for deploying applications. Refer to Heroku's Django Docs to figure out how to prepare your app for deployment. This is mainly concerned with Database connection configuration, WSGI configuration and static file serving.
I made a quick Django base project based on Heroku's documentation. You can get it here
Add a new git remote to your project pointed at your new Postgres container on your Dokku instance then push to it.
git remote add dokku [email protected]:myapp
git push dokku master
OMG! You can now visit your app!
This is the only hacky part of the process.