Skip to content
On this page

Accessing Isolated Forge Sites

With User Isolation enabled, each site runs under its own unique system user. To manage these sites via CLI, you must first identify the username and then switch to that user after connecting.


1. Find the Username in Forge

Before logging in, you need to identify which user "owns" the site:

  1. Log into your Laravel Forge dashboard.
  2. Select the Server, then click on the specific Site.
  3. On the Site Overview page, look for the Site User on the right hand side under details.
  4. Copy this username (e.g., site_user_123).

2. SSH into the Server

Connect to your server using the primary forge user:

bash
ssh forge@your-server-ip

3. Switch to the Site User

Switch to the site-specific user using the -l (login) flag. This ensures the user's home directory, .bashrc, and environment variables (like the correct PHP version) are loaded.

bash
sudo su -l site_user_123

Why use -l?

  • Environment: It loads the user's specific $PATH.
  • Directory: It automatically moves you to that user's home directory.
  • Permissions: Any files you create (logs, cache, uploads) will be owned by the site user, not root or forge.

🛠 Troubleshooting & Navigation

  • Verify Identity: Run whoami to confirm you are logged in as the site user.
  • Exit: Type exit to drop back to the forge user, and exit again to close the SSH connection.