How to install Laravel 5.X

By | January 3, 2019

Hello Coders !! This tutorial is about How to install laravel 5.X in your ubuntu system using the terminal commands.

Laravel uses a composer for managing dependencies.

Step 1 : Install Composer

The first step is to install composer

The first and foremost thing is to make sure that you have a composer already installed in your local system. You can check this by typing “composer” in command.

Already installed composer should look like this.

composer-list

If a composer is not in there in your system.

Now you just need to visit the composer site you can find them below. You just need to go there and install it in your system.

https://getcomposer.org/download/

Stpe 2 : Install Laravel

The initial step for Laravel 5.X installation

Open directory path in your terminal.

There is a possibility that you don’t know about your working directory. So in ubuntu, it will be like this “/var/www/html/(project)”.

So you can find yours according to your setup.

composer create-project laravel/laravel --prefer-dist

Here we write the folder name “laravel” so in laravel folder the setup will be installed just like below screenshot.

installation

After the installation output of installation, the command is shows like above and is there is no error that means the Laravel framework successfully installed in “laravel” directory.

Now move to installed Laravel directory.

cd-laravel

Step 3 : Database Setup

MySql database setup

Open the “.env” from the root directory and add the database credential there.

It will look like this

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=database
DB_USERNAME=root
DB_PASSWORD=123

Here you can add your database name, username, and password, etc.

Step 4 : Composer Install

When you run below stated command. It will download all the required dependency.

composer install

Step 5 : Run Laravel

Just start the Laravel service by executing the following command in your terminal.

php artisan serve
php-artisa-serve

Step 6 : Run Setup

You are almost ready now just follow this step.

Now copy the URL from the above screenshot and open that URL in the browser.

Then you can see the following screen, it implies Laravel has been installed successfully.

laravel-home-page

Congratulations you have successfully installed Laravel and now you know how to install Laravel 5.this. For more Laravel articles visit this Link

Here is the video link of the tutorial How to install Laravel 5.X:-

14 thoughts on “How to install Laravel 5.X

Leave a Reply

Your email address will not be published. Required fields are marked *