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

J-LXXXIX's avatar

Using the curl installation for older versions?

In the docs, I can see we can install Laravel with Sail using the following:

curl -s "https://laravel.build/example-app?with=mysql,redis" | bash

But is there not a way where we can specify which versionof Laravel to install and also which version of PHP to use with this command?

I am trying to avoid installing composer/npm/etc on my computer and let docker handle all that.

0 likes
11 replies
J-LXXXIX's avatar

Excellent, thank you so much! This got me on the right track but I think my last obstacle has became a dead end.

I thought I could change the sail 8.1 to 7.3 but... From the docs: "When using the laravelsail/phpXX-composer image, you should use the same version of PHP that you plan to use for your application (74, 80, or 81)."

It does not look like I can go as far back as php 73 using this method :(

J-LXXXIX's avatar

@sr57 Yeah I know. Just trying to match certain enviornment conditions given to me. Appreciate the help! :)

Sinnbeck's avatar

Check my install example here. It let's you specify laravel version

https://sinnbeck.dev/posts/using-lando-to-run-laravel-in-docker

You can remove the last line if you don't use lando. You can add a sail install command in there if you want

SITENAME=my-app; docker run --rm --interactive --tty \
  --volume $PWD:/app \
  --user $(id -u):$(id -g) \
  composer create-project laravel/laravel $SITENAME ^9.0 \
  && cd $SITENAME \
  && lando init --source cwd --webroot ./public --recipe laravel --name $SITENAME 
J-LXXXIX's avatar

I could be wrong but my understanding is Sail is not available for any PHP versions under 7.4

Here is the script I ran which got me so close, yet so far: Note: I had an issue where composer 1 was being used, and memory issues but the following script fixes those issues and makes "l8-app" not "example-app"

docker info > /dev/null 2>&1

# Ensure that Docker is running...
if [ $? -ne 0 ]; then
    echo "Docker is not running."

    exit 1
fi

docker run --rm \
    -v "$(pwd)":/opt \
    -w /opt \
    laravelsail/php73-composer:latest \
    bash -c "COMPOSER_MEMORY_LIMIT=-1 && composer self-update && composer create-project laravel/laravel l8-app 8.0 && cd l8-app && composer require laravel/sail && php ./artisan sail:install --with=mysql "

cd l8-app

CYAN='3[0;36m'
LIGHT_CYAN='3[1;36m'
WHITE='3[1;37m'
NC='3[0m'

echo ""

if sudo -n true 2>/dev/null; then
    sudo chown -R $USER: .
    echo -e "${WHITE}Get started with:${NC} cd l8-app && ./vendor/bin/sail up"
else
    echo -e "${WHITE}Please provide your password so we can make some final adjustments to your application's permissions.${NC}"
    echo ""
    sudo chown -R $USER: .
    echo ""
    echo -e "${WHITE}Thank you! We hope you build something incredible. Dive in with:${NC} cd l8-app && ./vendor/bin/sail up"
fi

@sinnbeck Thank you for responding. I am afraid I have not heard of Lando, but once I get a chance I will look more in detail on what you have sent.

Much appreciated.

J-LXXXIX's avatar

@Sinnbeck This is excellent information, thank you for this. Apologies, life is getting in the way for me to really dive into this at the moment. But from what I am seeing this is giving me hope again! XD

Sinnbeck's avatar

@J-LXXXIX life should always come first. No worries. The guide will still be there when you are ready. If you run into issues, I also help out on the Lando slack chat

1 like

Please or to participate in this conversation.