How to Setup a LAMP Development Environment

I Love Lamp
I Love Lamp

Key Knowledge

  • These steps will be updated as new best practices emerge.
  • Use Docker to provision the development stack inside containers. Containers are more scalable for deployment automation.
  • Windows Subsystem for Linux (WSL) can be used to interface with an open source stack.
  • MySQL is excluded. (LAMP = LAP)

Clone the Repository

Setup Windows Subsystem for Linux (WSL) with Ubuntu

Follow the installation instructions.

WSL environment can be reset by uninstalling the Ubuntu App, restarting Windows, and reinstalling the Ubuntu App from Windows Store.

Setup Docker

Install Docker for Windows.

Enable booting into UEFI firmware settings to edit BIOS.

Turn on virtualization in BIOS. This will vary based on vendor.

Enable listening on remote port without TLS.

Expose daemon on TCP port 2375 without TLS.
Expose daemon on TCP port 2375 without TLS.

Setup Docker in WSL

Normalize Volume Mount Paths

Sign out and sign back in, or restart the machine for the changes to take effect.

Install Docker Compose

Build the Web Server Docker Container

Build the Docker Composition

Enable overriding the default configuration using Docker Volumes.

Run the Docker Composition

Change the DNS Server Used by Docker Server

Change the DNS server used by Docker.
Change the DNS server used by Docker.

Works Cited

How to set up a PHP development environment on Windows Subsystem for Linux (WSL)


WSL is a compatibility layer for running Linux binary executables (in ELF format) natively on Windows 10. Microsoft says:

“This is primarily a tool for developers — especially web developers and those who work on or with open source projects”.

We can run a Linux environment directly on Windows without the overhead of a virtual machine.

Windows Subsystem for Linux Installation Guide for Windows 10

How to develop a LAMP web application using Docker, Puppet and Vagrant?

Use Docker to provision application stacks.

Partition dependencies into separate Docker images.

User Docker Volumes to externalize state.

Mirror production stack in development stack.

Get Docker CE for Ubuntu

Install Docker Desktop for Windows

Install Docker Compose

How to set up Docker and Windows Subsystem for Linux: A Love Story.

Setting Up Docker for Windows and WSL to Work Flawlessly

LAMP stack built with Docker Compose

Get net/http: request canceled while waiting for connection

Prune unused Docker objects

How to Access the BIOS on a Windows 10 PC

Docker’s detached mode for beginners

Join the Conversation

1 Comment

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: