Skip to content

Instantly share code, notes, and snippets.

@dhinus
Created January 12, 2016 17:06
Show Gist options
  • Save dhinus/3f40a4d17b0d0c42a92d to your computer and use it in GitHub Desktop.
Save dhinus/3f40a4d17b0d0c42a92d to your computer and use it in GitHub Desktop.
Installing Dokku on AWS Ubuntu
#!/bin/bash
set -e # Exit on errors
# Docker
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
# Dokku
wget -nv -O - https://packagecloud.io/gpg.key | sudo apt-key add -
echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" | sudo tee /etc/apt/sources.list.d/dokku.list
sudo apt-get update
# sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
# Setting some options for the dokku deb package
echo "dokku dokku/vhost_enable boolean true" | sudo debconf-set-selections
echo "dokku dokku/web_config boolean false" | sudo debconf-set-selections
echo "dokku dokku/hostname string dokku.example.com" | sudo debconf-set-selections
echo "dokku dokku/key_file string /home/ubuntu/.ssh/authorized_keys" | sudo debconf-set-selections
sudo apt-get install -y docker-engine dokku
sudo dokku plugin:install-dependencies --core
sudo reboot
@josegonzalez
Copy link

More or less what we do in our installation notes here for "unattended" installations.

Why did you trigger a reboot?

@dhinus
Copy link
Author

dhinus commented Jan 13, 2016

@josegonzales yeah, that page is where I started from. :) I think the Docker .deb package suggests you to reboot but I will double check if it's really necessary.

@dhinus
Copy link
Author

dhinus commented Jan 13, 2016

A pretty cool thing is that I can run this script from Terraform and I get from zero to a running Dokku with a simple terraform apply. I was thinking of sharing the Terraform config as well, I just need to remove a few hardcoded values that are specific to my Amazon account.

@josegonzalez
Copy link

The deb package is probably detecting that it needs to enable aufs, hence the reboot.

@dhinus
Copy link
Author

dhinus commented Jan 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment