Prerequisites
First, follow the Creating an organization and Creating an application steps in our quick start guide to begin.Automatic integration (recommended)
Laravel Forge offers built-in support for Nightwatch. Get setup in minutes:- Navigate to the Overview tab for a site that has
laravel/nightwatch
installed. - Click Connect Nightwatch.
- Add your environment token.
- Click Monitor with Nightwatch.
- Optionally configure logging.

Add your Nightwatch environment token and click 'Monitor with Nightwatch'
Manual integration
To ensure the agent runs as a continual process on your Forge server, we strongly recommend running the Nightwatch agent as a background process.Steps
- Navigate to the Environment section of the Settings tab for a site that has
laravel/nightwatch
installed. - Add your environment’s
NIGHTWATCH_TOKEN
and press Save. - Navigate to the Processes tab for the site.
- Click Add background process and select the Custom tab.
- Add the
nightwatch:agent
artisan command (see below example). - Optionally configure logging.
Example daemon configuration
Setting | Value |
---|---|
Name | Nightwatch |
Command | php artisan nightwatch:agent |
Working directory | /home/forge/example.com (your site path) |
Processes | 1 |
Graceful shutdown | 15 |

Configure the Nightwatch background process