> For the complete documentation index, see [llms.txt](https://docs.directorylister.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.directorylister.com/docker.md).

# Docker

Starting with Directory Lister v5.0 an [official Docker image is provided](https://hub.docker.com/r/directorylister/directorylister) as `directorylister/directorylister`.

## Running with `docker run`

```bash
docker run --detach [--env ENVIRONMENT_VARIABLE=value] \
    --volume <host_path>:/data --publish <host_port>:80 \
    directorylister/directorylister:5
```

{% hint style="warning" %}
Replace `<host_path>` with the path to the directory you'd like to list.

Replace `<host_port>` with the port you would like to expose the application on.
{% endhint %}

{% hint style="info" %}
You may pass one or more environment variables with multiple `--env` flags.

See the [Configuration Reference](/configuration/configuration-reference.md) for a full list of the available environment variables.
{% endhint %}

## Running with `docker compose`

The following is an example `docker-compose.yaml` file. For more information on `docker compose` and how to use this file see the [Docker Compose documentation](https://docs.docker.com/compose/).

{% code title="docker-compose.yaml" %}

```yaml
services:

  directory-lister:
    image: directorylister/directorylister:<version>
    environment:
      # APP_LANGUAGE: en
      # DISPLAY_READMES: true
      # READMES_FIRST: false
      # ZIP_DOWNLOADS: true
      # TIMEZONE: America/Phoenix
      # See configuration docs for additional variables
    ports:
      - <host_port>:80
    volumes:
      - <host_path>:/data
    restart: unless-stopped
```

{% endcode %}

{% hint style="warning" %}
Replace `<version>` with the version of Directory Lister you'd like to use (e.g. `5.0.5`, `5.0` or `5`)

Replace `<host_path>` with the path to the directory you'd like to list.

Replace `<host_port>` with the port you would like to expose the application on.
{% endhint %}

{% hint style="info" %}
See the [Configuration Reference](/configuration/configuration-reference.md) for a full list of the available environment variables.
{% endhint %}

### Advanced `docker compose` usage&#x20;

The following is an example `docker-compose.yaml` file showing Directory Lister being run with a Valkey container for caching.

{% code title="docker-compose.yaml" %}

```yaml
services:

  directory-lister:
    image: directorylister/directorylister:<version>
    environment:
      CACHE_DRIVER: redis
      REDIS_HOST: cache
      REDIS_PORT: 6379
      # See configuration docs for additional variables
    ports:
      - <host_port>:80
    volumes:
      - <host_path>:/data
    depends_on: [cache]
    restart: unless-stopped

  cache:
    image: valkey:8
    restart: unless-stopped
```

{% endcode %}

{% hint style="warning" %}
Replace `<version>` with the version of Directory Lister you'd like to use (e.g. `5.0.5`, `5.0` or `5`)

Replace `<host_path>` with the path to the directory you'd like to list.

Replace `<host_port>` with the port you would like to expose the application on.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.directorylister.com/docker.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
