Laravel8 Install in Windows
Laravelnote
Before we create a new Laravel application on your Windows machine, make sure to install Docker Desktop. Next, you should ensure that Windows Subsystem for Linux 2 (WSL2) is installed and enabled. WSL allows you to run Linux binary executables natively on Windows 10. Information on how to install and enable WSL2 can be found within Microsoft's developer environment documentation.
After installing and enabling WSL2, you should ensure that Docker Desktop is configured to use the WSL2 backend.
Next, you are ready to create your first Laravel project. Launch Windows Terminal and begin a new terminal session for your WSL2 Linux operating system. Next, you can use a simple terminal command to create a new Laravel project. For example, to create a new Laravel application in a directory named "example-app", you may run the following command in your terminal:
curl -s https://laravel.build/example-app | bash
Of course, you can change "example-app" in this URL to anything you like. The Laravel application's directory will be created within the directory you execute the command from.
After the project has been created, you can navigate to the application directory and start Laravel Sail. Laravel Sail provides a simple command-line interface for interacting with Laravel's default Docker configuration:
cd example-app
./vendor/bin/sail up
The first time you run the Sail up
command, Sail's application containers will be built on your machine. This could take several minutes. Don't worry, subsequent attempts to start Sail will be much faster.
Once the application's Docker containers have been started, you can access the application in your web browser at: http://localhost.
To continue learning more about Laravel Sail, review its complete documentation.
Developing Within WSL2 | Laravelnote
Of course, you will need to be able to modify the Laravel application files that were created within your WSL2 installation. To accomplish this, we recommend using Microsoft's Visual Studio Code editor and their first-party extension for Remote Development.
Once these tools are installed, you may open any Laravel project by executing the code .
command from your application's root directory using Windows Terminal.