Skip to content

Instantly share code, notes, and snippets.

@pjmazenot
Last active January 2, 2023 09:33
Show Gist options
  • Save pjmazenot/d0175e2c980c2310253d21bb1e165e19 to your computer and use it in GitHub Desktop.
Save pjmazenot/d0175e2c980c2310253d21bb1e165e19 to your computer and use it in GitHub Desktop.
Install of Rancher on Ubuntu 16.04
#!/bin/sh
# Install of Rancher on Ubuntu 16.04
# Prepare installation
sudo apt-get remove docker docker.io docker-engine
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
# Install docker (Rancher support and best compatibility for Kubernetes)
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-cache madison docker-ce
sudo apt-get install -y docker-ce=17.03.2~ce-0~ubuntu-xenial
# Install docker compose
# You can update the release version (https://github.com/docker/compose/releases)
curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# Launch docker on boot
sudo systemctl enable docker
# Install and start the Rancher container
sudo docker run -d --restart=unless-stopped -p 80:8080 rancher/server:stable
# Use `docker logs -f <CONTAINER_ID>` to tail the container logs and see the installation progress
# When the installation is completed, access the Rancher Web interface at http://<SERVER_IP>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment