Skip to content

Instantly share code, notes, and snippets.

@jonahgeek
Last active April 26, 2023 03:52
Show Gist options
  • Save jonahgeek/c0497c02291192afe74367c337a1452e to your computer and use it in GitHub Desktop.
Save jonahgeek/c0497c02291192afe74367c337a1452e to your computer and use it in GitHub Desktop.
Install Laravel on Ubuntu 20.04

Step 1

Open terminal and type

$ sudo apt update

Step 2

Install apache web server

$ sudo apt install apache2

Step 3

Check whether apache server is running

$ systemctl status apache2

Step 4

Install php

$ sudo apt install libapache2-mod-php php php-common php-xml php-gd 
php-opcache php-mbstring php-tokenizer php-json php-bcmath php-zip unzip

Step 5

Install curl & composer

$ sudo apt install curl
$ curl -s5 https://getcomposer.org/installer | php

Check for version

$ composer --version

Step 6

Install laravel

$ composer global require laravel/installer

Step 7

Add bin directory to PATH environment through the ~/.bashrc configuration

$ sudo nano ~/.bashrc

Add the following line at the end of the file & save

export PATH="$HOME/.config/composer/vendor/bin:$PATH"

Step 8

Reload bashrc

source ~/.bashrc

Step 9

Create your new laravel project

laravel new awesomeapp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment