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 VPS/dedicated servers IP address in your browser and it should display the Wordpress setup/install page!


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

Last modified: August 03 2017 19:21:19