Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

andyg1's avatar

"Docker is not running" when installing Laravel from Linux

I thought I'd follow the docs to get Laravel up and running with Sail.

At the point in the docs where it says:

curl -s https://laravel.build/example-app | bash

I received the message in the terminal "Docker is not running"

This is my first outing with Docker. Docker Engine is installed and tested as per the instructions on the docker webpages. I'm on Ubuntu.

0 likes
26 replies
thetoad01's avatar

I'm getting the same thing running on Ubuntu Desktop 20.04

kuroi's avatar

I had this problem when I first tried it on my Mac. The solution was simply to find the docker app in my apps folder (where all Mac apps are installed) and double click it. Then the curl command in the original post above did the rest.

1 like
lara197990's avatar

i have 'invalid reference error" from docker On Mac, Docker desktop installed

Silveeo's avatar

You may not be running docker on ubuntu rootless so you'll need to use Sudo.

ex.

sudo vendor/bin/sail up -d

this fixed it for me.

andyg1's avatar

Thanks to all those that replied. Yes, this was a permissions issue with docker.

You can trace the error message to the /bin/sail file. There, the line says:

# Ensure that Docker is running...
if ! docker info > /dev/null 2>&1; then
    echo -e "${WHITE}Docker is not running.${NC}"

    exit 1
fi

but i knew docker was there and working. So, I tried docker info from my terminal and discovered it was a permissions issue.

I read the docs and found the same solution as posted by @sylvain92 above, at https://docs.docker.com/engine/install/linux-postinstall/ , and it solved the problem.

However, I was unable to get those permissions to "stick" beyond the current terminal session. If I close the terminal, I have to follow the instructions again. More investigation needed.

As an aside, I was following the Laravel docs on Sail on a new Laravel project. This was on an Ubuntu machine which was a fresh installation. For anyone else in this situation, I can confirm that there are MANY hurdles to jump over to even get to point of being able to start an installation. When docker was causing me issues, I had to revert to composer, but that brought it's own problems - installing composer, upgrading PHP, etc.

When I did get going with docker I was met with further problems to do with mysql and apache running and taking up ports.

I came into this Sail project with the expectation that this was going to be a simple thing to get up and running - that is how it is pitched - and it is far from simple. I'm reasonably competent with this stuff and it was a headache for me. I really feel for those who don't have the experience who hope to hit the ground running with Sail. I'm sorry to say that it is not that simple. (Maybe on MAC and Windows it is a lot easier...?)

(After I ran into the first few problems, I began to make notes, with the aim of putting together a quickstart guide for others to follow who might find themselves in my shoes - save the next person from a lot of googling. However, my notes became such a tangled mess in the end that I doubt I could cobble together anything worthwhile.)

5 likes
maurisrx's avatar

If you're on Windows 10, enable your distro integration with Docker on Docker settings > Resources > WSL Integration. After that, restart Docker and you'll be able to run the install command.

3 likes
vaidotaslipskas@gmail.com's avatar

If you are on in windows download ubuntu from Microsoft store (which ever you like ) version and in your command prompt write: wsl --list --verbose. Check if ubuntu version is 1 or 2. If its set to 1 change it to 2. You can do it easily by typing: wsl --set-version nameofdistro 2 finally you can open ubuntu command prompt and run it again I hope that helps.

jurerick's avatar

Verify if your distro is the default running by checking if it has asterisk (*) on its name.

wsl --list --verbose

If not, then set it as default:

wsl --set-default <Distro Name>

Example: wsl --set-default Ubuntu

4 likes
el_barba's avatar

This works in Ubuntu: add sudo befor bash '| sudo bash'

antonyevchik's avatar

Hi, I think it`s more safest to add sudo to bash command than creating docker group with root privileges, and more simplest than rootless

ZermattChris's avatar

I had a similar issue (Mint Linux) that was driving me nuts (a short trip, to be fair).

curl -s h t t p s ://laravel.build/example-app | bash

replied with "Docker is not running" (it was/is).

I could run the curl command with sudo, but then other permissions issues would quickly arise...

Endless issues with permissons/user not working correctly. None of the myriad of suggestions on the Great Google helped.

I finally got it to work, by "Reset to factory defaults" in Docker Desktop, under Settings -> troubleshoot. Go figure.

Hope this helps someone else out there, who like me, isn't an utter guru in everything "geek".

Please or to participate in this conversation.