Module 0: Environment Setup

Setting up a professional Laravel environment using Docker (Sail).

🚀 Docker is the Standard

Gone are the days of XAMPP/WAMP. Modern Laravel development uses Laravel Sail, a light-weight command-line interface for interacting with Laravel's default Docker development environment.

1. Prerequisites

macOS:

Windows:

2. Create a New Project

This command downloads a small Docker container to build your app without needing PHP installed on your local machine initially.

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

You can customize the services (e.g., add Redis, MySQL):

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

3. Start the Environment

cd my-app
./vendor/bin/sail up -d

The first time you run this, it will take a few minutes to build the containers.

4. Configure Shell Alias

Typing ./vendor/bin/sail is tedious. Add an alias to your shell configuration (.zshrc or .bashrc):

alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'

Reload your shell, and now you can just type sail up, sail artisan, etc.

5. VS Code Setup

Install these extensions:

Next: Module 1 - Modern PHP & Setup →