> ## Documentation Index
> Fetch the complete documentation index at: https://docs.levelrail.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Self-host Directus with Docker

> An open-source headless CMS and instant REST/GraphQL API layer over your own database.

An open-source headless CMS and instant REST/GraphQL API layer over your own database.

This page describes the Levelrail template for Directus (Developer Tools). It deploys the services below as one Docker Compose app on your own server. Project site: [https://docs.directus.io](https://docs.directus.io).

Recommended memory: about 512 MiB.

## Services, ports and volumes

| Service | Image | Container ports | Volumes |
| - | - | - | - |
| `db` | `postgres:16-alpine` | none | `directus_db_data -&#62; /var/lib/postgresql/data` |
| `directus` | `directus/directus:11` | 8055 | `directus_uploads -&#62; /directus/uploads` |
| `redis` | `redis:7-alpine` | none | `directus_redis_data -&#62; /data` |

## Environment variables

| Service | Variable | Value |
| - | - | - |
| `db` | `POSTGRES_DB` | Preset in the template |
| `db` | `POSTGRES_PASSWORD` | Generated at deploy |
| `db` | `POSTGRES_USER` | Preset in the template |
| `directus` | `ADMIN_EMAIL` | Preset in the template |
| `directus` | `ADMIN_PASSWORD` | Generated at deploy |
| `directus` | `CACHE_ENABLED` | Preset in the template |
| `directus` | `CACHE_STORE` | Preset in the template |
| `directus` | `DB_CLIENT` | Preset in the template |
| `directus` | `DB_DATABASE` | Preset in the template |
| `directus` | `DB_HOST` | Preset in the template |
| `directus` | `DB_PASSWORD` | Generated at deploy |
| `directus` | `DB_USER` | Preset in the template |
| `directus` | `KEY` | Generated at deploy |
| `directus` | `REDIS` | Preset in the template |
| `directus` | `SECRET` | Generated at deploy |

Passwords and keys marked as generated are created for you when the app is deployed and stored as secrets. Values are not shown here.

## Deploy Directus with Levelrail

In the dashboard, open **Apps**, choose **New app**, then **Browse templates**, and select Directus. Review the Compose body and deploy.

With the CLI:

```bash theme={"dark"}
levelrail-cli templates deploy directus --name my-directus
```

See the [service template catalog](/templates-and-registry) for how templates work, and [Getting started](/getting-started) if you have not installed Levelrail yet.

## More Developer Tools templates

* [Appsmith](/self-host/appsmith)
* [Appwrite](/self-host/appwrite)
* [Browserless](/self-host/browserless)
* [ByteStash](/self-host/bytestash)
* [code-server](/self-host/code-server)

All templates are listed in the [self-host gallery](/self-host).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.