131 STUDIOS
Home / Blog / Running Multiple Instances of Laravel Ho
Laravel

Running Multiple Instances of Laravel Horizon on the Same Server

Learn how to run multiple instances of Laravel Horizon on the same server.

R
Robert Fountain
Founder ยท 131 Studios
Published
Jul 7, 2025
Read time
2 min

If you're like me you tend to have a staging and production instance of your code on the same server. Recently I've been running into an issue where my Laravel Horizon queues were not processing when I had multiple instances of Horizon on the same server. Here's how I fixed that issue:

In your config/horizon.php file you'll need to create a new environment for your staging environment. There should be one for local and production already but nothing for staging. Create that 'staging' => [ 'supervisor-

staging' => [ 
	'connection' => 'redis', 
	'queue' => ['queue.staging'],  // Use a unique name for your staging queue 	
	'balance' => 'simple', 
	'processes' => 3, 
	'tries' => 3 
],

Once that is done we'll want to use a different Redis database than our production application uses so we don't have any collisions with the queues. Head over to your config/database.php file and add some values under the redis option.

'options' => [ 
	'prefix' => env('REDIS_PREFIX', 'prod:') 
],

The last step is to edit your .env file and add some references to your staging queues. You'll need to define a REDIS_QUEUE key/value pair as well as some other key/value pairs for Redis.

REDIS_QUEUE=queue.staging
HORIZON_PREFIX="staging:" 
REDIS_PREFIX="staging:" 
REDIS_DB=2

That should be all you need to separate your Laravel Horizon instances on the same server.

Need help with your next project? We'd love to hear from you.

Need help with your next project?

We build custom websites and applications for businesses ready to grow online.

Book a free consult