Prerequisites
First, follow the regular steps in our quick start guide to begin.Automatic Integration (Recommended)
Laravel Cloud offers built-in support for Nightwatch. Get set up in minutes:1
Install Nightwatch package
Install the Laravel Nightwatch package in your application locally using Composer:
Run
composer require laravel/nightwatch
on your local machine to update your composer.json
and composer.lock
files before deploying.2
Connect Nightwatch
Click the Connect Nightwatch button in your environment dashboard.
3
Enable monitoring
Toggle Enable monitoring to activate Nightwatch for your environment.

4
Enter your Nightwatch token
Enter your Nightwatch token, which you can find in your Nightwatch application settings.
Enabling Nightwatch will automatically run the agent across all the App
compute and Worker clusters in the environment. You can
setup Nightwatch manually if you want the
agent to run on specific instances.
If you have previously configured Nightwatch manually using background
processes, you must remove these processes from every cluster before enabling
the built-in integration to avoid issues with your environment.
Manual Integration
You can also manually integrate Nightwatch with Laravel Cloud by adding a background process to each App compute and Worker cluster.Add Your Environment Variables
Before running the agent, you’ll need to add environment variables to your Cloud environment. Follow Laravel Cloud’s guide on managing environment variables to get started.Running the Agent
To run the agent in your Cloud application cluster, follow these simple steps: Steps- Select your application cluster
- Click New background process
- Choose Custom worker
- Enter
php artisan nightwatch:agent
as the command - Save your changes and redeploy
Note: If you’re using a dedicated worker cluster, please repeat the same
steps for the worker cluster so that it also runs the agent.
Visual Guide

Select the App cluster

Select “New Background Process”

Add a custom worker that runs the `nightwatch:agent` command