Get Docker and WordPress up in minutes

So almost everyone I know of is working on getting their solution onto Docker. I will not be talking about Docker in here today; there are tons of blogs and published content around that subject.

What I will be talking about is how to fire-up a WordPress website in minutes using Docker.


  1. You will need a linux server – I use nothing but Ubuntu 14.04 LTS
  2. You will need to have docker-compose installed in your system. If you don’t have it, you can install it using pip:
  3. You will need to have a docker-compose file. I’ve included mine in here for your reference:
    image: wordpress
    container_name: wordpress
    hostname: wordpress
    - mysql:mysql
    - "8080:80"
    image: mariadb
    MYSQL_ROOT_PASSWORD: a_sophisticated_password_here
    image: nginx
    container_name: nginx
    hostname: nginx
    - ./nginx:/etc/nginx
    - "80:80"
    - wordpress:wordpress
  4. If you notice, in my nginx section I’ve added a volumes line. What this does is I’m telling the container to map my nginx directory relative to the current path in the host to the container’s /etc/nginx directory. What my nginx directory contains is just the default files/directories of the nginx image. I just copied them to the host so I can modify it directly. You don’t really have to do this it’s just my preference.
  5. You should modify your nginx configuration related to your new wordpress website.
  6. Once you have everything setup, just run the following command:
    $ docker-compose up
  7. This will start up the process of pulling all of the images you have defined in your docker configuration file. Once all images are up, the containers will be started.
  8. Once you validated that everything is working, it’s time to start the docker containers in the background. Exit your current session by hitting Ctrl-C.
  9. Start docker-compose again in background mode:
    $ docker-compose up -d
  10. And that’s all she wrote.

I hope you learn something from this and try spinning some docker images on your own. My recommendation, try to spin up a MediaWiki website.

Hit me up with your comments.