Installing Rancher

Before you install Rancher, you’ll need a server to install it on. You can install Rancher on a bare-metal server, a VPS, or cloud server– the only requirement is that the machine can run Docker.

Digital Ocean

You can easily get started on cloud providers such as Digital Ocean, that offer a pre-Dockerized Ubuntu system with a single click. If you don’t have an account with Digital Ocean, you can get started for free with a $10 credit. That’s enough to run two 512 MB servers for a month.

Once you’ve created an account, simply click the green “Create Droplet” button in the top right hand corner of the dashboard– a “Droplet” is Digital Ocean’s terminology for a virtual server.

Go ahead and enter a host name, choose a Droplet size (1 GB is the recommended minimum, especially if you’re going to use this node to both run the management console and your own services), and region. For the image, you can select “Docker 1.x.x on Ubuntu 14.04”. As of publication, the current version of Docker is “1.7.1”.

Docker 1.7.1 Image on Digital Ocean
Selecting the Docker 1.7.1 Image on Digital Ocean

Under the “Available Settings” section there are a couple checkboxes. You can choose whether to enable backups (which is advised if you plan to use this Rancher installation for an actual production service) or enable private networking. Ensure you select the “User Data” box, and enter the following script:


docker run -d --restart=always -p 8080:8080 rancher/server

The User Data script allows for you to configure your instance at first boot. There are a couple different types of scripts you can run, including Bash scripts as indicated by the #!/bin/bash. All we need is for the Rancher server container to be launched, binding to port 8080 so that it is accessible to the outside web.

Amazon Web Services

You can also install Rancher on AWS EC2 relatively easily. You can simply create a new instance with the Ubuntu 14.04 AMI.

Ubuntu 14.04 AMI on AWS EC2

Because the Ubuntu AMI doesn’t include Docker by default, we have to install it with a User Data script. You can find the User Data input inside of the “Advanced Details” section of the “Configure Instance” step.


wget -qO- | sh
docker run -d --restart=always -p 8080:8080 rancher/server

As you can see, the User Details script is somewhat similar to the one that was required for Digital Ocean. The only difference here is that we install Docker before we install Rancher.

Security Group

Because AWS EC2 is protected by a user-definable firewall, called Security Groups, you must configure it to allow traffic to specific ports. Ideally, the following Security Group inbound settings should be used:

  • TCP Port 22 (allow all)
  • TCP Port 80 (allow all)
  • TCP Port 443 (allow all)
  • TCP Port 8080 (allow all, or only allow your business’ or home IP address– this is the management console)
  • UDP Port 500 (this security group only)
  • UDP Port 4500 (this security group only)

Ensure you also select a key pair you have access to, since you will need to SSH into the machine.

Lesson tags: Software Installation
Back to: Getting Started with Rancher, a self-hosted Docker PaaS > Installing and Configuring Rancher