---
head.title: 'Laravel Horizon with Docker - Docker PHP - Server Side Up'
description: 'Learn how to configure Laravel Horizon with Docker.'
layout: docs
---

# Laravel Horizon with Docker
We simply pass the command to the Docker container and let S6 Overlay monitor the process.

## Important concepts
1. In most cases, you probably want to run this as a separate container from your web container
1. Ensure that you have your `.env` configured correctly to authenticate with Redis
1. Ensure Redis is running before you attempt to connect Horizon to Redis
1. You can do cool things with `PHP_FPM_POOL_NAME` to separate the task from the main PHP pool. This is helpful when debugging or monitoring the task.
1. If you need to run horizon in the same container, you might want to look into [writing your own S6 Overlay script](/docs/guide/using-s6-overlay#customizing-the-initialization-process) to manage and monitor multiple processes in one container.

::code-panel
---
label: Task Command
---
```sh
php artisan horizon
```
::

::code-panel
---
label: Example Docker Compose File
---
```yaml
version: '3'
services:
  php:
    image: my/laravel-app
    environment:
      PHP_FPM_POOL_NAME: "my-app_php"

  redis:
    image: redis:6
    command: "redis-server --appendonly yes --requirepass redispassword"

  horizon:
    image: my/laravel-app
    command: ["php", "/var/www/html/artisan", "horizon"]
    environment:
      PHP_FPM_POOL_NAME: "my-app_horizon"
```
::