Skip to content

Supervisor Setup Guide for Laravel Horizon

Laravel Horizon manages your background jobs (queues). To keep Horizon running continuously — even after a reboot — we'll use Supervisor, a lightweight Linux process manager.

Prerequisites

Before proceeding with this setup, ensure you meet the following requirements:

HOSTING REQUIREMENTS

❌ This feature is NOT available on shared hosting You must have a Cloud Server or VPS with root access to configure Supervisor.

System Requirements

  • Server Type: Cloud Server, VPS, or Dedicated Server
  • Access Level: Root/Administrator access required
  • SSH Access: Command line access to your server

Software Requirements

  • Redis: Must be installed and working properly
    • Test with: redis-cli ping (should return "PONG")
    • If Redis is not installed: Follow the Redis installation guide for Linux
    • CloudPanel.io users: Redis is already pre-installed if you're using CloudPanel.io
  • WhatsMark SaaS: Version 1.4.2 or greater
  • Laravel Horizon: Already configured and installed in WhatsMark SaaS version 1.4.2+

Verification Steps

Before starting, verify your setup:

  1. Check WhatsMark SaaS version in your admin dashboard
  2. Test Redis connection: Run redis-cli ping in terminal
  3. Confirm root access: Run sudo whoami (should return "root")
  4. Verify Laravel Horizon: Check if php artisan horizon command exists

💡 COMPATIBILITY NOTE

If you're using an older version of WhatsMark SaaS, please upgrade to version 1.4.2+ before proceeding with this configuration.


Important Disclaimer

TECHNICAL EXPERTISE REQUIRED

⚠️ This setup requires technical knowledge of server configuration and Linux commands. If you are not confident with terminal commands, SSH access, or process management — please do not attempt this yourself.

You can hire a qualified server administrator or contact our support team for professional setup assistance. Our experts can handle the entire configuration for you safely and efficiently.

💡 PERFORMANCE RECOMMENDATION

We highly recommend enabling this advanced configuration if you want your campaigns to run faster and improve the overall performance and reliability of your Laravel application.


Step 1: Install Supervisor

Run the following commands on your Ubuntu/Debian server:

bash
sudo apt update
sudo apt install supervisor -y

Check that Supervisor is active:

bash
sudo systemctl status supervisor

You should see:

text
Active: active (running)

Step 2: Create Horizon Configuration

Create a new Supervisor configuration file:

bash
sudo nano /etc/supervisor/conf.d/horizon.conf

Paste this optimized configuration:

ini
[program:laravel-horizon]
command=php /path-to-your-project/artisan horizon
autostart=true
autorestart=true
user=www-data
redirect_stderr=true
stdout_logfile=/dev/null

🔧 IMPORTANT PATH CONFIGURATION

Replace /path-to-your-project with your actual project path. Example: /home/user/htdocs/whatsmark.dev

Save and exit:Ctrl + OEnterCtrl + X


Step 3: Reload and Start Supervisor

Reload configuration and start Horizon:

bash
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start laravel-horizon

Check status:

bash
sudo supervisorctl status

You should see:

text
laravel-horizon        RUNNING   pid 1234, uptime 0:02:10

Step 4: (Optional) Specific Queue Configuration

If you want Horizon to handle a specific queue (for example: a high priority queue), you can modify your configuration:

ini
[program:laravel-horizon-high]
command=php /path-to-your-project/artisan horizon --queue=high
autostart=true
autorestart=true
user=www-data
redirect_stderr=true
stdout_logfile=/dev/null

💡 QUEUE CONFIGURATION

This example shows how to configure Horizon to process jobs from a specific queue named "high". You can replace "high" with any queue name that matches your application's needs.


Step 5: Useful Commands

CommandDescription
sudo supervisorctl statusShow running programs
sudo supervisorctl start laravel-horizonStart Horizon
sudo supervisorctl stop laravel-horizonStop Horizon
sudo supervisorctl restart laravel-horizonRestart Horizon
sudo systemctl restart supervisorRestart Supervisor service

Step 6: Auto-Start on Reboot

Enable Supervisor to start automatically:

bash
sudo systemctl enable supervisor

After this, Horizon will automatically run whenever the server restarts.


Summary

  • Supervisor keeps Laravel Horizon running 24/7
  • Campaigns process faster and queues become more reliable
  • Logs are disabled for cleaner operation
  • Recommended for production servers to improve performance

Final Recommendation

This is an advanced configuration designed for better performance and scalability. Incorrect setup can break background jobs or cause server instability.

⚠️ NEED HELP WITH SETUP?

If you're unsure about any step:

💬 Contact our support team for paid setup assistance.

Or hire a technical expert to configure Supervisor for you.

🚀 PROFESSIONAL OPTIMIZATION

Our team can handle complete server optimization — ensuring faster campaign execution, stable queues, and maximum Laravel performance.

© 2024 - Corbital Technologies. All rights reserved.