How to Setup a LAMP Development Environment

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.

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.

Works Cited

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

https://medium.freecodecamp.org/setup-a-php-development-environment-on-windows-subsystem-for-linux-wsl-9193ff28ae83

LAMP on 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

https://docs.microsoft.com/en-us/windows/wsl/install-win10

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

https://stackoverflow.com/questions/26139472/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

https://docs.docker.com/install/linux/docker-ce/ubuntu/

Install Docker Desktop for Windows

https://docs.docker.com/docker-for-windows/install/

Install Docker Compose

https://docs.docker.com/compose/install/

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

https://medium.freecodecamp.org/how-to-set-up-docker-and-windows-subsystem-for-linux-a-love-story-35c856968991

Setting Up Docker for Windows and WSL to Work Flawlessly

https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly

LAMP stack built with Docker Compose

https://github.com/sprintcube/docker-compose-lamp/tree/7.2.x/bin

Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection

https://github.com/docker/for-win/issues/611

Prune unused Docker objects

https://docs.docker.com/config/pruning/

How to Access the BIOS on a Windows 10 PC

https://www.laptopmag.com/articles/access-bios-windows-10

Docker’s detached mode for beginners

https://medium.freecodecamp.org/dockers-detached-mode-for-beginners-c53095193ee9

Join the Conversation

1 Comment

Leave a comment

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

Exit mobile version