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

JimNayzium's avatar

Using Supervisor to Run queue:work AND to keep Reverb running?

Locally I am able to manually run php artisan reverb:start on Port 6001 and have all my settings set for that port and all my Events trigger with Reverb correctly locally.

However, I am a little confused what I do with supervisor, and in my case Supervisord on Digital Ocean at my host company when I deploy the application in order to insure that the reverb server will be running along side my laravel application?

My laravel API will be on a separate domain from the front-end application if that makes a difference.

I have Events triggering when the schedule updates the Laravel database. It wall works locally, but I just need help reconfiguring it all to work once hosted on my platform.

Thanks.

PS - It's not as simple as just running php artisan reverb:start in the terminal once after I upload everything is it? I was assuming it would require a little more elaborate process management.

0 likes
1 reply
LaryAI's avatar
Level 58

To ensure that both your Laravel queue workers and the Reverb server are running continuously on your Digital Ocean server using Supervisor, you'll need to create Supervisor configuration files for each process. Here's a step-by-step guide:

  1. Install Supervisor: If you haven't already installed Supervisor on your server, you can do so using the following command:

    sudo apt-get update
    sudo apt-get install supervisor
    
  2. Configure Supervisor for Laravel Queue: Create a configuration file for your Laravel queue worker. You can typically find Supervisor configuration files in /etc/supervisor/conf.d/. Create a new file, for example, laravel-worker.conf:

    [program:laravel-worker]
    process_name=%(program_name)s_%(process_num)02d
    command=php /path/to/your/laravel/artisan queue:work --sleep=3 --tries=3
    autostart=true
    autorestart=true
    user=yourusername
    numprocs=1
    redirect_stderr=true
    stdout_logfile=/path/to/your/laravel/storage/logs/worker.log
    

    Replace /path/to/your/laravel with the actual path to your Laravel application and yourusername with the user that should run the process.

  3. Configure Supervisor for Reverb: Similarly, create a configuration file for the Reverb server, for example, reverb-server.conf:

    [program:reverb-server]
    command=php /path/to/your/laravel/artisan reverb:start --port=6001
    autostart=true
    autorestart=true
    user=yourusername
    redirect_stderr=true
    stdout_logfile=/path/to/your/laravel/storage/logs/reverb.log
    

    Again, replace /path/to/your/laravel and yourusername with the appropriate values.

  4. Update Supervisor: After creating these configuration files, update Supervisor to recognize the new configurations:

    sudo supervisorctl reread
    sudo supervisorctl update
    
  5. Start the Processes: You can start the processes using Supervisor with the following commands:

    sudo supervisorctl start laravel-worker:*
    sudo supervisorctl start reverb-server
    
  6. Verify the Setup: Check the logs specified in the configuration files to ensure that both the queue worker and the Reverb server are running without issues.

By following these steps, you should have both your Laravel queue workers and the Reverb server running continuously on your Digital Ocean server, managed by Supervisor. This setup will ensure that both services restart automatically if they fail or if the server reboots.

Please or to participate in this conversation.