How to Install Laravel 9 on Ubuntu 20.04

How to Install Laravel 9 on Ubuntu 20.04

Laravel 9 has been released with many new features added, including controller route groups, default Ignition error page, Laravel Scout database engine, Symfony mailer integration, Flysystem 3.x, improved Eloquent accessors/mutators, and many more.

Starting from Laravel 9, a major version of Laravel will be released every 12 months which was previously every 6 months. Laravel 9 is an LTS (Long Term Support) version that will get bug fixes support until 8 February 2024 and security fixes support until 8 February 2025.

For information on the Laravel 9 release read the Release Notes.

Server Requirements

Server requirements especially PHP that must be met to be able to run Laravel 9:

  • PHP >= 8.0
  • BCMath PHP Extension
  • Ctype PHP Extension
  • DOM PHP Extension
  • Fileinfo PHP Extension
  • JSON PHP Extension
  • Mbstring PHP Extension
  • OpenSSL PHP Extension
  • PCRE PHP Extension
  • PDO PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension

Install PHP

The default repository for Ubuntu 20.04 only provides PHP v7.4. Therefore it requires an additional repository for the latest PHP.

Installing the ppa:ondrej/php repository.

Install PHP 8.1 and its extensions.

Verify the PHP installation.

Install Composer

Install Composer.

Verify Composer installation.

Install Laravel

Install Laravel 9.0 using Composer and save it in the webapp folder.

Running Laravel development server.

The result of the above command.

If using a VPS and want to access it via Public IP add –host.

Laravel berjalan di development server
Laravel runs on the development server

Leave a Reply

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