How to run laravel 5.0 project on localhost without use php artisan serve
Stefan Izdrail
Founder & Senior Architect · 2026-06-29
Title: Effortlessly Run Laravel 5.0 Projects on Localhost without PHP Artisan Serve
Body:
Introduction
Laravel is an incredibly popular PHP framework that helps developers create powerful web applications quickly and efficiently. One of the most important tasks after creating a Laravel project is running it on localhost for further development. While PHP Artisan serve is the traditional way to do this, this post will discuss alternative methods to run your 5.0 project without using PHP Artisan Serve.
Alternative Methods
1. Using Apache or Nginx with Virtual Host Configuration:
To use Apache or Nginx as a web server, first install them on your local machine if not already done. Next, set up virtual host configuration to run Laravel applications as follows:
For Apache:
- Create a new file called .htaccess in the root directory of your project.
- Add the following lines to this file:
```
RewriteEngine On
# Handle Front Controller...
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
```
- Open your Apache configuration file (usually located in /etc/apache2/sites-available) and add the following lines:
```
ServerAdmin webmaster@localhost
DocumentRoot "/path/to/your_laravel_project/public"
ServerName localhost.dev
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
```
- Restart Apache to apply the changes by running "sudo service apache2 restart" on Linux or "sudo apachectl graceful" on MacOS.
- Browse your Laravel project using localhost.dev in your web browser.
For Nginx:
- Create a new file called nginx.conf in the root directory of your project.
- Add the following lines to this file:
```
server {
listen 80;
server_name localhost.dev;
root /path/to/your_laravel_project/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
}
```
- Update your nginx configuration file (usually located at /etc/nginx/sites-available) by enabling the server block:
```
include /etc/nginx/conf.d/laravel5project.conf;
```
- Restart Nginx to apply the changes with "sudo service nginx restart" on Linux or "sudo nginx -s reload" on MacOS.
- Browse your Laravel project using localhost.dev in your web browser.
2. Using Valet (Laravel Homestead Alternative):
Valet is a lightweight alternative to the Laravel Homestead virtualization solution. It allows you to use the 'valet execute' command to run any Laravel project on a local domain without using PHP Artisan Serve. Installation instructions and a guide can be found at the following link: https://laravelcompany.com/blog/posts/introducing-valet-a-modern-laravel-development-environment
3. Using Docker with Laradock (Dedicated Environment):
Laradock is an all-in-one solution for running your Laravel applications using Docker containers, simplifying the setup of a development environment on Linux, Windows, or macOS. Full installation and configuration instructions are available at the following link: https://laravelcompany.com/blog/posts/setting-up-laradock-to-develop-on-your-local-machine
4. Using XAMPP (All-in-One Solution):
XAMPP is an easy-to-use and convenient environment for running Laravel 5.0 projects, as it comes with Apache, MySQL, PHP, and many other useful tools preinstalled on your system. Simply drop the extracted folder to any location on your computer, and run the XAMPP Control Panel to set up the server: https://laravelcompany.com/blog/posts/using-xampp-to-run-laravel-projects
Conclusion
There are several alternative methods available for running Laravel 5.0 projects without using PHP Artisan Serve, including Apache or Nginx with virtual host configuration, Valet, Docker with Laradock, and XAMPP. Each has its advantages in terms of simplicity, flexibility, and performance, so you can choose the one that best fits your project's needs and requirements. Remember to follow proper security practices and keep up-to-date with any updates for the selected solution to ensure a smooth experience developing Laravel projects on localhost.