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
- Test with:
- 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:
- Check WhatsMark SaaS version in your admin dashboard
- Test Redis connection: Run
redis-cli pingin terminal - Confirm root access: Run
sudo whoami(should return "root") - Verify Laravel Horizon: Check if
php artisan horizoncommand 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:
sudo apt update
sudo apt install supervisor -yCheck that Supervisor is active:
sudo systemctl status supervisorYou should see:
Active: active (running)Step 2: Create Horizon Configuration
Create a new Supervisor configuration file:
sudo nano /etc/supervisor/conf.d/horizon.confPaste this optimized configuration:
[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 + O → Enter → Ctrl + X
Step 3: Reload and Start Supervisor
Reload configuration and start Horizon:
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start laravel-horizonCheck status:
sudo supervisorctl statusYou should see:
laravel-horizon RUNNING pid 1234, uptime 0:02:10Step 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:
[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
| Command | Description |
|---|---|
sudo supervisorctl status | Show running programs |
sudo supervisorctl start laravel-horizon | Start Horizon |
sudo supervisorctl stop laravel-horizon | Stop Horizon |
sudo supervisorctl restart laravel-horizon | Restart Horizon |
sudo systemctl restart supervisor | Restart Supervisor service |
Step 6: Auto-Start on Reboot
Enable Supervisor to start automatically:
sudo systemctl enable supervisorAfter 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.