This guide explanins how to install laravel sail without the need to install php, composer and composer packages first.
If you don't get any network error during installation, skip this...
Create or edit Docker’s daemon config:
sudo mkdir -p /etc/docker
sudo nano /etc/docker/daemon.jsonPut this in the file:
{
"max-concurrent-downloads": 1
}If /etc/docker/daemon.json already contains settings, add the property without replacing the existing ones. For example:
{
"log-driver": "json-file",
"max-concurrent-downloads": 1
}Restart docker and pull the laravelsail image
sudo systemctl restart docker
docker pull laravelsail/php84-composer:latestDocker normally downloads several image layers concurrently. Its documentation specifically recommends lowering max-concurrent-downloads for connections where parallel downloads cause timeouts or interruptions. (Docker Documentation)
Once the pull succeeds, run:
docker run --rm \
-u "$(id -u):$(id -g)" \
-v "$PWD:/var/www/html" \
-w /var/www/html \
laravelsail/php84-composer:latest \
composer install --ignore-platform-reqsThen confirm:
ls vendor/laravel/sail/runtimes/8.4Then copy .env.example file and run Laravel Sail normally.