Skip to content

Guide · Open source

How to use Laradock: run a PHP Docker stack locally

Updated · written with AI from the project's own documentation and checked against our catalogue data

Laradock is an open-source collection of Docker containers and configuration files that gives a PHP project a complete local development environment. This guide shows how to clone it into a project, start the stack, open the Workspace shell and use plain Docker Compose if you prefer. It assumes you already know basic Docker concepts, because the project's README does.

Laradocklaradock/laradock · ★ 12.7k · MIT

Quick start

  1. 1Check prerequisites. Install Docker with Compose v2 and confirm it runs on your machine.
  2. 2Clone Laradock. Run git clone https://github.com/Laradock/laradock.git inside your PHP project folder.
  3. 3Enter the folder. Run cd laradock to move into the cloned project.
  4. 4Start the stack. Run ./laradock start and answer the first-run wizard, or press Enter to accept the defaults.
  5. 5Open the Workspace. Run ./laradock workspace to get a shell with php, composer, node and git.
  6. 6Open your site. Visit http://localhost in your browser.

What Laradock gives you

Laradock is a full PHP development environment for Docker. You clone it into a PHP project, start it, and get a web server, PHP runtime, database, cache and other services without installing them on your own machine.

It works with Laravel, Symfony, WordPress, Drupal, Magento and plain PHP. The README lists services such as Nginx, PHP-FPM, MySQL, Redis, PHP Worker, Elasticsearch and Mailpit, and mentions more than 100 additional services.

  • Web server: Nginx, with Apache and Caddy also mentioned as pre-configured
  • PHP runtime: PHP-FPM, with a choice of PHP version set in .env
  • Databases and caches: MySQL, PostgreSQL, MariaDB, MongoDB, Redis
  • Mail testing: Mailpit

What you need before you start

Laradock requires Docker with Compose v2. Install Docker Desktop or your platform's Docker engine first, then confirm Compose is available before cloning the project.

The README does not give CPU, memory or disk figures. Running many containers can be heavy, so check that your machine has room for the services you plan to use.

  • Docker with Compose v2 installed
  • Enough free disk space and memory for the containers you run
  • Git, to clone the repository

Clone Laradock into your PHP project and start it

Run the clone command inside your PHP project folder, then enter the laradock folder. Start the stack with the Laradock CLI.

The first run opens a wizard where you pick your framework, PHP version, stack and dev shell tools. Every question has a pre-selected answer, so you can press Enter through it to get a working stack. Later starts just run your stack and print its URLs and credentials. To reopen the wizard, for example to add a service or switch PHP version, run ./laradock setup.

git clone https://github.com/Laradock/laradock.git cd laradock ./laradock start

Open the Workspace and load your site

The Workspace is a dev shell with php, composer, node and git inside, so you can run Artisan, Composer and other CLI tools in the container rather than on your host.

When the stack is running, open http://localhost in your browser.

  • Use ./laradock logs -f nginx to follow logs for one service; the CLI passes unknown commands straight to docker compose
  • The CLI prints every docker compose command it runs and writes only your .env file
./laradock workspace

Use plain Docker Compose instead of the CLI

The CLI is optional. If you prefer, skip it and run docker compose directly, using the same files to get the same result.

The README points to a manual setup guide in the Laradock documentation for this route.

  • Services can be started on demand with docker compose up, so you run only what a project needs
  • Each service runs in its own container and is configured from .env
docker compose up -d

Deploy from the same setup

The README describes a ./laradock ship command that packages your application for production. It lists targets including Kubernetes, Google Cloud Run, AWS ECS and your own server.

Check the Laradock production documentation for the exact steps before you rely on this path.

./laradock ship

What people use it for

  • Running a Laravel app with Nginx, PHP-FPM and MySQL on a laptop
  • Running a WordPress or Drupal site with a database and cache on a consistent local stack
  • Giving every developer on a team the same PHP environment across Linux, macOS and Windows
  • Testing outgoing email locally with Mailpit
  • Running background jobs with PHP Worker alongside the web server

Frequently asked questions

What is Laradock?

Laradock is a full PHP development environment for Docker. It is a collection of Docker containers and configuration files that you clone into a PHP project to run a local web server, PHP runtime, database and other services.

Is Laradock free?

Yes. The project is open source and released under the MIT license, according to the README.

What do I need to install Laradock?

You need Docker with Compose v2, and Git to clone the repository. The README does not list other hardware requirements, but running many containers can be heavy.

Does Laradock work on Windows?

The README says the same environment works on Linux, macOS and Windows. It recommends Docker Desktop for installing Docker.

How do I change the PHP version in Laradock?

Set PHP_VERSION in the .env file, rebuild, and the stack uses that version. You can also run ./laradock setup to reopen the wizard and switch PHP version.

What are alternatives to Laradock?

The project's comparison list names Laravel Sail, DDEV and Docker Compose templates for PHP. Laradock is the better fit if you want many pre-configured services and do not mind working with Docker concepts.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Laradock suits PHP developers, and teams, who are comfortable with Docker and want many services set up quickly and the same stack on every machine. Pick something else if you are new to containers and want a simple install with no Docker concepts, if your project is not PHP, or if your machine has limited disk space or memory.

Install options & downloads