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

automica's avatar

install Laravel 8 with sail

hi all, is it possible to install laravel 8 with sail

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

as covered by docs?

https://laravel.com/docs/8.x/installation#getting-started-on-macos

running this installs laravel 9 but I would like to lock to earlier version as its a requirement for a project I'm working on

0 likes
4 replies
Sinnbeck's avatar

If you havent tried it I can suggest having a quick look at Lando. I am currently in the progress of migrating to it. :) It does some brilliant things to allow ssl, and writing custom commands.

And I cannot see any way you can change the version with sail. But you can just download the script (remove | bash) and change it to use composer create-project

Or just do so manually. This is the line that installs it

bash -c "laravel new example-app && cd example-app && php ./artisan sail:install --with=mysql,redis,meilisearch,mailhog,selenium "
1 like
webrobert's avatar

@Sinnbeck I watched the Laracon Lando talk. And am considering it. I’m curious for a report back on your progress.

Sinnbeck's avatar

@webrobert I have a semi advanced docker set up with traefik as a proxy and communication between apps, so at first I was sceptical. But after reading through the docs I had hope. I had quite a few problems under the way as I struggled to understand the underlying system. But after a few days of trial and error, I now have everything working and a quite good understanding of how it all works.

My plan is to use it for a few weeks and if I like it I will transfer to it 100%

One of the biggest wow experiences so far was when I helped someone here with a query and they shared their code. It look me only a couple of minutes to initialize the directory with Lando (docker) and have the database imported.. It was waaaay faster than anything I've ever used

1 like
Sinnbeck's avatar

I just wrote a simple setup command to install laravel and set up lando. You just need docker and lando installed (no php needed)

Be sure to replace all 3 instances of test-app with the actual name! And change the version of laravel if needed :)

docker run --rm --interactive --tty \                          
  --volume $PWD:/app \
  --user $(id -u):$(id -g) \
  composer create-project laravel/laravel test-app ^8.0 && cd ./test-app && lando init --source cwd --webroot ./public --recipe laravel --name test-app

edit: made a version that uses an environment variable to set the name

SITENAME=my-awesome-site; docker run --rm --interactive --tty \             
  --volume $PWD:/app \
  --user $(id -u):$(id -g) \
  composer create-project laravel/laravel $SITENAME ^8.0 && cd $SITENAME && lando init --source cwd --webroot ./public --recipe laravel --name $SITENAME
2 likes

Please or to participate in this conversation.