Wednesday, March 9, 2022

How to Install Laravel in Ubuntu 22.04

 On this tutorial, we will install Laravel 9 in Ubuntu 22.04. Basically, you can replicate all of this step in many version and flavors of Ubuntu (like Kubuntu, Xubuntu, etc) and also all Debian-based distribution with binary compatibility version by Ubuntu.

We will utilize Composer as a dependency manager and package installer for PHP.
If you don't have composer installed, you can install it as easy as copy this script:

sudo apt install composer

or you can install completly bleding edge with the latest version:

sudo apt update
sudo apt install php8.0 php8.0-mbstring php8.0-xml php8.0-zip curl
curl -s | php
mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer

to install Laravel globally, you can type this command:

composer global require laravel/installer

the last step, add Laravel to bash environment.

nano ~/.bashrc
export PATH="$PATH:$HOME/.config/composer/vendor/bin"
source ~/.bashrc

And it's done, you can test by type laravel command



Post a Comment