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

adityar15's avatar

Laravel project with and without sail, pros and cons

Is there any benefit of using Laravel sail over Laravel installation without sail? Somehow I find creating and running a Laravel project with composer and an in-built Laravel server way more straightforward than sail. Sometimes same with the deployment process unless I need to create a Docker for serverless function.

Am I missing something here?

0 likes
8 replies
Sergiu17's avatar

Depends on what projects you are working on and if you have a team. If you have a team, then you probably need Sail, because everyone should have the same environment.

Second example, when you have two projects, two services, or whatever, you need them both up and running at the same time, one service is running on PHP 8.1 and the other one is running on PHP 7.4, in this case Sail is quite handy.

But if you work alone, on relatively simple projects, I guess it would be much easier to use local PHP installation and built-in server

2 likes
martinbean's avatar

@adityar15 Sail is a Docker-based development environment. As it’s Docker, all the software (PHP, MySQL, etc) is contained within “images”. So, the “pro” to this approach is, you can install versions of PHP, MySQL, etc you need to run your project without having to actually install them on your computer. If you’re not actually installing these things on your computer, then that means you can also use multiple versions of each.

For example, if you work on a legacy project that needs PHP 8.0 and a newer project that needs PHP 8.2, you can just work with different PHP images for those projects; you don’t have to mess about installing different versions of PHP on your computer, or updating symlinks or whatever between different installations. You just run sail up and you have the environment with the versions of things your project has declared.

With having versions of PHP contained in images, it also cuts out the issue that I see crop up time and time and time again: trying to install Composer dependencies, but then Composer complaining it wants a different PHP version:

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0".

This happens if you try and install Composer packages using an older version of PHP. You won’t get this error if you install your dependencies using the PHP version contained in the Docker image for your project, be that a new or old version of PHP. You’ll be using the version of PHP your project (and its dependencies) require.

1 like
thewakadi's avatar

Hi,

How do you deploy laravel sail to production?

ibmc's avatar

Not trying to bump an old post, but the previous answers don't actually answer the question and also don't seem based on fact. You can easily swap versions of any service with vanilla docker, Laravel Sail is not required or needed here. The real issue is that all docs now point to Laravel-specific products and no longer provide an "honest" simple solution like they used to.

I'm working on a docker-compose.yml file and will be sure to share it and make it known. The lack of a docker compoe file seems "silly" (and I hate that word...)

martinbean's avatar

@ibmc I don‘t really understand what point you’re trying to make? If you use Sail, then it does publish a docker-composer.yml file to your application.

guizo's avatar

Sail makes it easy to quickly set up a development environment, but it’s generally different from the production setup. I prefer having a docker-compose.yml for development that closely mirrors the one used in production.

Please or to participate in this conversation.