Dev Leak
Press ( / )
Subscribe Sign In
home Home popular Popular topics Topics mail Newsletter
Topic: Laravel Laravel Topic: Animation Animation Topic: Docker Docker Topic: Fundamentals Fundamentals Topic: Debugging Debugging Topic: Web Web
home Home popular Popular topics Topics mail Newsletter
Topic: Laravel Topic: Animation Topic: Docker Topic: Fundamentals Topic: Debugging Topic: Web
Getting Started With Laravel and WSL2
2 min read

Getting Started With Laravel and WSL2

Simplifying Laravel Development on Windows with WSL2 and Laravel Sail

March 11, 2023

1k Views
david

david

20 Posts

mail-dark Newsletter

Getting Started With Laravel and WSL2

Simplifying Laravel Development on Windows with WSL2 and Laravel Sail

david

david

20 Posts

mail-dark Newsletter

March 11, 2023

1k Views

Say Thanks

Buy a Thanks, and directly support content like this.

Card Information

check-green Thank you for supporting! A receipt will be sent to your email

Why WSL2

WSL2 is the preferred environment on Windows to develop a Laravel application. Laravel offers a first-party package that simplifies working with your application in a dockerized environment.

Laravel Sail is a lightweight command-line interface for interacting with Laravel's default Docker development environment. Sail provides a great starting point for building a Laravel application using PHP, MySQL, and Redis without requiring prior Docker experience.

Out of the box, Laravel Sail includes services such as:

  • PHP
  • MySql
  • Redis
  • MailPit
  • Meilisearch
  • Selenium

You get all of this for free just by using Laravel Sail in WSL2.

But First

To get started you need to have the following installed:

  • WSL2 installed and enabled
  • Access to your WSL2 from a command line application
  • Docker Desktop that is configured to use the WSL2 backend

Let's Download

Launch your Windows Terminal and begin a terminal session in WSL2. To create a laravel application in the command line use the following command:

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

This does two things:

  1. A directory call my-app is created
  2. Files are downloaded to the new my-app directory

Naturally you can replace my-app with whatever name you like.

Let's Get Our Application Running

In your command line navigate to your freshly created folder. In this case it would look like this:

cd my-app

./vendor/bin/sail up

If this is the first time you run sail up, it will probably take a while to download the docker images.

Once it is done, you can view your new app in your web browser at http://localhost.


Note: if you have any problems relating permission errors you, check out this article:

Foo Fixing Permission Errors with Laravel Sail

unlocked-white Subscribe for exclusive content
Run Laravel Sail in PhpStorm Run Laravel Sail in PhpStorm
1 min

Run Laravel Sail in PhpStorm

david

2k Views 2 years ago

Run Laravel Sail in PhpStorm
2 min

Run Laravel Sail in PhpStorm

david

2k Views 2 years ago

Fixing Permission Errors with Laravel Sail
1 min

Fixing Permission Errors with Laravel Sail

david

2k Views 2 years ago

Five Clever Ways to Use the chunk Method
11 min

Five Clever Ways to Use the chunk Method

david

2k Views 2 years ago

Using Macros to Simplify Migrations
2 min

Using Macros to Simplify Migrations

david

1k Views 2 years ago

Run PhpUnit in PhpStorm Run PhpUnit in PhpStorm
1 min

Run PhpUnit in PhpStorm

david

1k Views 2 years ago

A String Helper for Apostrophes
2 min

A String Helper for Apostrophes

david

1k Views 2 years ago

3 Examples of When to Use @unless
5 min

3 Examples of When to Use @unless

david

1k Views 2 years ago

When to Use chunkWhile(): 5 examples
14 min

When to Use chunkWhile(): 5 examples

david

1k Views 2 years ago

Five Ways to Use the Reject Method
10 min

Five Ways to Use the Reject Method

david

1k Views 2 years ago

Blade Templates | All the Ways to Pass Data to views
9 min

Blade Templates | All the Ways to Pass Data to views

david

1k Views 2 years ago

Five Smart Ways to Use Collapse
11 min

Five Smart Ways to Use Collapse

david

1k Views 2 years ago

Choose your Sail Services
1 min

Choose your Sail Services

david

1k Views 2 years ago

A String Helper For Estimating Read Time
2 min

A String Helper For Estimating Read Time

david

1k Views 2 years ago

Setup PHPUnit in PhpStorm for a Laravel Project
1 min

Setup PHPUnit in PhpStorm for a Laravel Project

david

1k Views 2 years ago

5 Powerful Ways to Use the all() method
9 min

5 Powerful Ways to Use the all() method

david

1k Views 2 years ago

Five Ways to Use the Combine Method
11 min

Five Ways to Use the Combine Method

david

1k Views 2 years ago

Docker Volumes Explained
11 min

Docker Volumes Explained

david

1k Views 2 years ago

WhereLikeIn() Helper
6 min

WhereLikeIn() Helper

Tricia Blosser

976 Views 1 year ago

Related

Run Laravel Sail in PhpStorm Run Laravel Sail in PhpStorm
1 min

Run Laravel Sail in PhpStorm

Run Laravel Sail in PhpStorm

david

2k Views 2 years ago

Topics

Laravel Animation
Run Laravel Sail in PhpStorm
2 min

Run Laravel Sail in PhpStorm

Streamlining Development with PhpStorm: Use your IDE to run Laravel Sail for a better experience.

david

2k Views 2 years ago

Topics

Laravel
Fixing Permission Errors with Laravel Sail
1 min

Fixing Permission Errors with Laravel Sail

Avoid Common Permission Errors with Laravel Sail

david

2k Views 2 years ago

Topics

Laravel Debugging
Five Clever Ways to Use the chunk Method
11 min

Five Clever Ways to Use the chunk Method

Harnessing the Power of the chunk() Method for Efficient Data Manipulation in Laravel Collections

david

2k Views 2 years ago

Topics

Laravel
Using Macros to Simplify Migrations
2 min

Using Macros to Simplify Migrations

How to add helper methods to the Blueprint Facade.

david

1k Views 2 years ago

Topics

Laravel
Run PhpUnit in PhpStorm Run PhpUnit in PhpStorm
1 min

Run PhpUnit in PhpStorm

david

1k Views 2 years ago

Topics

Laravel Animation
A String Helper for Apostrophes
2 min

A String Helper for Apostrophes

Effortlessly Converting Words to Possessive Forms with Laravel's String Class

david

1k Views 2 years ago

Topics

Laravel
3 Examples of When to Use @unless
5 min

3 Examples of When to Use @unless

When to use the @unless directive in Laravel's Blade Templates with three examples.

david

1k Views 2 years ago

Topics

Laravel
When to Use chunkWhile(): 5 examples
14 min

When to Use chunkWhile(): 5 examples

Mastering the ChunkWhile Method in Laravel Collections: 5 Practical Examples

david

1k Views 2 years ago

Topics

Laravel
Five Ways to Use the Reject Method
10 min

Five Ways to Use the Reject Method

Leveraging the Power of Laravel Collections: 5 Practical Applications of the 'Reject' Method

david

1k Views 2 years ago

Topics

Laravel
Blade Templates | All the Ways to Pass Data to views
9 min

Blade Templates | All the Ways to Pass Data to views

All the ways to pass data to Laravel Blade Templates: A comprehensive guide

david

1k Views 2 years ago

Topics

Laravel
Five Smart Ways to Use Collapse
11 min

Five Smart Ways to Use Collapse

Smart Ways to use the Collapse Method in Laravel Collections: 5 Practical Examples

david

1k Views 2 years ago

Topics

Laravel
Choose your Sail Services
1 min

Choose your Sail Services

Customizing Your Laravel Application with Sail: Selecting and Configuring Services for Your Docker-Compose File

david

1k Views 2 years ago

Topics

Laravel
A String Helper For Estimating Read Time
2 min

A String Helper For Estimating Read Time

Enhancing User Experience with a Custom Reading Time Estimator in Laravel

david

1k Views 2 years ago

Topics

Laravel
Setup PHPUnit in PhpStorm for a Laravel Project
1 min

Setup PHPUnit in PhpStorm for a Laravel Project

Setup PHPUnit in PhpStorm for a Laravel Project

david

1k Views 2 years ago

Topics

Laravel
5 Powerful Ways to Use the all() method
9 min

5 Powerful Ways to Use the all() method

Harnessing the Power of the all() Method for Efficient Data Manipulation in Laravel Collections

david

1k Views 2 years ago

Topics

Laravel
Five Ways to Use the Combine Method
11 min

Five Ways to Use the Combine Method

Leveraging the Power of Laravel Collections: 5 Neat Ways to Use the 'Combine' Method

david

1k Views 2 years ago

Topics

Laravel
Docker Volumes Explained
11 min

Docker Volumes Explained

Demystifying Docker Volumes: What they are and How to use them

david

1k Views 2 years ago

Topics

Docker Fundamentals
WhereLikeIn() Helper
6 min

WhereLikeIn() Helper

Create a macro that loops through columns and search term strings on a Database Eloquent Builder.

Tricia Blosser

976 Views 1 year ago

Topics

Laravel
popular Popular topics Topics mail Newsletter

Footer

Dev Leak

Membership

  • Login
  • Newsletter
  • Subscribe

Support

  • Contact

Pages

  • Home
  • Search
  • Popular
  • Topics

Legal

  • Privacy Policy
  • Terms of Service

© 2025 DevLeak. All rights reserved.