How to install RancherOS and Rancher (server)

This article will show you how to get started with Rancher and start it using RancherOS.

I’m going to assume you have a nice Macbook with VirtualBox and Docker Machine installed.

Step 1: Create a RancherOS machine

As described on the RancherOS Quick Start Guide you can use the following command to make docker-machine spin up a VirtualBox machine running RancherOS.

docker-machine create -d virtualbox --virtualbox-boot2docker-url https://releases.rancher.com/os/latest/rancheros.iso rancheros

The last rancheros part is the machine name we’re using in this example.

Next, running docker-machine ls should give something like:

$ docker-machine ls
NAME        ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
rancheros   -        virtualbox   Running   tcp://192.168.99.100:2376           v1.12.1

You should be able to ssh into this machine using docker-machine ssh rancheros.

Step 2: Launch a Rancher server

Now we want to launch Rancher on this new RancherOS server. We do this by starting a Docker container of the rancher/server image.

$ docker-machine ssh rancheros
[docker@rancheros ~]$ sudo docker run -d --restart=always -p 8080:8080 rancher/server

Pointing your browser to port 8080 on the IP shown in the docker-machine ls command (in our case 192.168.99.100) should give you the nice GUI. Or use the docker-machine ip command to find out your rancheros virtual machine IP.

$ docker-machine ip rancheros
192.168.99.102
$ open http://192.168.99.100:8080/

NOTE: If Rancher server does not seem to start you might need to increase the VM memory size.