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\projectExample:
cd C:\xampp\htdocs\my-laravel-appCheck if Composer is Installed
composer -VIf not installed, download it here: https://getcomposer.org/download/
Install Laravel Dependencies Run inside your project folder:
composer installSet Application Key (first time only)
php artisan key:generateRun Database Migrations (if you have migrations)
php artisan migrateStart the Laravel Development Server
php artisan serveBy default, it runs at:
http://127.0.0.1:8000
Common Issues
If
phpis not recognized → install PHP or add it to PATH.If
composeris not recognized → install Composer globally.If you want to stop the server → press CTRL + C in CMD.
Last updated
Was this helpful?