Standing and hacking my way to antifragility. Coffee and beer aficionado.
I can be wrong.
Published

May 2014

←Home

Dokku on Debian: Tips & Tricks

As you might know, Dokku officially supports Ubuntu (14.04 x64 or 12.04 x64). But Ubuntu (at least on server) is just Debian, so there’s no reason, why it should not work, right? Wrong - but I’m gonna show you problems and possible solution, that I’ve used.

Dokku installation

First problem you encounter during execution of bootstrap script. It uses add-apt-repository helper, which is custom Ubuntu command. Workaround is pretty easy, but a little bit messy - you just get your own helper script:

# wget http://blog.anantshri.info/content/uploads/2010/09/add-apt-repository.sh.txt
# cp add-apt-repository.sh.txt /usr/sbin/add-apt-repository
# chmod o+x /usr/sbin/add-apt-repository

Now just execute bootstrap again and all should be fine. Right?

sshcommand

Dokku is using sshcommand to propagate itself through ssh. This is really neat, because during bootstrap dokku user is created to execute commands remotely. There’s only a tiny little problem. This user is passwordless and works only on key basis. Which is cool if you are on Ubuntu, because such user is fully operational. Debian on the other hand just locks it. Without password you are screwed even if you disable password auth through secure shell. Solution? Just add some random password to dokku user (I’ve generated it using pass):

(local) $ pass generate citra/dokku 20
(remote) # usermod -p '<new_password>' dokku
(remote) # passwd -u dokku

acl-add

Adding you public key to dokku control keys is also kinda tricky. Standard command from project README:

$ cat ~/.ssh/id_rsa.pub | ssh progriumapp.com "sudo sshcommand acl-add dokku <alias>"

does not work, because (at least in my case), sudo considered parts of my key my passwords (if you are a badass with passwordless sudo, you are going to be fine). So I just executed it on the server:

# sshcommand acl-add dokku <alias>
(paste key)^D

Deploy

Now you should be able to just deploy and use dokku@your_server shell according to README. I’m considering writing a follow-up about some plugins and how to get them working without Ubuntu underneath. Have you encountered any other issues with Dokku on Debian? Please, share it in comments.

Go Top
comments powered by Disqus