Install Laravel on Ubuntu with 4 simple steps

If you are looking to start your journey of Laravel, then this article is for you. You will learn to install Laravel one of the most popular PHP Framework currenly in Ubuntu Operating System.

The OS I am using is Ubuntu 18.04 and we will be installing Laravel 5.8 on it.

Step 1 : Server Requirements

As you know, your local machine will act as server during the development phase. And the system should have the following component before we start installing Laravel in it.

  • PHP (Greater than or equal to version 7.1.3)
  • BCMath PHP Extension
  • Ctype PHP Extension
  • JSON PHP Extension
  • Mbstring PHP Extension
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension

Use the following commands in your terminal to install required components

Install PHP

sudo apt-get install php

Install BCMath PHP Extension

sudo apt-get install php-bcmath

Install Mbstring PHP Extension

sudo apt-get install php-mbstring

Install XML PHP Extension

sudo apt-get install php-xml

After the above mentioned components/extensions are installed, we will need to install composer.

Step 2 : Install Composer

sudo apt install composer

Finally, we can now install Laravel and create a new project.

Step 3 : Install Laravel and Create New Project

composer create-project --prefer-dist laravel/laravel {PATH_TO_PROJECT}/PROJECT_NAME

Step 4 : Start a Local Development Server

Its time to run our development server and jump into programming with this single line of command :

php artisan serve

Follow this video for complete guidance :

 

Hope you got your first Laravel project running. Stay Tuned with us for more tutorials on Laravel.



Recommended For You

About the Author: Admin