Note: this is still incomplete.
- Minimal understanding of what Dokku, DigitalOcean and Ubuntu ara
- Already has DigitalOcean account
- Knows basics of SSH
Creating DigitalOcean Droplet
- Sign into DigitalOcean and click on the button, “CREATE” on the left sidebar.
- Insert a good Droplet Hostname and select the size of the droplet that suits
- Select the region. I’m choosing the default one, which is NY3.
- In “Select Image” section, click on “Linux Distributions” tab.
- Click on Ubuntu and select 14.10 x64.
- We will create and add a new SSH key manually. DO NOT select any SSH key
displayed under “Add SSH Keys” section.
- Click on “Create Droplet”
Logging into the new server for the first time
- You should have received an email that contains your host IP address,
username and the password. Keep the password as secret! Username is
- Log into the host server using the username.
$ ssh firstname.lastname@example.org
18.104.22.168 with your host ip address.
yes to the question
Are you sure you want to continue connecting (yes/no)? and press Enter.
- Copy and paste the root password that was emailed to you.
- The server will prompt you to update your password. Follow the instructions
given to you and update the password.
Creating public key on your local machine
- On your local computer’s terminal, run
$ cd ~/.ssh
$ ssh-keygen -t rsa -C "email@example.com"
- To the question,
Enter file in which to save the key (/Users/you/.ssh/id_rsa): , type in the host name of the DigitalOcean droplet you just create. Just
good practise to have the same name.
- Enter the password for the pubkey you just created. This doesn’t have to
be the same as the root password you changed earlier.
$ cat key-you-created.pub to check that pubkey was created successfully.
- Copy the result of
$ cat key-you-created.pub in the local machine.
Adding the new SSH Key in DigitalOcean
- Log into DigitalOcean
- Click on “SSH Keys” on the left hand side.
- Click on “Add SSH Keys” on the top right hand side.
- Paste the pubkey content in the form and submit it.
Configuring your local machine to use this specific new pubkey
when connecting to the server
- In the local machine, run
$ vi ~/.ssh/config
- Add the following lines.
- Replace all the data in
Authenticating yourself against the server
- In the server console run
$ cd ~/.ssh
- Again, in the server, run
$ echo "ssh-rsa [paste the content of key-you-created.pub]" >> authorized_keys.
$ cat authorized_keys and check that your local machine’s pubkey is
in the list of authorized_keys in the server.
Phew, take a breather
If everything went right, you should be able to do,
$ ssh root@some-host-name-nickname.
- I am largely following the official installation doc for Dokku.
- On the server, run
$ wget -qO- https://raw.github.com/progrium/dokku/v0.3.7/bootstrap.sh | sudo DOKKU_TAG=v0.3.7 bash
$ cat ~/.ssh/supurl-production.pub | ssh firstname.lastname@example.org "sudo sshcommand acl-add dokku $USER"
$ git remote add dokku dokku@supurl-production:supurl-production
Troubleshooting various errors
Build pack error.
$ dokku postgresql:create supurl-production
dokku run APP_NAME rake db:seed