Docs cipi.yml Web panel API MCP Guides Compare GitHub Telegram channel
  1. Docs
  2. Apps
  3. Reverb WebSockets

Reverb WebSockets

Enable Laravel Reverb behind Nginx for an app.

Apps

Laravel Reverb is Laravel's own WebSocket server. Cipi runs it behind the app's own domain and certificate: no extra port to open, no second certificate, no credentials to invent.

Laravel Reverb
$ cipi app reverb enable shop
$ cipi deploy shop
bash
cipi app reverb enable myapp
cipi app reverb status myapp
cipi app reverb disable myapp

What enable sets up#

Step 1 of 4Browser

The browser opens a WebSocket to wss://myapp.com/app/{key}: same domain as the app, standard port 443.

PieceDetail
PortA free local port; Reverb never listens publicly
Processartisan reverb:start under Supervisor; log in ~/logs/reverb.log
NginxProxies only /app/{key} (handshake) and /apps/{id}/… (broadcast API)
.envREVERB_* credentials generated once and never rotated, plus VITE_REVERB_* for the front-end
Limits65 535 open files for Supervisor and Nginx, so thousands of clients can stay connected

Running enable again is safe: it keeps port and credentials, re-derives host and scheme, and fills in missing keys. Laravel apps only.

End to end#

bash
# in your project, then commit
composer require laravel/reverb && php artisan install:broadcasting
# on the server
cipi app reverb enable myapp
cipi ssl install myapp        # wss:// instead of ws://
cipi deploy myapp             # Vite bakes VITE_REVERB_* into the bundle

The stock resources/js/echo.js reads exactly the variables Cipi writes; nothing to change. Redeploy after a domain or certificate change so the bundle picks up the new values.

ws:// or wss://#

The app hasClients use
No certificatews:// on port 80
A certificatewss:// on port 443
A wildcard domainA concrete host (e.g. www.example.com); browsers can't open a socket to *

Status and troubleshooting#

bash
cipi app reverb status myapp
 Reverb: enabled 127.0.0.1:9000
 myapp-reverb RUNNING pid 21847, uptime 3 days
 Clients dial: wss://myapp.com:443/app/3f9c1ab27de40518b6c4
 Open files: 65535 (supervisor)
WarningFix
Missing in .env: …Run cipi app reverb enable myapp again
Certificate present but scheme httpenable again, then deploy
Default open-file limitsystemctl restart supervisor (restarts all workers) or enable with --restart-supervisor

/app and /apps belong to the WebSocket protocol. An app with its own /app or /apps routes should run Reverb on a separate subdomain.

Disable, clone, cipi.yml#

disable removes the process and the proxy rule and restores the previous broadcast driver (or log); credentials stay for a later re-enable. A clone gets its own port, credentials and host, never production's. In the repository:

yaml
workers:
  reverb: true

Common problems#

ProblemFix
Events never arriveBroadcasts are queued: make sure a worker runs

Questions#

QuestionAnswer
Full example?Real-time with Reverb.