Let's play with cloud [part 1]

Let's play with cloud [part 1]


2 min read

print "Hello World!"

In my first article I want to present to you an introduction to Rancher and Hetzner - this is required for the next my articles.

Why Rancher with Hetzner? Answer is very simple - self-hosted and cheap cloud. This is for dev's who know not only how to configure domain DNS

Let's start right now :D

  1. Create account on Hetzner if you don't have yet
  2. When you login to Hetzner, create 1 server (name: CX21) with 2vCPU and 4GB RAM, don't forget to select Ubuntu (is default)
  3. When server was created login to root and run:
    curl -fsSL https://get.docker.com -o get-docker.sh
    sh get-docker.sh
  4. Install docker-compose
    sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    sudo chmod +x /usr/local/bin/docker-compose
  5. Create dir for rancher
    mkdir ~/rancher-docker && cd ~/rancher-docker && mkdir volume
  6. Create new file docker-compose.yml and paste config:
    version: "3"
     image: rancher/rancher:v2.5.2
     privileged: true
       - "80:80"
       - "443:443"
       - ./volume:/var/lib/rancher
     restart: always
     #command: "--acme-domain your.domain"
    Uncomment command if you want SSL
  7. Run Rancher
    docker-compose up -d
  8. Watch logs:
    docker-compose logs rancher -f

Go to your server ip or domain if you configured and create admin account in Rancher

Now we can do something in next articles :)