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

alex32's avatar
Level 2

laravel 11 - install with docker

Following Laravel doc, I've installed Ubuntu 22.04 as a default distro for WSL2. Next, I've installed Docker Desktop and linked to WSL2. Next I open wsl terminal and typed as below, followed by my admin-psw . Then a list of files are displayed with: Permission denied attached, and the folder my-app doesn't exist. Stackoverflow suggest to edit the docker-file, but my folder doesn't exist so I don't know where is the docker-file [1]. Thanks.

I understood this could be a permission issue, but how do I fix it? Thanks

  • Host: Win 10 22H2
  • laravel 11
  • WSL2 distro: Ubuntu 22.04
  • Docker Desktop: 4.36

wsl terminal:

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

output:

...
chown: changing ownership of './zipcontainer.dll': Permission denied
chown: changing ownership of './zipfldr.dll': Permission denied
chown: changing ownership of './ztrace_maps.dll': Permission denied
chown: changing ownership of './zu-ZA': Permission denied
chown: changing ownership of '.': Permission denied

Thank you! We hope you build something incredible. Dive in with: cd my-app && ./vendor/bin/sail up

[1] https://stackoverflow.com/questions/48619445/permission-denied-error-using-laravel-docker

0 likes
5 replies
alex32's avatar
Level 2

Thanks but Docker is a requirement, I can't skip it.

Thriddle's avatar

I'm using WSL2 with Ubuntu 22.04 on my Windows computer. Instead of Sail I use Lando for my docker containers. When I installed Laravel I used the following command:

docker run --rm --volume $PWD:/app --user $(id -u):$(id -g) composer create-project laravel/laravel example-app

The --user $(id -u):$(id -g) part made sure I had all the permissions I needed.

alex32's avatar
alex32
OP
Best Answer
Level 2

Thanks Thrid, I managed to fix the issue, though I still don't know why. Here is what I did, in case anyone is falling in the same trap:

  • I tried with Composer, but it failed because of conflicting versions (obviously). From wsl terminal:
$ sudo apt update
$ sudo apt install composer 
$ sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php  
$ sudo apt install php8.4-cli
$ sudo update-alternatives --set php /usr/bin/php8.4   ** set default php 8.4
$ composer create-project  laravel/laravel  laravel-sail     

  • Then, casually, I tried again with the original command, this time it worked:
$ curl -s https://laravel.build/myapp | bash
...
=> => exporting layers                                                                                                     14.5s
 => => writing image sha256:830c77e3039f83daf9f2a953533471ceeba9c179a49e71f3e09dff873c25df46                                 0.0s
 => => naming to sail-8.4/app                                                                                                0.0s
 => [laravel.test] resolving provenance for metadata file                                                                    0.0s

Please provide your password so we can make some final adjustments to your application's permissions.   ********
Thank you! We hope you build something incredible. Dive in with: cd myapp && ./vendor/bin/sail up

1st step is done, now I'll try building a small app and deploying it live.. Thanks everyone.

Please or to participate in this conversation.