Development and databases
WebSockets in Laravel: Reverb, Pusher and alternatives
With Laravel broadcasting, the server notifies the browser the moment something happens: a notification, a chat message, an order that changes status. In the browser, Laravel Echo listens; between the two you need a WebSockets server that keeps the connection with each visitor open. That server can be Reverb, if you host it yourself, or a service compatible with the Pusher protocol, which Laravel supports out of the box.
On the hosting we use the second option: your application stays here and browser connections are handled by the external service.
Why we do not offer Reverb on the hosting
Reverb is a server that stays running and accepts browser connections on its own port. The hosting's persistent processes are for queues and other background jobs, and we do not support programs that listen on a port. That is why we do not offer Reverb, Soketi or any other self-hosted WebSockets server.
How it works with an external service
Laravel on the hosting --HTTPS--> WebSockets service <--WSS-- browser with Echo
When your application broadcasts an event, PHP makes an HTTPS request to the service. The service delivers it to the browsers connected to the channel. Browsers connect directly to the service, not to the hosting, so they do not use processes or connections on your account.
Comparison
Prices and limits checked on 11 October 2026. They change often: confirm them on each service's website before deciding.
What matters most is the number of concurrent connections: each tab or screen with Echo open takes one. Messages are counted per delivery: an event received by 150 screens uses 151 messages.
Ably (recommended)
- Free: 200 concurrent connections and 6 million messages a month.
- Paid: from $29/month plus usage, with up to 10,000 connections.
- Europe: keeping data in the EU only is an Enterprise plan option.
- In Laravel: the
ablydriver included in Laravel, or the official broadcaster ably/laravel-broadcaster. In the browser, Echo with the Pusher protocol adapter.
It is the most generous free plan from a mature service: 200 connections are enough, for example, for a site with well over a hundred screens.
Pusher Channels
- Free: 100 concurrent connections and 200,000 messages a day.
- Paid: from $49/month, with 500 connections and 1 million messages a day.
- Europe: the
eucluster, in Ireland. - In Laravel: the
pusherdriver, withphp artisan install:broadcasting --pusher.
It is the most direct route, the one Laravel's documentation uses, and it is enough if you do not exceed 100 connections at a time.
Other Pusher-compatible options
PieSocket (free up to 200 connections) and Vask (from $10/month for 500 connections) speak the Pusher protocol, so you configure them like Pusher by changing the host. They are younger services and do not publish where they store data: test them before using them in production.
What your account needs
- Outbound HTTPS requests from PHP, which the hosting allows. You do not need to open ports or install anything on the server.
- Node.js to build Echo with Vite, from the Package manager. Deploy+ installs it if your script uses it.
- A queue worker if your events implement
ShouldBroadcast: Laravel sends them from the queue, and without a running worker they arrive late or not at all. On Avanza, Max and Elástico, create a Queue worker in persistent processes. On Inicia and Webmaster, implementShouldBroadcastNow: the event is sent in the same request, without a queue, at the cost of that request waiting for the service's response. A queue processed by the scheduler every minute is no good for real time.
You do not need Redis for broadcasting.
Set up Ably
-
Create an account at Ably, an application and an API key. It looks like
xxxx.yyyy:zzzz. -
In the application settings, under Protocol Adapter Settings, turn on Pusher protocol compatibility: Echo connects to Ably with
pusher-js. -
In your project, locally:
php artisan install:broadcasting --ablyIf you prefer to do it by hand,
composer require ably/ably-phpinstalls the PHP SDK. -
In the production
.env:BROADCAST_CONNECTION=ably ABLY_KEY="xxxx.yyyy:zzzz" VITE_ABLY_PUBLIC_KEY="xxxx.yyyy"
VITE_ABLY_PUBLIC_KEYis only the part of the key before the colon. The full key must not go in anyVITE_variable. -
Configure Echo with Ably's Pusher adapter:
import Echo from 'laravel-echo'; import Pusher from 'pusher-js'; window.Pusher = Pusher; window.Echo = new Echo({ broadcaster: 'pusher', key: import.meta.env.VITE_ABLY_PUBLIC_KEY, wsHost: 'main.pusher.ably.net', wsPort: 443, forceTLS: true, disableStats: true, enabledTransports: ['ws', 'wss'], });
-
Deploy and check the events in your application's console at Ably.
Ably also maintains its own broadcaster for Laravel, ably/laravel-broadcaster, with features specific to its platform. If you use it, follow its documentation for the browser side.
Set up Pusher Channels
-
Create an account at Pusher and a Channels application in the
eucluster. Under App Keys you haveapp_id,keyandsecret. -
In your project, locally, install broadcasting:
php artisan install:broadcasting --pusherThe command asks for the credentials, installs the PHP SDK (
pusher/pusher-php-server), Laravel Echo andpusher-js, createsroutes/channels.phpand leaves Echo configured. Commit the changes to your repository. -
In the production
.env(with Deploy+, from the repository menu, Edit .env):BROADCAST_CONNECTION=pusher PUSHER_APP_ID="tu_app_id" PUSHER_APP_KEY="tu_key" PUSHER_APP_SECRET="tu_secret" PUSHER_HOST= PUSHER_PORT=443 PUSHER_SCHEME="https" PUSHER_APP_CLUSTER="eu" VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" VITE_PUSHER_HOST="${PUSHER_HOST}" VITE_PUSHER_PORT="${PUSHER_PORT}" VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
VITE_variables end up inside the public JavaScript: they carry thekey, which is public, but never thesecret. -
Check the Echo configuration the installer has left. In its basic form, for Pusher, it is this:
import Echo from 'laravel-echo'; import Pusher from 'pusher-js'; window.Pusher = Pusher; window.Echo = new Echo({ broadcaster: 'pusher', key: import.meta.env.VITE_PUSHER_APP_KEY, cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER, forceTLS: true, });
-
Deploy.
VITE_variables are read when building withnpm run build: if you change them later, deploy again so the JavaScript picks them up. -
Open the website and your application's Debug Console at Pusher: you will see each connection and each event sent.
For private or presence channels, authorise each user in routes/channels.php. Laravel registers the /broadcasting/auth route that Echo uses to request that authorisation.
Broadcast an event
An event broadcast from the queue:
namespace App\Events; use App\Models\Pedido; use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Contracts\Broadcasting\ShouldBroadcast; class PedidoActualizado implements ShouldBroadcast { public function __construct(public Pedido $pedido) {} public function broadcastOn(): array { return [new PrivateChannel('pedidos.'.$this->pedido->user_id)]; } }
Without a running queue worker, change ShouldBroadcast to ShouldBroadcastNow. In the browser:
window.Echo.private(`pedidos.${userId}`) .listen('PedidoActualizado', (e) => console.log(e.pedido));
If the event does not arrive, check in this order: that BROADCAST_CONNECTION is the service's, that the configuration is not cached with old values (php artisan config:cache), that a worker is processing the queue, that the service's console receives the event and that the browser connects with the right key.
We can help you connect it
If your application used Reverb on another server, the change is usually limited to the .env, the Echo configuration and a deployment. If you need help, write to us from the client area.
More about Laravel on the hosting in Install Laravel. Reference: broadcasting in Laravel.
You may also find useful
- Install Laravel on cPanel hosting (Laravel 13 and 12) Install Laravel with Composer and the PHP for your version, configure the database and public direct...
- Host React, Vue and static websites connected to external APIs Check whether your JavaScript frontend fits on shared hosting, connect it to Supabase, Firebase or o...
- Install Node.js and npm to build assets Install Node.js and npm with NVM to build assets over SSH, in deployments or cron jobs, switch betwe...
- Persistent processes: queue workers, Horizon and always-on commands Keep Laravel queue workers, Horizon, a persistent Redis or your own command running on the Avanza, M...
Something wrong or out of date? Tell us and we will review it.