Taylor Otwell released Laravel Sail this week—a lightweight CLI for interacting with Laravel’s default docker environment. It provides a simple interface the helps you get started on your next big idea in no time. This new development environment option is now documented in the installation guide.
The fasted way to get started with Sail is running the following command (referenced from the installation docs) after you have Docker installed:
1curl -s https://laravel.build/my-inspiring-app | bash
New installations of Laravel will automatically include a
vendor/bin/sail CLI script you can use to start, stop, and manage your Laravel application in an easy-to-use Docker environment. Here are a few example commands for managing your development environment with Sail:
1alias sail='bash vendor/bin/sail'23# Run docker containers `docker-compose up`4sail up5# Run docker containers in the background6# `docker-compose up -d`7sail up -d89# Stop containers and remove containers, networks, etc.10sail down
Sail comes with NPM, composer, and all the tools you’re used to using locally, all packaged up neatly inside Docker containers. Here are some examples you’d typically use:
1# Runs php artisan queue:work in the container2sail artisan queue:work34# Run PHP CLI commands and return output5sail php --version67# Require a composer package8sail composer require laravel/sanctum910# Node and NPM11sail node --version12sail npm install
To get started, check out the official Laravel Sail documentation!
Taylor also did a live stream demonstrating Laravel Sail and gives some background on the project: