How to Set Up Laravel on Windows

Published on January 13, 2025 by Aman K Sahu

Laravel is one of the most popular PHP frameworks for modern web applications. This guide will help you set up Laravel on a Windows machine step by step.

1. Install XAMPP

XAMPP is a free and open-source cross-platform web server solution that includes Apache, MySQL, PHP, and Perl.

Install XAMPP:
1. Visit https://www.apachefriends.org/.
2. Download the installer for Windows.
3. Run the installer and follow the setup wizard.
4. Start Apache and MySQL from the XAMPP Control Panel.
                        

2. Install Composer

Composer is a dependency manager for PHP and is required to install Laravel.

Install Composer:
1. Visit https://getcomposer.org/.
2. Download and run the Composer-Setup.exe file.
3. Follow the instructions to install Composer globally.
4. Verify installation by running `composer -V` in the command prompt.
                        

3. Install Laravel

Now that Composer is installed, you can create a new Laravel project.

Install Laravel:
1. Open a terminal and navigate to the desired directory.
2. Run the command: `composer create-project --prefer-dist laravel/laravel my-app`
3. Navigate to your new project: `cd my-app`
4. Start the development server: `php artisan serve`
5. Open your browser and visit `http://localhost:8000`.
                        

4. Test Your Setup

After completing the steps above, your Laravel application should be running successfully. Visit the URL displayed in the terminal to view your application.

More Blogs