How to Install and Run Laravel Project on Localhost?
Hello Guys,
This tutorial is focused on how to run laravel project on localhost. I would like to share with you how to run laravel project on localhost in ubuntu. we will help you to give an example of how to install and run laravel project on localhost. I explained simply about laravel install and run localhost. Alright, let us dive into the details.
In this post, i will show you how to install laravel in ubuntu using composer. you can easily install laravel in ubuntu 16.04, ubuntu 18.04 and ubuntu 19.04 version. we can install laravel 6, laravel 7, laravel 8, laravel 9, laravel 10 and laravel 11 using composer command.
I will give you step by step instruction of how to install laravel in ubuntu os. so you have to just follow bellow step to installing laravel in ubuntu.
First you can see basic information of what is laravel let's see:
What is Laravel?
Laravel is a free open source PHP framework based on the MVC pattern. It's creatd by Taylor Otwell. Laravel provides expressive and elegant syntax that helps in creating a wonderful web application easily and quickly.
You can follow bellow step to install laravel in ubuntu:
Install Composer:
First step, we need to install composer. we must have to install composer in ubuntu system. you can install composer in your ubuntu system by using following command:
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composer
Laravel Requirements:
You must have some basic requirement of your ubuntu system. so you can see bellow basic requirement as listed bellow:
PHP >= 7.2.0
BCMath PHP Extension
Ctype PHP Extension
JSON PHP Extension
Mbstring PHP Extension
OpenSSL PHP Extension
PDO PHP Extension
Tokenizer PHP Extension
XML PHP Extension
Install Laravel:
Now you can run bellow command to install laravel project in your ubuntu system. so let's run bellow command:
composer create-project --prefer-dist laravel/laravel blog
You can see bellow screen shot of your terminal:
Now it's install completed.
But if you have any permission issue then you can give permission to your storage folder as like bellow:
sudo chmod -R 777 storage
sudo chmod -R 777 bootstrap
Now we are ready to run project using serve command:
php artisan serve
Now you can open url as bellow:
http://localhost:8000
You can see layout as bellow:
I hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- Laravel Send Scheduled Emails Tutorial
- Laravel Contact Form Send Email Tutorial
- Laravel Google ReCaptcha V3 Tutorial Example
- How to Add Password Protection for PDF File in Laravel?
- How to Change From Name in Laravel Mail?
- Laravel Two Factor Authentication using Email Tutorial
- How to Create and Use Stored Procedure in Laravel?
- Laravel Migration Add Enum Column Example
- Laravel Razorpay Payment Gateway Example
- Laravel Livewire Wizard Form Example
- Laravel Carbon Get Current Date Time Example
- Laravel Carbon Subtract Minutes Example
- Laravel Eloquent Where Query Examples