Search code examples
laraveldockerwindows-subsystem-for-linuxlaravel-9

Docker is not running when trying to curl laravel


I am trying to set up Docker and Laravel 9 (both for the first time) on my Windows 10 system by following the instructions on the official Laravel website.

I have successfully installed Docker Doesktop and have also successfully installed and activated Windows Subsystem for Linux 2 (WSL2).

I then installed Windows Terminal, connect to an Ubuntu 22.04 container that I have started and tried to run the following command as instructed on the official Laravel website:

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

But instead of creating a new project example-app, I get the following message instead:

Docker is not running.

What am I doing wrong?


Solution

  • Ok so I finally figured it out. When I open Windows Terminal, I need to first run wsl and then go forward with curl-ing Laravel and using it.

    So after installing and activating WSL2 in Windows & Docker Desktop, the steps to follow would be:

    1. In your terminal, run wsl.
    2. Run the curl -s https://laravel.build/example-app | bash command.
    3. cd to the the new Laravel application example-app directory and then use Laravel Sail to run it.