Documentation Index
Fetch the complete documentation index at: https://kawax.biz/llms.txt
Use this file to discover all available pages before exploring further.
This page focuses on setting up and operating the Reverb server itself.
For creating broadcast events and configuring Laravel Echo, see Broadcasting.
What is Reverb?
Laravel Reverb is Laravel’s official self-hosted WebSocket server. It brings blazing-fast and scalable real-time WebSocket communication directly to your Laravel application — no third-party service account required. Reverb sits on top of Laravel’s broadcasting infrastructure, routing server-side events to connected browsers over persistent WebSocket connections.Installation
Theinstall:broadcasting Artisan command installs Reverb along with all required dependencies in one step:
--reverb to skip the prompt:
- Installs the Composer package (
laravel/reverb) - Installs NPM packages (
laravel-echo,pusher-js) - Adds environment variables to
.env - Publishes
config/reverb.php
Configuration
Application credentials
Reverb uses a set of application credentials to authenticate connections between the client and server. Set these in your.env file:
apps section of config/reverb.php.
Allowed origins
Restrict which origins can connect to Reverb by settingallowed_origins in config/reverb.php:
* to allow all origins.
Additional applications
A single Reverb installation can serve multiple applications. Add additional entries to theapps array in config/reverb.php:
SSL
In most production setups, SSL termination is handled by a web server (e.g., Nginx) that proxies requests to Reverb. For local development with secure WebSockets, you can use a certificate from Laravel Herd or Valet:tls options in config/reverb.php:
Running the server
Start the Reverb server with thereverb:start Artisan command:
0.0.0.0:8080. Specify a custom host or port with the --host and --port options:
REVERB_SERVER_HOST / REVERB_SERVER_PORT define where the Reverb process listens.
REVERB_HOST / REVERB_PORT tell Laravel where to send broadcast messages (the public-facing address).
In production, these pairs are often different — for example, Reverb listens on port 8080 internally while the public hostname uses port 443.Debugging
Reverb suppresses debug output by default for performance. To see the stream of data passing through the server, add--debug:
Restarting
Because Reverb is a long-running process, code changes won’t take effect until you restart it. Thereverb:restart command gracefully terminates all active connections before stopping:
Monitoring
Reverb integrates with Laravel Pulse to display connection and message metrics on your dashboard. Add Reverb’s recorders toconfig/pulse.php:
pulse:check daemon on your Reverb server to keep metrics up to date. In a horizontally scaled setup, run this daemon on only one server.
Running Reverb in production
Open files
Each WebSocket connection consumes one file descriptor. Check the current limit with:/etc/security/limits.conf:
Event loop (ext-uv)
Reverb uses PHP’sstream_select by default, which caps out at roughly 1,024 open files. For more than 1,000 concurrent connections, install ext-uv via PECL:
ext-uv event loop when it’s available.
Nginx reverse proxy
In production, run Reverb behind a reverse proxy. Example Nginx configuration:worker_rlimit_nofile and worker_connections in nginx.conf:
Process management (Supervisor)
Use Supervisor to keep Reverb running in production. Setminfds in supervisord.conf to ensure enough file descriptors are available:
Scaling
When a single server can’t handle the required connection count, scale Reverb horizontally using Redis pub/sub: Enable scaling in.env:
reverb:start on each server and place them behind a load balancer that distributes incoming requests evenly.
Laravel Cloud provides fully managed WebSocket infrastructure powered by Reverb clusters, so you can deploy Reverb-enabled applications without managing servers yourself.
Events
Reverb dispatches the following events during the connection and message lifecycle. Listen for these events to hook into Reverb’s internals:| Event | Description |
|---|---|
ChannelCreated | Dispatched when a channel is created (first subscriber) |
ChannelRemoved | Dispatched when a channel is removed (last subscriber leaves) |
ConnectionPruned | Dispatched when a stale connection is pruned by the server |
MessageReceived | Dispatched when a message is received from a client |
MessageSent | Dispatched when a message is sent to a client |
Laravel\Reverb\Events namespace.
Next steps
Broadcasting
Learn how to create broadcast events, authorize channels, and configure Laravel Echo
Events and listeners
Use Laravel’s event system to listen for the events Reverb dispatches during its lifecycle