Laravel Echo Server
What is Laravel Echo Server?
Laravel Echo Server is a Node.js WebSocket server that implements the Pusher protocol for Laravel's broadcasting system, using Redis as its backing pub/sub layer. It's the older, community-maintained option that predates Laravel's first-party Reverb and the Pusher-compatible Soketi; both are generally preferred for new projects, but this remains available for existing apps already wired up to it. Laradock builds it from node:alpine.
Start Laravel Echo Server
docker compose up -d laravel-echo-server
The container links to redis in compose.yml (it uses Redis as its pub/sub backend), so make sure Redis is running too:
docker compose up -d redis laravel-echo-server
Stop Laravel Echo Server
docker compose stop laravel-echo-server
This stops the container. To remove it entirely: docker compose rm -f laravel-echo-server.
Configuration
laravel-echo-server/defaults.env holds the port, overridable by adding the same line to your own .env:
| Variable | Default | What it does |
|---|---|---|
LARAVEL_ECHO_SERVER_PORT | 6001 | Host-side port the WebSocket server is published on (host:6001). |
Server behavior itself (auth endpoint, Redis connection, dev mode, and so on) is configured in laravel-echo-server/laravel-echo-server.json, mounted read-only into the container. Out of the box it points at Redis by container name (host: "redis", port: "6379"), listens on port 6001, and runs with devMode: true.
Connect from Laravel
- In your Laravel
.env, configure broadcasting for the Pusher driver (Echo Server speaks the Pusher protocol) and point Echo's frontend client at the container's published port,localhost:6001by default. - Set
REDIS_HOST=redisso your app and Echo Server share the same Redis pub/sub backend, this is required, Echo Server only relays events published to Redis. - Start both containers:
docker compose up -d redis laravel-echo-server
Common issues
- No events arrive on the frontend. Laravel publishes broadcast events to Redis; Echo Server only relays what it sees there. Confirm your app's
.envusesBROADCAST_CONNECTION=redis(or your Pusher-compatible driver of choice) and the sameREDIS_HOSTaslaravel-echo-server.json. - Auth fails on private/presence channels.
laravel-echo-server.jsonsetsauthEndpoint: "/broadcasting/auth"andauthHost: "localhost"; adjustauthHostif your app isn't reachable atlocalhostfrom wherever Echo Server resolves it. - Port already in use on your host. Another local WebSocket server (or another Laradock project) is already bound to
6001. ChangeLARAVEL_ECHO_SERVER_PORTin.envand restart. - Config changes to
laravel-echo-server.jsondon't take effect. It's mounted read-only incompose.yml; a restart should pick up edits, but if not, rebuild:docker compose build laravel-echo-server.
Starting a new project? Prefer Laravel's own first-party server, Laravel Reverb, or the Pusher-compatible Soketi. New to Laradock? Start at Getting Started.