Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save zunayed-arp/80ba8611a88623c20f9bb6c7b4e25792 to your computer and use it in GitHub Desktop.

Select an option

Save zunayed-arp/80ba8611a88623c20f9bb6c7b4e25792 to your computer and use it in GitHub Desktop.
How to install Laravel globally in Ubuntu

How to install Laravel globally in Ubuntu

===================================================================

Open your terminal using Ctrl+Alt+T and type the following commands

Step 1: Install Laravel

composer global require "laravel/installer"

Step 2: Add composer to path to access laravel globally

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

Step 3: Create a new Laravel application

laravel new blog

Step 4: Install missing packages and their dependencies

cd blog
composer install

Step 5: Test the application

php artisan serve

Open a web browser and visit localhost:8000 to see the laravel welcome page

Step 6: Stop server

Terminate php server in terminal by pressing Ctrl+C

Thus you have successfully installed laravel globally.

@meetwitchukx

meetwitchukx commented Jul 15, 2022

Copy link
Copy Markdown

Install Laravel

composer global require laravel/installer

composer global require "laravel/installer"
Edit environment config,

nano .bashrc

Then add,

export PATH="$PATH:$HOME/.config/composer/vendor/bin"
Then reload path config,

source ~/.bashrc

That finally worked.

@Noxxe-0001

Copy link
Copy Markdown

Is there anyway to only create the projects using the larvel 9 installer rather than the latest one.

@edglz

edglz commented May 4, 2023

Copy link
Copy Markdown

Thanks!

@govind663

Copy link
Copy Markdown

I extend my heartfelt gratitude for your invaluable guidance. Your wisdom and support have illuminated my path, making a profound impact on my journey. Thanks to your insights, I feel better equipped to navigate challenges and pursue success. Your generosity in sharing knowledge is truly appreciated. I am fortunate to have you as a mentor.

@ronald-kimeli

Copy link
Copy Markdown

Install Laravel

composer global require laravel/installer

composer global require "laravel/installer" Edit environment config,

nano .bashrc

Then add,

export PATH="$PATH:$HOME/.config/composer/vendor/bin" Then reload path config,

source ~/.bashrc

That finally worked.

While Using zshell

sudo nano ~/.zshrc

then add line above at the end then refresh

sudo source ~/.zshrc

@matos-julio

Copy link
Copy Markdown

Thank you! Works fine for me on ubuntu 24.04

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