sudo apt-get update && sudo apt-get install build-essential libssl-dev
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.4/install.sh | bash
You will likely get an error during install. Don't worry, it took but you need to change your bashrc file slightly. Add the following line to the bottom of /home/dokku/.bashrc:
source ~/.nvm/nvm.sh