Get in Touch With Us

Submitting the form below will ensure a prompt response from us.

Modern applications rely heavily on background jobs to handle tasks such as email, notifications, file processing, and intensive computations. If you’re using Laravel queues, then Laravel Horizon is one of the most powerful tools available to monitor, manage, and optimize them. Built by the Laravel team, Horizon provides a beautiful dashboard, real-time insights, job metrics, and advanced configuration options — all backed by Redis.

This guide explains what Laravel Horizon is, how it works, how to install it, best practices, common troubleshooting tips, and essential code examples to get you started.

What is Laravel Horizon?

Laravel Horizon is an official Laravel package that provides:

  1. A real-time dashboard for Laravel queues
  2. Job throughput monitoring
  3. Failed job tracking
  4. Queue worker configuration
  5. Redis-based metrics
  6. Detailed job insights
  7. Ability to balance workers dynamically

It’s designed especially for teams that need deep visibility into background job processing.

Key Features of Laravel Horizon

Real-Time Queue Monitoring

Horizon gives a visual dashboard to track:

  • Running jobs
  • Pending jobs
  • Throughput
  • Failed jobs
  • Job retries
  • Memory usage of workers

Queue Worker Management

Horizon manages Laravel queue workers automatically, so you don’t need to run php artisan queue: work manually.

Redis-Backed Metrics

All metrics, such as job runtime, number of processed jobs, or failed jobs, are stored in Redis and displayed visually.

Advanced Job Balancing

Horizon intelligently distributes jobs across workers using:

  • Simple: equal distribution
  • Auto: adjusts based on queue load
  • Fixed: fixed number of workers per queue

Notifications

You can enable alerts when:

  • Job failures spike
  • Specific queues stop processing

Beautiful Dashboard

The intuitive UI shows everything at a glance.

How to Install Laravel Horizon?

Horizon requires Laravel and Redis.

Step 1: Install via Composer

composer require laravel/horizon

Step 2: Publish Horizon Config

php artisan horizon: install

This creates:

config/horizon.php

Step 3: Run Horizon

php artisan horizon

Horizon will now manage all queue workers.

Step 4: Access the Dashboard

Visit:

https://yourapp.com/horizon

Configuring Queue Workers in Horizon

You define workers inside config/horizon.php.

Example:

‘production’ => [
‘supervisor-1’ => [
‘connection’ => ‘redis’,
‘queue’ => [‘default’, ’emails’],
‘balance’ => ‘auto’,
‘processes’ => 10,
‘tries’ => 3,
],
],

Explanation:

  • balance: auto → Horizon automatically scales
  • processes: 10 → up to 10 workers
  • tries: 3 → retry failed job 3 times

How to Track Failed Jobs?

Enable the failed jobs table:

php artisan queue:failed-table
php artisan migrate

View failed jobs in Horizon UI or via CLI:

php artisan queue:failed

Retry them:

php artisan queue:retry all

Clear failed jobs:

php artisan queue:flush

Horizon Supervisor Restarting

If you update your code after deployment, restart Horizon:

php artisan horizon:terminate

This ensures Horizon reloads new code.

Securing Horizon Dashboard

Never expose Horizon publicly without protection.

Add route protection in AuthServiceProvider:

Horizon::auth(function ($request) {
return auth()->check() && auth()->user()->is_admin;
});

Best Practices for Using Laravel Horizon

Use Redis for Queues

Horizon works only with Redis, not database queues.

Monitor Worker Memory Usage

Use –memory flag in queue worker config to prevent leaks.

Use Auto Balancing

Let Horizon intelligently manage job load.

Reserve Supervisors for Heavy Tasks

Multiple supervisors help isolate:

  • Email queue
  • Notification queue
  • High CPU tasks

Add Metrics Alerts

Set threshold notifications in production.

Common Horizon Errors & Fixes

Horizon Not Updating / Not Processing Jobs

Restart workers:

php artisan horizon:terminate

Redis Connection Error

Check .env:

QUEUE_CONNECTION=redis
REDIS_CLIENT=phpredis

Horizon Dashboard Not Loading

Clear cached routes:

php artisan route:clear
php artisan config:clear

Jobs Getting Stuck

Ensure supervisor processes > 1 in production.

When Should You Use Laravel Horizon?

Use Horizon if you need:

  1. Queue monitoring
  2. Background job analytics
  3. Better control over workers
  4. Scalable job processing
  5. Long-running jobs
  6. Telemetry for all queued tasks

Horizon is ideal for SaaS apps, eCommerce systems, reporting engines, and notification-heavy platforms.

Optimize Your Queue System with Laravel Horizon

Need help setting up, scaling, or securing Laravel Horizon? Our Laravel experts build high-performance queue systems tailored to your business needs.

Talk to Our Laravel Specialists

Conclusion

Laravel Horizon gives developers complete visibility and control over background job processing. Its real-time dashboard, job analytics, balancing system, and powerful supervisor configurations make Laravel queues production-ready and scalable. Whether you’re running a small application or a high-traffic enterprise system, Horizon simplifies monitoring, debugging, and scaling queue workers.

For more on Laravel development services, you can explore our Laravel Development Services.

About Author

Jayanti Katariya is the CEO of Moon Technolabs, a fast-growing IT solutions provider, with 18+ years of experience in the industry. Passionate about developing creative apps from a young age, he pursued an engineering degree to further this interest. Under his leadership, Moon Technolabs has helped numerous brands establish their online presence and he has also launched an invoicing software that assists businesses to streamline their financial operations.

Related Q&A

bottom_top_arrow

Call Us Now

usa +1 (620) 330-9814
OR
+65
OR

You can send us mail

sales@moontechnolabs.com