In this tutorial we will show you how to install Rancher on your CentOS 7 server. For those of you who didn’t know, For those of you who didn’t know,The rancher is an open source program which helps you to run the containers in production. The rancher is based on Docker, which means it’s possible to run it on a dedicated box, KVM machine or perhaps on a LXC container. Rancher provides a huge library of applications which are installed in a few clicks and also supports docker pictures from Dockerhub.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation the Rancher private container service on a CentOS 7 server.
Install Rancher on CentOS 7
Step 1. First let’s start by ensuring your system is up-to-date.
yum clean all
yum -y install epel-release
yum -y update
Step 2. Installing Docker.
Before we install the Rancher server, we have to install the docker machine. If you do not have docker installed, you can follow our guide here.
Step 3. Installing Rancher.
On the Linux machine with Docker installed, the command to start a single instance of Rancher is simple:
docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:stable
Rancher server uses port 8080 for the web interface. Configure the firewall to allow port 8080 and reload it:
firewall-cmd --zone=public --add-port=8080/tcp --permanent
Rancher will be available on HTTP port 8080 by default. Open your favorite browser and navigate to http://yourdomain.com:8080 or http://server-ip:8080 and complete the required the steps to finish the installation.
*Rancher doesn’t configure access control by default, so it is important to set this up immediately, otherwise the UI and API can be accessed by anyone who has your IP.
Congratulation’s! You have successfully installed Rancher. Thanks for using this tutorial for installing Rancher private container service on CentOS 7 systems. For additional help or useful information, we recommend you to check the official Rancher web site.