Laravel Setup Guide on Linux (Zsh-Based)

Oct 10, 2026
By Admin
2 min read
72 views
Laravel Setup Guide on Linux (Zsh-Based)

Laravel Setup Guide on Linux (Zsh-Based)

Prerequisites

Before starting, make sure your system has the following installed:

  • PHP 8.1 or higher (including extensions like mbstring, curl, openssl, pdo, etc.)
  • Composer (dependency manager for PHP)
  • Git
  • Zsh shell (you’re already using it)

Install them (on Debian/Ubuntu-based distros):

sudo apt update
sudo apt install php php-cli php-mbstring php-xml php-bcmath php-curl php-zip unzip curl git zsh

💡 Tip: You can check PHP version with php -v and Composer version with composer -V.


Step 1: Install Laravel Installer Globally

Run this command:

composer global require laravel/installer

This installs the Laravel installer in the Composer global directory.


Step 2: Add Composer's Global Bin to Your PATH

Your global Laravel command is located at:

/home/your-username/.config/composer/vendor/bin

To make the laravel command available system-wide, add this path to your ~/.zshrc.

  1. Open .zshrc:
 nano ~/.zshrc
  1. Add the following line at the end:
 export PATH="$HOME/.config/composer/vendor/bin:$PATH"
  1. Save and exit: CTRL + O, Enter, then CTRL + X.
  2. Reload your terminal config:
 source ~/.zshrc

Step 3: Verify Laravel Installer

Now confirm it's working:

laravel --version

You should see:

Laravel Installer 5.16.0

Step 4: Create a New Laravel Project

Navigate to your development directory and run:

laravel new project-name

Example:

cd ~/projects
laravel new example-app

This will create a new Laravel app in ~/projects/example-app.


Step 5: Serve the Application (Local Dev Server)

You can start Laravel's built-in development server:

cd example-app
php artisan serve

By default, it runs at:
📍 http://localhost:8000


Optional: Run Laravel with Sail (Docker)

If you prefer a Docker-based dev environment:

  1. Navigate to your Laravel app folder:
 cd example-app
  1. Install Sail:
 composer require laravel/sail --dev
  1. Generate Sail files:
 php artisan sail:install
  1. Start Sail:
 ./vendor/bin/sail up

📌 Bonus Tips

  • Run composer install after cloning a Laravel project.
  • Set correct permissions for storage/ and bootstrap/cache/:
  sudo chmod -R 775 storage bootstrap/cache
  • Use .env to configure your database, email, etc.

📎 Common Commands

Command Description
php artisan serve Run local dev server
php artisan migrate Run database migrations
php artisan make:controller Name Create a new controller
php artisan route:list List all routes
composer update Update dependencies

Share this article:
Back to Blog

More Engineering Articles

View All

Ready to Engineer Scalable Systems for Your Enterprise?

Our engineering team builds custom ERPs, ISP billing platforms, fintech automation, and cloud architectures tailored to your business.

Get in Touch