Installing Docker on Linode with WordPress image

  • docker and wordpress running together

After creating your new Debian/Ubuntu instance on your Linode manager console follow following steps.


Instance update and docker install

1.) To upgrade your Linux instance with the newest relevant updates, to get our instance up to date (in our case running Ubuntu) .


apt-get upgrade
apt-get update

2.) There is an issue with Linode and Docker with dependancies, therefore following command needs to be run as well before continuing with docker installation:

apt-get install dmsetup && dmsetup mknodes

Docker installation

3.) After that we need to install Docker itself with a lovely curl command:

curl -sSL https://get.docker.com/ | sh

With that installation of Docker on Linode is finished. But it a very basic one.

Before getting WordPress image installed, image presumes you already have MySQL server running.

With this command we are creating docker image with wordpressdb name and adding password with mysql database name, as well as it’s version. In the following command we will use mysql:tag, with tag representing version 5.7.

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

Now we need to create WordPress image with the existing mysql container which we named in previous command, wordpressdb:

docker run --name wordpresscu --link wordpressdb:mysql -d wordpress

Extra information:

But since I was encountering problems with some part it’s important that if anyone needs it, that we add a command for removal of a container and showing all containers.

Displays all containers if they are run or not:
docker ps -a

Removes the chosen container:
docker rm

By |February 17th, 2017|Categories: ALL, How to, The Code|

About the Author:

Senior lead developer currently working in Java, architecture design, mix of tech from Front-end in JS and templating to chef,rundeck etc. For fun and challenge I am writing different blog posts from stories to poems, programming tutorials and many more. Currently working on my Masters degree on a part-time basis.