Levelrail
Skip to content

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 ​

ServiceImageContainer portsVolumes
dbpostgres:16-alpinenone
directus_db_data -> /var/lib/postgresql/data
directusdirectus/directus:118055
directus_uploads -> /directus/uploads
redisredis:7-alpinenone
directus_redis_data -> /data

Environment variables ​

ServiceVariableValue
dbPOSTGRES_DBPreset in the template
dbPOSTGRES_PASSWORDGenerated at deploy
dbPOSTGRES_USERPreset in the template
directusADMIN_EMAILPreset in the template
directusADMIN_PASSWORDGenerated at deploy
directusCACHE_ENABLEDPreset in the template
directusCACHE_STOREPreset in the template
directusDB_CLIENTPreset in the template
directusDB_DATABASEPreset in the template
directusDB_HOSTPreset in the template
directusDB_PASSWORDGenerated at deploy
directusDB_USERPreset in the template
directusKEYGenerated at deploy
directusREDISPreset in the template
directusSECRETGenerated 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-directus

See 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.

Released under the Apache 2.0 License.