How to Install Laravel 5.8 on Ubuntu 16.04/ 18.04

Most Popular PHP Framework Laravel has released new version Laravel 5.8. Here we have Laravel 5.8 tutorial to install on Ubuntu 16.04 or Ubuntu 18.04. There are simple steps which needed to follow to install Laravel 5.8 let’s look on these.

Server Requirement

We need some prerequisite before installing Laravel. Following requirement for server needed prior to installing Laravel. If you did not install the LAMP yet than install it first.

  • PHP >= 7.1.3
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension
  • Ctype PHP Extension
  • JSON PHP Extension
  • BCMath PHP Extension

Laravel utilizes Composer to manage its dependencies. So, before using Laravel, make sure you have Composer installed on your machine.

Install Laravel

Once you installed Composer we are ready to install Laravel using Create-Project command. See Below code:

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

Give Permission to Directory

After installing Laravel,  we need to give write permission to storage and bootstrap/cache.

chmod -R 777 storage
chmod -R 777 bootstrap/cache

Create environment  File

Now our next step is to create an environment file for our application. Its very simple just copy .env.example (It’s already available in the root of our application files) to .env

cp .env.example .env

Generate Application Key

Last we need to generate the key for our application using the following code.

php artisan key:generate 

It will generate a 32 character long string and assign to APP_KEY in the .env file. That’s it now we are ready to run our application.

Run the development Server

We are going to use PHP’s built-in development server for our application.

php artisan serve

This command will start a development server at You can also change this port like below.

php artisan serve --port=8001


Leave a Reply

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