How to Run Laravel Project on Different Port?

By Hardik Savani April 16, 2024 Category : Laravel

Here, I will show you how to run the laravel project on different port. you'll learn run laravel project on different port . Here you will learn laravel run project on different port. This post will give you a simple example of php artisan serve --port. Alright, let’s dive into the steps.

We can run the laravel project using "php artisan serve" command. It will use by default 8000 port to run the laravel app. But you want to run laravel project on a different port then the artisan command provides an option called "--port" and you can run the laravel app in a different port.

So, let's see below the commands to run the laravel app with different ports. you can use a different port to laravel 6, laravel 7, laravel 8, laravel 9, laravel 10 and laravel 11 versions as well.

Run Laravel Project Command:

php artisan serve

URL:

http://localhost:8000

Run Laravel Project with Different Port Command:

php artisan serve --port=8080

URL:

http://localhost:8080

Run Laravel Project with Different Port and Host Command:

php artisan serve --host=localhost --port=8080

URL:

http://localhost:8080

I hope it can help you...

Tags :
Shares