Share One Reverb Server Across Laravel Apps
Source: medium.com
TL;DR
- Article guides setting up one Laravel Reverb WebSocket server to handle multiple Laravel projects.
- Define multiple apps with unique app_id in the host project's config/reverb.php.
- Saves costs and simplifies management versus separate servers or paid services like Pusher.[[1]](https://laravel.com/docs/13.x/reverb)
The story at a glance
Developer Awam explains how to share a single self-hosted Laravel Reverb WebSocket server across multiple Laravel apps, avoiding redundant setups or third-party fees. The tutorial covers creating a host project, registering other apps, and starting the server. This builds on Reverb's native multi-app support in Laravel 11+ docs.[[2]](https://medium.com/@developerawam/laravel-reverb-multi-app-one-websocket-server-for-all-your-projects-e168fb653ca8)[[1]](https://laravel.com/docs/13.x/reverb)
Key points
- Install Reverb in a "host" Laravel project via `php artisan install:broadcasting` and select Reverb.[[1]](https://laravel.com/docs/13.x/reverb)
- Edit config/reverb.php to list multiple apps under `apps`, each with unique `app_id`, `key`, `secret`, host/port details.
- Client projects set `BROADCAST_DRIVER=reverb` and matching `REVERB_APP_ID`, `REVERB_APP_KEY`, `REVERB_APP_SECRET` pointing to the host server.[[1]](https://laravel.com/docs/13.x/reverb)
- Run `php artisan reverb:start` on host (defaults to port 8080) to serve all registered apps.
- Apps stay isolated by `app_id`; scaling needs shared Redis for pub/sub across servers.[[1]](https://laravel.com/docs/13.x/reverb)
- Replaces multiple Pusher subscriptions; one Reverb handles real-time broadcasts like chats or notifications.
Details and context
The article targets developers with several Laravel projects needing real-time features but tired of running separate Reverb instances or paying for services like Pusher. Reverb, introduced in Laravel 11, is a PHP-based WebSocket server that integrates with Laravel Broadcasting—no Node.js required.
Setup assumes the host project has Reverb installed and configured with env vars like `REVERB_HOST`. Client apps connect via Laravel Echo (JS client) using their app credentials. For production, use Supervisor to daemonize `reverb:start --debug`, expose via Nginx proxy on port 443 (wss://), and add TLS certs in config.
Example config snippet from docs:
```php
'apps' => [
['app_id' => 'my-app-one', / key, secret, etc. /],
['app_id' => 'my-app-two', / ... /],
],
```
All apps must share Redis if horizontally scaling Reverb servers.[[1]](https://laravel.com/docs/13.x/reverb)
Why it matters
One shared Reverb cuts infrastructure overhead for teams with multiple apps, enabling real-time features like live updates without vendor lock-in. Developers save on hosting multiple servers or subscriptions, while keeping app isolation via unique IDs. Watch Laravel Reverb updates for easier managed hosting on Laravel Cloud or Forge, plus scaling tweaks for high-traffic setups.[[3]](https://laravel.com/blog/introducing-websockets-for-laravel-cloud-powered-by-laravel-reverb)