Docker for PHP Developers

Learn How to Make PHP Development with Docker Feel like

"Docker for PHP Developers" is a guide that will teach you how to use Docker and PHP to create clean, repeatable development environments that are easy to understand.

Learn how Docker can simplify your PHP development setup and make it simple to share your environment with others. You will learn how to set up, manage, and deploy Docker applications with confidence.

Buy the Course Get a Sample

Get Free Book Samples

Try before you buy with a free sneak peek! Enter your email address and I'll send you two sample PDFs from my book and a few short videos and posts over the next week about using Docker with PHP. You'll also get semi-regular tips about Docker and updates on any course announcements.

What does the Guide Cover?

Docker for PHP Developers is a guide that combines a book and videos that help you master Docker as a full time PHP development environment.

Development Tools

  • Learn how to manage containers
  • Learn how to use Docker Compose
  • Use XDebug with Docker
  • Use PHP Composer with Docker

PHP Environment

  • Building PHP containers from scratch
  • Installing PHP modules
  • Managing module INI files
  • Per-environment configuration

Legacy Applications

  • Installing an older version of PHP
  • Hands-on example in the book getting a legacy version of a PHP app running
  • Security hardening

Build and Deployment

  • Automated builds with Docker Cloud
  • Private registries
  • GitLab Docker Builds
  • Application Deployment to Digital Ocean

A Quick Sample

I am working on screencasts to compliment the book. Get a taste of my teaching style and what's to come when I release the screencasts.

* The book-only packages are available for purchase now. If you purchase the book, I will provide an upgrade coupon for a good deal on the complete course (book + screencasts) once I finish the screencasts.

When I started using Docker with PHP, it was an overwhelming change in my development workflow.

While Docker is a powerful way to build and deploy applications with PHP, you still need to figure out Docker the nuances and conventions of how to use Docker with PHP projects. Not only are you responsible for learning how Docker works, but you also have to figure things out like project organization, connecting to a database, and setting up a development workflow.

Once you master these things, the payoff of using Docker is huge. It's more lightweight than Vagrant, and more consistent than local development.

Docker is different than working with other tools like Virtualbox and Vagrant so you might be asking questions like:

"What exactly is Docker?"

"What makes Docker better than Vagrant?"

"How do I run this thing with my project!?"

"How do I edit files locally and have them show up in Docker?"

"How do I connect to a database?"

Docker for PHP Developers is the guide I wish I had when I started learning Docker. It's everything I've learned and refined using Docker on dozens of projects over the last three years combined into one course.

I've spent over six months building this guide, with the goal of presenting the best possible course that focuses on teaching developers how to use Docker.

Instead of piecing everything together yourself, you can start being productive with PHP and Docker in a few days.

No Complicated Tools Required

Learning Docker doesn't have to be complicated. In fact, I think the goal of Docker should be to simplify your application environment, not increase complexity. I'll show you how to build practical, simple, clean Docker images from scratch without extra 3rd party tools or librariesโ€”just Docker.

Learn how to create environments that take minutes to install instead of hours or days. Think of Docker images with PHP code as a single artifact that is ready to run your application. Your application deployments will be extremely predictable and reliable. I work with leading frameworks like Laravel and Symfony, so you'll be able to use the PHP frameworks you love with Docker after going through this guide.

What's Inside the Book

Chapter 1 Introduction to Docker

We'll jump right in and install Docker, with installation steps for Mac OS X, Linux, and Windows. Then, you'll run your first container to verify that your setup is working properly.

Chapter 2 PHP Container Basics

Learn your way around Docker with hands-on commands. We'll start off with the basics so you can learn how build your first Docker image from scratch and how to run it. We'll then go over customizing a PHP INI file.

Chapter 3 LAMP with Docker

Learn how simple it is to build your own LAMP stack with Docker, without any 3rd party tools. You will also learn how to install and configure PHP modules, all while versioning your configuration in your projects.

Chapter 4 Development Tools

Learn how to master Xdebug with Docker with a step-by-step guide that shows you how to install Xdebug with a reusable configuration. You'll also learn how to remove Xdebug when you deploy Docker to production environments.

Chapter 5 Composer PHP

Are you curious how to use PHP Composer with Docker? You will Learn how to install the Composer CLI tool and install your application dependencies while building a Docker image. Learn how to install private composer repositories without leaving a trace of sensitive API keys or SSH credentials. Learn how to cache Composer dependencies for faster image builds.

Chapter 6 PHP-FPM and Webservers

Running a Webserver in Docker is a little different than on a traditional server. We cover installing Nginx and PHP-FPM and how they communicate in between Docker containers. We also walk through using Caddy Server, an HTTP/2 web server with automatic HTTPS.

Chapter 7 Legacy PHP Applications

Let's face it, we all have that legacy application in our lives. This chapter will help you set up an older version of PHP with Docker and show you how to retrofit configuration in older applications.

Chapter 8 Custom Commands

Go beyond the basics of running a container with custom commands and learn how to customize your application startup and runtime. Learn how to use Confd with Consul to separate configuration management from infrastructure code.

Chapter 9 Docker Registry Builds

Learn how to take your Docker images to the cloud and share them with others. We'll cover how to push your Docker images to registries and automatically build them when you push code commits to GitHub and other services.

Chapter 10 Deploying Docker

Take your first steps in deploying Docker to Digital Ocean with Rancher. Deployment is a big topic, and this chapter is a perfect first step for Developers. Learn how to push your image builds to Rancher from the command line with Rancher Compose.

Nice Stuff People are Saying


I am working on finalizing the video outline. My goal is to make sure the videos compliment the text, so that both video and book will reinforce your understanding of Docker for PHP development.

I plan on video guides for setting up applications for Laravel and Symfony, and also cloud deployment videos. The official video outline is still being planned and may change slightly.

Sign up and I'll send regular updates on the course, including updates to the video outline!

Get Docker for PHP Developers

Get an early release copy at a discount price!

Docker for PHP Developers Premium Edition

Starter Bundle

Comes with the book, plus the source code of two starter projects. Learn how to organize your projects with Docker and the latest Laravel and Symfony frameworks.

  • Starter project source code for Laravel 5.5 and Symfony 4, based on my professional Docker setup. Both starter projects use PHP 7.2.
  • The 222-page Docker for PHP Developers Book
  • Beautiful handcrafted PDF design
  • Basic ePub and Mobi formats included

Docker for PHP Developers Starter Edition

Book Only

Learn how to use Docker as a full-time development environment for PHP, with a beautiful, handcrafted book that will help you get from zero experience to Docker user quickly.

  • The 222-page Docker for PHP Developers Book
  • Beautiful handcrafted PDF design
  • Basic ePub and Mobi formats included

Paul Redmond

About the Author

Hello! I'm Paul Redmond. I'm a full stack developer writing stuff with Laravel, Vue.js, and Docker. I am passionate about being productive, writing clean code, and creating simple infrastructure.

I am the author of Writing APIs with Lumen, now published with Apress as Lumen Programming Guide. You can find me on Twitter as @paulredmond.