Step by step how to install Deis on AWS

Deis (pronounced DAY-iss) is an open source PaaS that makes it easy to deploy and manage applications on your own servers. Deis builds upon Docker and CoreOS to provide a lightweight PaaS with a Heroku-inspired workflow.

I struggled installing Deis and it took me several times to get it right. Deis’s documentation is correct but not very straight forward so I decided to write this to help others that struggle like me. This steps works for me as of version 1.12.2

Preparation

  • Install deisctl. This is needed for provision script.
$ cd ~/bin
$ curl -sSL http://deis.io/deisctl/install.sh | sh -s <latest-version-here>
$ # on CoreOS, add "sudo" to install to /opt/bin/deisctl
$ curl -sSL http://deis.io/deisctl/install.sh | sudo sh -s <latest-version-here>
  • Install AWS Command line interface and configure it
$ pip install awscli
$ pip install pyyaml
$ aws configure
AWS Access Key ID [None]: ***************
AWS Secret Access Key [None]: ************************
Default region name [None]: us-west-1
Default output format [None]:
  • Generate and upload keys to AWS. Also add it to ssh-agent so that it can use during provisioning the cluster.
$ ssh-keygen -q -t rsa -f ~/.ssh/deis -N '' -C deis
$ aws ec2 import-key-pair --key-name deis --public-key-material file://~/.ssh/deis.pub
$ eval `ssh-agent -s`
$ ssh-add ~/.ssh/deis
  • If you want to use more than 3 instances (default), just export DEIS_NUM_INSTANCES
$ export DEIS_NUM_INSTANCES=5

Provision the cluster

  • Clone the repo, git checkout the latest tag. At repo root, run this command below to create discovery url. Forget to do this will result in etcd not configured properly.
$ make discovery-url
  • Next, go to folder contrib/aws/ in deis repo, create a file name cloudformation.json in order to override default values. You can take a look at the template file deis.template.json.

  • Run the provision script

$ cd contrib/aws
$ ./provision-aws-cluster.sh
Creating CloudFormation stack deis
{
    "StackId": "arn:aws:cloudformation:us-east-1:69326027886:stack/deis/1e9916b0-d7ea-11e4-a0be-50d2020578e0"
}
Waiting for instances to be created...
Waiting for instances to be created... CREATE_IN_PROGRESS
Waiting for instances to pass initial health checks...
Waiting for instances to pass initial health checks...
Waiting for instances to pass initial health checks...
Instances are available:
i-5c3c91aa  203.0.113.91    m3.large        us-east-1a      running
i-403c91b6  203.0.113.20    m3.large        us-east-1a      running
i-e36fc6ee  203.0.113.31    m3.large        us-east-1b      running
Using ELB deis-DeisWebE-17PGCR3KPJC54 at deis-DeisWebE-17PGCR3KPJC54-1499385382.us-east-1.elb.amazonaws.com
Your Deis cluster has been successfully deployed to AWS CloudFormation and is started.
Please continue to follow the instructions in the documentation.

Install platform

$ export DEISCTL_TUNNEL=<ip-address-of-any-of-the-cluster-node>
$ deisctl config platform set sshPrivateKey=~/.ssh/deis
$ deisctl config platform set domain=deis.example.com # create a CNAME point this to the load balancer
$ deisctl install platform
$ deisctl start platform

After this, you should have a proper configured Deis cluster. Just install the client, register an account and you should be ready to deploy your very first application on Deis.