Install and Set Up Laravel on Windows Without Docker

Learn how to configure PHP, MySQL, Git, Node.js, NPM, and Composer on Windows and run a Laravel project locally, step by step.

Prerequisites: Required Software

Install the following software before running the Laravel project. Use the official download links below.

  • PHP — Runs the Laravel application.
  • MySQL — Stores application data.
  • Git — Downloads the project from GitHub.
  • Node.js and NPM — Manage frontend packages and assets.
  • Composer — Installs PHP dependencies.
Important: Add the required executable directories to the Windows PATH environment variable. Reopen the terminal after changing PATH. MySQL must be running when you connect to the database.

Step 1: Verify the Installation

Open Command Prompt or PowerShell and run these commands:

php -v
mysql --version
git --version
node -v
npm -v
composer --version

If a command is not recognized, verify that the software is installed and configured correctly in PATH. The MySQL command-line check requires the MySQL client to be available in PATH.

Step 2: Clone the Laravel Project

Download the project from GitHub:

git clone https://github.com/1970Mr/todo-app-laravel

Navigate into the project directory:

cd todo-app-laravel

Open the repository on GitHub ↗

Step 3: Install PHP Dependencies

Install the PHP packages required by the project using Composer:

composer install

Wait for the installation to complete before moving to the next step.

Step 4: Install Node.js Dependencies

Install the frontend dependencies:

npm install

Step 5: Create the Environment File

Create a copy of .env.example named .env.

Windows Command Prompt:

copy .env.example .env

PowerShell:

Copy-Item .env.example .env

Generate the Laravel application key:

php artisan key:generate

Step 6: Create and Configure the MySQL Database

Start the MySQL service and create a database named todo_app using MySQL Workbench or another database management tool.

You can also run this SQL statement in a MySQL query window:

CREATE DATABASE todo_app;

Open the .env file in your project directory and update the database settings:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=todo_app
DB_USERNAME=your_database_username
DB_PASSWORD=your_database_password
Replace the example username and password with your actual MySQL credentials. If your MySQL account has no password, leave the value after DB_PASSWORD= empty.

Step 7: Run Database Migrations

Create the tables required by the application:

php artisan migrate

If the command fails, confirm that the database exists, MySQL is running, and the credentials in .env are correct.

Step 8: Compile Frontend Assets

Start the frontend development process:

npm run dev

Keep this terminal open while developing if the project uses Vite to serve its frontend assets.

Step 9: Start the Laravel Development Server

Open a second terminal in the project directory and run:

php artisan serve

The development server usually runs at:

http://localhost:8000

Step 10: Open Your Laravel Application

Open the following address in your browser:

Open Laravel Application ↗

Your Laravel application should now be running locally on Windows without Docker.

Common Errors and Solutions

1. PHP Is Not Recognized

Add the PHP installation directory to Windows PATH, then reopen your terminal.

2. Composer Is Not Recognized

Install Composer and ensure it is accessible through PATH.

3. NPM Is Not Recognized

Install Node.js, check PATH, and reopen the terminal.

4. MySQL Connection Failed

Verify that MySQL is running and the database name, username, password, host, and port are correct.

5. Laravel Application Key Is Missing

Run the following command from the project directory:

php artisan key:generate

6. Database Migration Failed

Confirm that the database exists and the configured MySQL user has permission to create and modify tables.

Conclusion

You have learned how to configure PHP, MySQL, Git, Node.js, NPM, and Composer on Windows and run a Laravel project without Docker.

For the complete practical demonstration, watch the video and follow each step.

Watch the YouTube Tutorial ▶

More Tutorials: Visit Webdox Computer Institute for tutorials on PHP, Laravel, MySQL, web development, and deployment.