Laravel Sail
Use Laravel Sail to develop inside Docker containers. This guide uses SQLite and Mailpit.
Container builds, the application welcome page, and the Mailpit inbox have been verified on Debian ARM64 (EC2 t4g.small).
1. Prepare your environment
Section titled “1. Prepare your environment”Make Docker and Docker Compose available. This workflow also uses Git, PHP, Composer, Node.js, and npm on the host while preparing the containers. Check the system requirements.
docker --versiondocker compose version2. Fetch the kit
Section titled “2. Fetch the kit”Clone the repository directly. Use a directory name that does not already exist in place of my-app.
git clone https://github.com/catatsumuri/laravel-react-secure-starter-kit.git my-appcd my-appcp .env.example .envcomposer install --ignore-platform-reqs--ignore-platform-reqs skips host PHP version and extension checks while obtaining the files needed to prepare Sail. It does not guarantee compatibility inside the container; check that later. Composer scripts still execute on the host and need the tools and extensions required by those scripts.
Chisel prompts you to select authentication features. Press Space to toggle selections and Enter to confirm. For an initial check, you can leave all features enabled.
Which authentication features would you like to enable?
Email verification Registration Two-factor authentication Passkeys Password confirmationRemoving Password confirmation also removes the browser-based session management page.
3. Select Sail services
Section titled “3. Select Sail services”php artisan sail:installIn the service selection, deselect the default mysql selection and select mailpit. Use Space to toggle selections, then Enter to confirm.
- Database: add no database service for this walkthrough, retaining
DB_CONNECTION=sqlitein.env. - Mailpit: use it to inspect development email such as verification messages, password resets, and change notices.
Omitting a database service does not itself change arbitrary database settings to SQLite. This kit’s .env.example already selects SQLite, so that setting is retained.
The first installation pulls the Mailpit image and builds Sail’s application image. Wait for the PHP, Node.js, and other environment setup to finish.
Sail scaffolding installed successfully confirms that Sail setup has completed.
4. Choose a port and start containers
Section titled “4. Choose a port and start containers”This walkthrough uses port 8000 in the browser. Add or check these settings in .env:
APP_PORT=8000APP_URL=http://localhost:8000APP_PORT controls the application port exposed on your computer. The default is 80. It is separate from Vite’s port.
Start containers in terminal 1:
./vendor/bin/sail upKeep that terminal open. Open another terminal, or another SSH connection, and continue from the same my-app directory.
To create and start containers in the background, including after a port change, use ./vendor/bin/sail up -d.
5. Prepare the application key and database
Section titled “5. Prepare the application key and database”From here, use Sail to run commands inside the container.
./vendor/bin/sail composer check-platform-reqs./vendor/bin/sail artisan key:generate./vendor/bin/sail artisan migrate --seedThe first command checks that container PHP and extensions meet the installed dependencies’ requirements. Resolve missing requirements in the container environment before continuing. If migration asks to create the SQLite file, confirm its creation.
Resetting a disposable test database
The verification run initialized its database with the following command. It deletes existing tables and data, so use it only for a disposable test database.
./vendor/bin/sail artisan migrate:fresh --seed --force6. Start Vite+
Section titled “6. Start Vite+”Run this in terminal 2:
./vendor/bin/sail npm run devVite+ runs using Node.js inside the container. Inertia SSR dev endpoint: /__inertia_ssr is a startup message. Keep this terminal open while it runs.
7. Open the application and Mailpit
Section titled “7. Open the application and Mailpit”| Destination | URL |
|---|---|
| Application | http://localhost:8000 |
| Mailpit | http://localhost:8025 |
Check that the application displays the Welcome page with Log in / Register.

Selecting Mailpit makes Sail update the email settings in .env:
MAIL_MAILER=smtpMAIL_HOST=mailpitMAIL_PORT=1025Port 8025 is the browser inbox interface. Application email is sent between containers to mailpit:1025.

The inbox starts empty. Verification so far covers the Mailpit interface, not email receipt. Test receipt separately by triggering an action such as email verification or a password reset.
Opening an application on an SSH server
Forward the application, Vite, and Mailpit ports from your computer:
ssh -L 8000:127.0.0.1:8000 -L 5173:127.0.0.1:5173 -L 8025:127.0.0.1:8025 admin@YOUR_SERVERUse your usual SSH destination and identity-file option if needed. Keep the forwarding connection open while using the browser.
Optional: use Pest
Section titled “Optional: use Pest”A directly cloned project uses PHPUnit by default. To switch to Pest, install it manually from the project root while the containers are running.
./vendor/bin/sail composer remove phpunit/phpunit --dev./vendor/bin/sail composer require pestphp/pest --dev --with-all-dependencies./vendor/bin/sail pest --initThis kit declares phpunit/phpunit as a development dependency, so include --dev when removing it. Follow the initialization prompts.
Convert existing tests to Pest syntax
Section titled “Convert existing tests to Pest syntax”To convert the existing PHPUnit tests to Pest syntax, add the Drift plugin and run the conversion. --drift rewrites files under tests/, so review the resulting diff.
./vendor/bin/sail composer require pestphp/pest-plugin-drift --dev./vendor/bin/sail pest --driftThe verification run reported 25 converted files as shown below. The count depends on the selected features and kit revision.
INFO The [tests] directory has been migrated to PEST with 25 files changed.Run the tests
Section titled “Run the tests”Successful conversion does not establish that tests pass. Run the tests next and check the results:
./vendor/bin/sail pestSee the official Pest installation guide and PHPUnit migration guide for details.
Optional: add Laravel Boost
Section titled “Optional: add Laravel Boost”This workflow does not use laravel new, so add Boost manually if needed. Run these commands from the project root while the containers are running:
./vendor/bin/sail composer require laravel/boost --dev./vendor/bin/sail artisan boost:installFollow the prompts to select the AI agents you use.
Stop development services
Section titled “Stop development services”Stop the Vite+ command with Ctrl+C. To stop containers, run this from the project root:
./vendor/bin/sail down