← All writing
 ·  1 min read

Installing Laravel Forge CLI on macOS

Once installed, the Forge CLI gives you quick terminal access to your Laravel Forge servers and sites. Just make sure your $PATH is configured right — most issues I’ve run into came from that one step being skipped.

Installing Laravel Forge CLI on macOS

If you’re managing servers with Laravel Forge, the CLI tool makes life easier. But before you can use it, you need to get your system ready — especially on macOS where $PATH setup can get in the way.

Step 1: Add Composer’s global bin to your $PATH

Before installing Forge CLI, make sure your shell knows where to find it. You’ll need to update your shell config file to include Composer's global binary directory:

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

Where you put that line depends on the shell you use: For zsh (the default on macOS now):

bash
nano ~/.zshrc

Add the export PATH="$HOME/.config/composer/vendor/bin:$PATH" line to the bottom of the file, save, and then run:

bash
source ~/.zshrc

Step 2: Install the Forge CLI

Once your $PATH is set, install the Forge CLI globally using Composer:

bash
composer global require laravel/forge-cli

After installation, you can check that it worked by running:

bash
forge

You should see a list of available commands.

Step 3: Browse the Docs (Optional but Helpful)

The full CLI documentation is available here:
https://forge.laravel.com/docs/cli

Final Thoughts

Once installed, the Forge CLI gives you quick terminal access to your Laravel Forge servers and sites. Just make sure your $PATH is configured right — most issues I’ve run into came from that one step being skipped.

Let me know if I should extend this with examples like deploying a site, restarting services, or linking your Forge account.