Configuring a Docker LAMPP server for PHP development on Windows Desktop

From Joomla! Documentation

These instructions are for component development in version 4 of Joomla!

Requirements[edit]

  • Windows 10 or 11 with WSL support
  • Install Docker Desktop on Windows
  • Install Git for Windows

Procedure[edit]

In a Windows 10/11 Desktop with requirements installed:

  • Open a git-bash terminal (You can use your personal editor choice with Git support to do that.)
  • create a local repo: local-repo $ git init
  • create the directories inside these folders:
 $  mkdir -p src/admin
 $  mkdir -p src/site
  • Copy the stack.yml code from docker hub and adapt the code including in the joomla: section a new directive:
   volumes:
     - './src/admin:/var/www/html/administrator/components/com_helloworld'
     - './src/site:/var/www/html/components/com_helloworld'
  • Run the docker image with:
 $ docker compose -f stack.yml up -d
  • Access Joomla in your browser using the localhost address and port 8080. (This port can be changed in the stack.yml file.) Run the Joomla configuration.
  • Commit the initial code with:
 $ git add .
 $ git commit -am "Initial development environment"
 $ docker compose -f stack.yml stop
  • Remove the docker images with:
 $ docker compose -f stack.yml down

References[edit]

  • The official Joomla! docker image is on Docker Hub