So you just cloned a Laravel project from GitHub, but the app isn’t working on your local system? Don’t worry — you’re not alone. Every Laravel developer goes through this the first time.
In this guide, we’ll walk through step-by-step how to set up a Laravel project locally after git clone. This works on Windows, macOS, and Linux.
✅ Beginner-friendly ✅ Copy-paste ready commands
1. Clone the Laravel Project
Open your terminal and clone the repo:
git clone https://github.com/your-username/your-laravel-project.git
cd your-laravel-project
2. Install PHP Dependencies
Laravel uses Composer to manage PHP packages. Run:
composer install
If you see composer command not found, install it first: Composer Install
3. Cre…
So you just cloned a Laravel project from GitHub, but the app isn’t working on your local system? Don’t worry — you’re not alone. Every Laravel developer goes through this the first time.
In this guide, we’ll walk through step-by-step how to set up a Laravel project locally after git clone. This works on Windows, macOS, and Linux.
✅ Beginner-friendly ✅ Copy-paste ready commands
1. Clone the Laravel Project
Open your terminal and clone the repo:
git clone https://github.com/your-username/your-laravel-project.git
cd your-laravel-project
2. Install PHP Dependencies
Laravel uses Composer to manage PHP packages. Run:
composer install
If you see composer command not found, install it first: Composer Install
3. Create .env File
Copy the sample environment file:
cp .env.example .env
Windows users:
copy .env.example .env
Now open .env and update:
- Database name
- Database username
- Password
Example:
DB_DATABASE=laravel_app
DB_USERNAME=root
DB_PASSWORD=
4. Generate Application Key
php artisan key:generate
This secures your session & app data.
5. Run Database Migrations (If applicable)
php artisan migrate
If you see database errors, make sure the DB exists. Create it manually or via command (MySQL):
CREATE DATABASE laravel_app;
6. Link Storage (For uploads & images)
php artisan storage:link
7. Install Node Dependencies (If project has frontend)
npm install
npm run dev # or npm run build for production
8. Serve the Project
Start Laravel local server:
php artisan serve
Open in browser:
http://127.0.0.1:8000
🎉 Your Laravel app is running!
🧠 Common Errors & Fixes
| Error | Quick Fix |
|---|---|
Class not found | Run composer dump-autoload |
.env file not loading | Delete cache: php artisan config:clear |
500 error after migration | Check DB credentials & run php artisan migrate:fresh |
npm not found | Install Node.js: https://nodejs.org/ |
✅ Final Checklist
| Task | Status |
|---|---|
| Clone project | ✅ |
| Install composer deps | ✅ |
Setup .env | ✅ |
| Generate key | ✅ |
| Run migrations | ✅ |
| Install npm | ✅ |
| Run server | ✅ |
🎯 Conclusion
Setting up a Laravel project locally after cloning is simple once you know the process:
| Task | Command |
|---|---|
| Clone project | git clone 'link projer github' |
| Install composer deps | composer install |
Setup .env | cp .env.example .env or copy .env.example .env |
| Configure DB | Now open .env and update: Database name, Database username, Password |
| Generate key | php artisan key:generate |
| Run migrations | php artisan migrate |
| Install npm(optional) | npm install |
| Run server | php artisan serve |
Bookmark this guide — it will save you time on every project!
💬 Have Questions?
Drop a comment — happy to help! And if you found this useful, smash the ❤️ and follow for more Laravel tips.
🔁 Bonus: Full Setup Script (Linux/Mac)
git clone repo-url project
cd project
composer install
cp .env.example .env
php artisan key:generate
npm install && npm run dev
php artisan migrate
php artisan serve