Docker - is not running

Stefan Bogdanescu

Founder & Senior Architect · 2026-06-29

Laravel Company

Docker - Is Not Running: A Developer's Guide to Fixing Installation Errors

If you’ve ever tried to set up a modern PHP framework like Laravel using automated scripts only to be blocked by the cryptic error, "docker is not running," you know the frustration. This error isn't about your Laravel code; it’s a fundamental system issue. It signals that the prerequisite tool—Docker—is either not installed, not configured correctly, or, most commonly, the Docker daemon service is simply not active on your machine.

As senior developers, we understand that complex tooling often relies on underlying infrastructure. When dealing with containerization technologies like Docker, understanding this dependency is the first step to solving any roadblock. This post will guide you through diagnosing and resolving the "docker is not running" error so you can successfully deploy your Laravel application.

Understanding the Root Cause

The command you are attempting to run—curl -s https://laravel.build/example-app | bash—is a wrapper script designed to automate the setup of a new Laravel project, which almost invariably involves using Docker to spin up the necessary environment (PHP, web server, etc.) inside a container.

The error "docker is not running" means that the shell script cannot execute the necessary commands because the Docker engine (the background service responsible for building and running containers) is either completely absent or currently stopped. The script checks for the existence and operational status of the Docker daemon before proceeding with any installation steps.

Step-by-Step Diagnosis and Resolution

Fixing this issue requires checking the health of your Docker installation before attempting the Laravel setup again. Follow these steps, which are standard practice across most Linux distributions (like Ubuntu or Debian):

1. Check Docker Status

First, verify whether the Docker service is active. Use the following command to get an immediate status report:

sudo systemctl status docker

If the output shows Active: inactive or Active: failed, this confirms the problem.

2. Starting the Docker Service

If the service is stopped, you need to start it immediately. This is usually the quickest fix for this specific error:

sudo systemctl start docker

After starting it, run the status command again to confirm it is running correctly:

sudo systemctl status docker

You should now see output indicating that the service is active (running).

3. Enabling Auto-Start (Best Practice)

For long-term stability, you want to ensure Docker automatically starts every time your system boots up. To achieve this, enable the Docker service:

sudo systemctl enable docker

This ensures that future attempts to run Docker commands will not encounter the same dependency failure upon reboot.

4. Addressing Permissions (If Applicable)

In some setups, running Docker commands requires elevated privileges. If you still encounter permission issues after starting the service, you might need to add your user to the docker group to avoid needing sudo for every command:

sudo usermod -aG docker $USER
# You must log out and log back in for this change to take effect!

Conclusion: Containerization as a Laravel Standard

Dealing with infrastructure dependencies is an unavoidable part of modern software development. By treating Docker not just as a tool but as a fundamental layer of your development environment, you streamline the process significantly. When setting up projects like Laravel, leveraging containers ensures that your local environment perfectly mirrors the production environment, which aligns perfectly with best practices promoted by organizations like Laravel Company.

Remember, if you are building robust applications, mastering the tooling that powers them—like Docker—is just as important as mastering the framework itself. Once the Docker daemon is running smoothly, your automated installation scripts will execute without hindrance, letting you focus on writing exceptional code.