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

SlomianJan's avatar

Getting laravel with docker and wsl2

Hello, I've never created any laravel project, only have been making small changes in few projects. I usually work with symfony. I wanted to try laravel at home. But I can't find any way to get it to download. I have docker and wsl2 with ubuntu 20.04 and 22.04 In both ubuntu bash after typing curl -s laravel.build/example-app | bash nothing happens. Can't post links on my first day so I cut https://.

If I try git bash I get

Status: Image is up to date for laravelsail/php82-composer:latest docker: Error response from daemon: the working directory 'C:/Program Files/Git/opt' is invalid, it needs to be an absolute path.

I tried to use curl at /home/ as well as /mnt/c/dev/ where I usually keep my projects.

I don't have PHP installed at home and would prefer not to.

Can anyone explain to me how to get laravel ?

0 likes
10 replies
_fag's avatar

Try putting quotes in the url.

curl -s "https://laravel.build/example-app" | bash
patrickkellar's avatar

If you go to the URL it will show you the script that you’re attempting to pipe to bash. You could copy and paste the contents from that url to a file called create.sh and then do a chmod +x create.sh and then run that script to produce the same result.

SlomianJan's avatar

Just in case to be sure, I tried it at work and it worked flawlessly. Any idea what might be the issue or has anyone else had this and how did they solved it ? I'll try with copy/paste bash script at home when I get back.

shaungbhone's avatar

@SlomianJan I don't understand why cut https, if you do not have https, is nth happened. curl -s silent mode will allow you to retrieve data from a remote server via HTTP, HTTPS, FTP, or any other supported protocol without any unnecessary output.

SlomianJan's avatar

@shau I cut it from the post because the forum wouldnt let me post it. What are you taking about.

SlomianJan's avatar

It worked today without any issues. No idea what was the problem yesterday. I guess it solved itself.

Please or to participate in this conversation.