CMD / Laravel
To run a Laravel project using CMD (Command Prompt / Terminal), follow these steps:
Steps to Run Laravel from CMD
Open CMD / Terminal
On Windows:
Win + R
, typecmd
, then press Enter.On macOS/Linux: open your terminal.
Navigate to Your Laravel Project Folder
cd path\to\your\laravel\project
Example:
cd C:\xampp\htdocs\my-laravel-app
Check if Composer is Installed
composer -V
If not installed, download it here: https://getcomposer.org/download/
Install Laravel Dependencies Run inside your project folder:
composer install
Set Application Key (first time only)
php artisan key:generate
Run Database Migrations (if you have migrations)
php artisan migrate
Start the Laravel Development Server
php artisan serve
By default, it runs at:
http://127.0.0.1:8000
Common Issues
If
php
is not recognized → install PHP or add it to PATH.If
composer
is not recognized → install Composer globally.If you want to stop the server → press CTRL + C in CMD.
Last updated
Was this helpful?