---
url: >-
  https://docs.corbitaltech.dev/products/whatsmark-saas/advance-configuration/supervisor-setup-guide-for-laravel-horizon.md
description: >-
  Complete guide for setting up Supervisor with Laravel Horizon for queue
  management in WhatsMark SaaS
---

# 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:

::: warning 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 {#system-requirements-supervisor}

* **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](https://redis.io/docs/latest/operate/oss_and_stack/install/archive/install-redis/install-redis-on-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.5.0+

### 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

::: info  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

::: danger 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](https://support.corbitaltech.dev/)** for professional setup assistance.
Our experts can handle the entire configuration for you safely and efficiently.

::: tip  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
; WhatsApp SaaS - Laravel Horizon Supervisor Configuration
; Copy this file to /etc/supervisor/conf.d/whatsmarksaas-horizon.conf
; Replace {{PROJECT_PATH}} with your actual project path
; Replace {{WEB_USER}} with your web server user (www-data, nginx, apache, etc.)

[program:whatsmarksaas-horizon]
process_name=%(program_name)s_%(process_num)02d
command=php /home/corbitaltech-passthecode/htdocs/whatsmarksaas.dev/artisan horizon
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=corbitaltech-whatsmarksaas
numprocs=1
redirect_stderr=true
stdout_logfile=/dev/null
stderr_logfile=/dev/null
stopwaitsecs=3600
environment=LARAVEL_ENV="production"

; Example with actual paths:
; Replace {{PROJECT_PATH}} with: /var/www/html/whatsmarksaas-saas
; Replace {{WEB_USER}} with: www-data

; After creating this file:
; sudo supervisorctl reread
; sudo supervisorctl update
; sudo supervisorctl start whatsmarksaas-horizon:*

```

**Save and exit:**
`Ctrl + O` → `Enter` → `Ctrl + 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
```

::: info  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:

```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.

::: warning  NEED HELP WITH SETUP?
If you're unsure about any step:

**[Contact our support team](https://support.corbitaltech.dev/)** for paid setup assistance.

**Or hire a technical expert** to configure Supervisor for you.
:::

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