Skip to content

Instantly share code, notes, and snippets.

@taiwbi
Created July 31, 2026 03:07
Show Gist options
  • Select an option

  • Save taiwbi/9b3a16536b758903dd8b9663f306a146 to your computer and use it in GitHub Desktop.

Select an option

Save taiwbi/9b3a16536b758903dd8b9663f306a146 to your computer and use it in GitHub Desktop.
Install Laravel Sail on a PHPless Environment

Install Laravel Sail on a PHPless Environment

This guide explanins how to install laravel sail without the need to install php, composer and composer packages first.

In case of network error

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.json

Put 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
}

Pull the Image

Restart docker and pull the laravelsail image

sudo systemctl restart docker

docker pull laravelsail/php84-composer:latest

Docker 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-reqs

Then confirm:

ls vendor/laravel/sail/runtimes/8.4

Then copy .env.example file and run Laravel Sail normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment