Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

secondman's avatar

Best Practice: Laravel Echo Server

Hey All,

I've managed to get laravel-echo-server up and running on Forge (finally) and now I need to know what is the best method to use to ensure it stays up and running.

I've built the socket.io-client into my app.js with webpack so I'm not concerned with how it starts up after a deployment, so I'm wondering should I simply stop it, run my deployment, then restart it in my deploy script:

cd /home/forge/example.com
laravel-echo-server stop
git pull origin develop
composer install --no-interaction --prefer-dist --optimize-autoloader
echo "" | sudo -S service php7.1-fpm reload

php artisan config:clear
php artisan cache:clear
php artisan migrate --force
php artisan optimize --force
php artisan queue:restart
npm install
npm run production
laravel-echo-server start

Or should I run it as a daemon and let supervisor manage it? And if so, what commands to use in the daemon panel?

Thanks

0 likes
2 replies
secondman's avatar

@carlituxman

I installed it the normal way. SSH into your server and install it globally.

npm install -g laravel-echo-server

Please or to participate in this conversation.