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.
If a composer is not in there in your system.
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.
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 “
Now move to installed Laravel directory.
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.
Step 5 : Run Laravel
Just start the Laravel service by executing the following command in your terminal.
php artisan 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.
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:-