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

v.s's avatar
Level 6

Sail in existing project

Hi, I try to run the composer install command in the cloned project. I followed instructions from the sail documentation, but I got an error: file_put_contents(/.composer/auth.json): Failed to open stream: No such file or directory

0 likes
2 replies
eheins's avatar

It is not entirely clear what your question exactly is, but if you want to install Sail in an existing Laravel installation you can use the following script in de terminal:

docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v "$(pwd):/var/www/html" \
    -w /var/www/html \
    laravelsail/php82-composer:latest \
    composer install --ignore-platform-reqs

you should use the same version of PHP that you plan to use for your application. I don't think laravelsail/php83-composer:latest is available yet

For this script to work, Docker must be running

v.s's avatar
Level 6

@eheins Thanks, I changed php version but the error was the same.

The problem was the following: I tried to install private packages while running that command, and these packages required authentication. Solution is: 1 - run "docker run --rm -u "$(id -u):$(id -g)" -v "$(pwd):/var/www/html" -w /var/www/html laravelsail/php82-composer:latest composer install --ignore-platform-reqs" this command is to install global packages at first. 2 - next use sail to install private packages

Please or to participate in this conversation.