Self-host Directus with Docker
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.Recommended memory: about 512 MiB.
Services, ports and volumes
| Service | Image | Container ports | Volumes |
|---|---|---|---|
db | postgres:16-alpine | none | directus_db_data -> /var/lib/postgresql/data |
directus | directus/directus:11 | 8055 | directus_uploads -> /directus/uploads |
redis | redis:7-alpine | none | directus_redis_data -> /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:
levelrail-cli templates deploy directus --name my-directusSee Service template catalog for how templates work, and Getting started if you have not installed Levelrail yet.
More Developer Tools templates
All templates are listed in the self-host gallery.