π Laravel Horizon: A Step-by-Step Guide For Managing Queues Like A Pro


Queues are essential for building scalable and performant Laravel applications. Whether you're sending emails, processing files, or executing time-consuming tasks, queues offload work and keep your app fast. But how do you monitor and manage them effectively?
Laravel Horizon is the answer.
Horizon is a beautifully designed dashboard and code-driven configuration tool for Laravel queues powered by Redis. In this blog, you'll learn how to set up, configure, and monitor queues using Horizon—step by step.
π§ Step 1: Prerequisites
Before installing Horizon, ensure you have:
-
Laravel 8 or higher
-
Redis installed and running
-
Laravel configured to use the
redis
queue driver
π§ͺ Tip: You can use services like Laravel Valet or Docker to run Redis locally.
π¦ Step 2: Install Laravel Horizon
Install Horizon using Composer:
composer require laravel/horizon
Once installed, publish the Horizon configuration:
php artisan horizon:install
This command publishes a new config file:
config/horizon.php
You can also publish assets if needed:
php artisan vendor:publish --provider="Laravel\Horizon\HorizonServiceProvider"
βοΈ Step 3: Configure Horizon
Horizon works out of the box, but you can customize it in config/horizon.php
.
For example, configure your supervisors:
'supervisor-1' => [
'connection' => 'redis',
'queue' => ['default'],
'balance' => 'simple',
'processes' => 3,
'tries' => 3,
],
π οΈ Step 4: Set Queue Driver to Redis
Ensure your .env
file has the correct queue driver:
QUEUE_CONNECTION=redis
Also, verify your config/queue.php
is using Redis for the driver.
π¦ Step 5: Start Horizon
To start Horizon and begin processing jobs:
php artisan horizon
You can also start it in the background (e.g., for production):
php artisan horizon:supervisor
For long-running Horizon, use a process monitor like Supervisor (Linux) or systemd.
π Step 6: Access the Horizon Dashboard
Visit:
http://laravel.test/horizon
Then you will get like this dashboard
You’ll see a beautiful dashboard showing:
-
Job metrics
-
Failed jobs
-
Queue throughput
-
Active workers
-
Redis usage
Protecting Horizon
Add this route protection to limit access (e.g., only to admins):
Horizon::auth(function ($request) {
return auth()->check() && auth()->user()->isAdmin();
});
Put this in your AppServiceProvider
or a custom service provider under boot()
.
π Step 7: Monitor & Manage Jobs
From the Horizon dashboard, you can:
-
Monitor queue performance in real-time
-
Retry or delete failed jobs
-
View job payloads and execution history
-
Manage worker processes
π§ͺ Bonus: Horizon Artisan Commands
Useful Horizon commands:
-
php artisan horizon
: Start Horizon -
php artisan horizon:pause
: Pause all workers -
php artisan horizon:continue
: Resume paused workers -
php artisan horizon:terminate
: Stop all workers after current jobs -
php artisan horizon:status
: Show Horizon status
β Summary
Laravel Horizon is a powerful tool for monitoring your Redis queues in real time. It gives you full control over how jobs are processed, retried, and balanced—without needing to dive into the terminal for every job failure.
To recap:
-
Install Horizon
-
Configure Redis and Horizon
-
Start and monitor queues via the dashboard
-
Secure access
-
Optimize job processing with multiple supervisors
π§ Final Thoughts
If you're running a Laravel app with queues in production, Horizon is a must-have. It saves time, provides clarity, and gives you peace of mind knowing your job processing is under control.
Have you used Horizon in your projects? Share your experience or questions in the comments below!
Related Blogs
As Laravel developers, one of the critical lessons we eventually learn is: not everything should happen in real-time. Whether it's sending emails, processing images, syncing third-party data, or running analytics β pushing these resource-heavy or time-consuming tasks to the background is essential for a performant and responsive application.

As your Laravel application grows, keeping your code organized becomes more important than ever. A bloated controller quickly becomes hard to read, test, and maintain. One of the best solutions to this problem is using the Service Pattern β a pattern that helps separate your business logic from your controllers.

If you're building a Laravel application and want blazing-fast search capabilities, Meilisearch is one of the best tools you can integrate. In this post, weβll explore what Meilisearch is, why you should consider it, its use cases, pros and cons, and how to integrate it into a Laravel project using Docker.
