CrownCloud Wiki

CrownCloud - Internet Services

User Tools

Site Tools


installing_docker_on_your_centos_6_vps

Installing Docker on your CentOS 6 VPS

Prerequisites / Before you start off

  • Make sure you have EPEL installed and enabled, EPEL can be enabled/installed with the following guide:
  • This guide will not work on OpenVZ based VPSes, it'll only work on KVM based VPSes and dedicated servers.

To begin, update your system to ensure full compatibility between applications installed,

yum update

Next, we install the docker package,

yum install docker-io

Once the install finishes, start the docker service,

service docker start

You can configure Docker to automatically start on-boot/reboot as well, using chkconfig,

chkconfig docker on

Done! The basic install of Docker on CentOS 6 is complete

Example: Setting up Wordpress on Docker

In this example, we'll be using Dockers official Wordpress image to setup and use.

Let's run docker first, remember to change “password” to something else before using,

docker run --name wordpress -e MYSQL_ROOT_PASSWORD=password -e MYSQL_DATABASE=wordpress -d mysql:5.7

Download the Docker Wordpress image,

docker pull wordpress

Build+Start the Wordpress docker container, change “password” to what ever you had set on the earlier step.

docker run -e WORDPRESS_DB_PASSWORD=password -d --name wordpress --link wordpressdb:mysql  wordpress

Done! Visit your VPSes IP in your browser and it should display the Wordpress setup/install page!

Debugging

You may run into an error saying port 80 is currently use, in this case stop your webserver, which would most likely be apache/httpd with the following command and then re-try deploying from the “Build+Start” step above,

 service httpd stop 
installing_docker_on_your_centos_6_vps.txt · Last modified: 2015/09/20 15:43 by speedbus