Buffer directory
Before starting the agent, ensure the local SQLite buffer directory exists and is writable by the process user:Inside a Docker container the buffer directory is required at container start — bake it into your image or mount a persistent volume so buffered telemetry survives restarts.
Supervisor
Recommended for most deployments — works out of the box on Ubuntu/Debian/RHEL, integrates with Laravel Forge and most PaaS runners.stopwaitsecs=30 gives the agent time to flush pending rows out of SQLite into PostgreSQL before SIGKILL. If you drain heavy volume, bump it to 60.
systemd
Use this on stock Linux without Supervisor (or when you already manage app services with systemd)./etc/systemd/system/nightowl-agent.service, then:
Docker
Run the agent as its own container (separate from your web container). Share the app code and thestorage/nightowl volume:
Graceful shutdown
OnSIGTERM the agent:
- Stops accepting new TCP/UDP payloads.
- Flushes any in-memory batches to SQLite.
- Waits up to 30 seconds for drain workers to finish their current
COPYbatch. - Closes the PostgreSQL connection cleanly.
Health checks
The async driver exposes a health endpoint onNIGHTOWL_HEALTH_PORT (default 2409):