Self-host Directus with Levelrail

Verified

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

  • AuthordirectusVerified by Levelrail
  • LicenceBUSL-1.1
  • Memory512 MiB
  • Archarm64
  • Services3

How to self-host Directus

  1. Pull the images

    3 images are pulled on your server.

    Show images
    • postgres:16-alpine
    • directus/directus:11
    • redis:7-alpine
  2. Create the app

    3 services start in a single Compose app, with 3 named volume mounts for your data, on port 8055.

  3. Fill in the secrets

    5 secrets are generated and stored encrypted, 11 settings are preset, you do not have to fill in anything.

  4. Open it

    Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.

Directus requirements

Memory
About 512 MiB
Architectures
amd64 image published, arm64 tested
Ports
8055
Domain
Optional, an sslip.io address is used without one
Settings
none to fill in
License
BUSL-1.1, source available
  • Verified. Verified on arm64 with image tag 11. Our CI ran this exact image version and it answered on its health path. Evidence
  • Host ports. It publishes port 8055 on the host, so open them in the VPS firewall only if you want that.

Install Levelrail first

On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then Directus. New to Levelrail? Install it on a fresh VPS first.

docker pull ghcr.io/glincker/levelrail:latest

Then levelrail-cli login --device. See Getting started and the Directus docs page.

Deploy Directus your way

Every format below deploys the same pinned images. Pick the one that fits how you work.

Deploy Directus from the CLI

levelrail-cli templates deploy directus --name my-directus

Deploy Directus with the API

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/directus/deploy

Directus configuration

Directus services

ServiceImagePortsVolumes
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

Directus environment variables

VariableServiceValue
POSTGRES_DB db Preset by the template
POSTGRES_PASSWORD db Generated at deploy
POSTGRES_USER db Preset by the template
ADMIN_EMAIL directus Preset by the template
ADMIN_PASSWORD directus Generated at deploy
CACHE_ENABLED directus Preset by the template
CACHE_STORE directus Preset by the template
DB_CLIENT directus Preset by the template
Show all 16 variables
  • DB_DATABASEdirectusPreset by the template
  • DB_HOSTdirectusPreset by the template
  • DB_PASSWORDdirectusGenerated at deploy
  • DB_PORTdirectusPreset by the template
  • DB_USERdirectusPreset by the template
  • KEYdirectusGenerated at deploy
  • REDISdirectusPreset by the template
  • SECRETdirectusGenerated at deploy

Ports and volumes

Ports
8055
Volumes
3 named mounts: directus_db_data -> /var/lib/postgresql/data, directus_uploads -> /directus/uploads, directus_redis_data -> /data

Directus FAQ

How much memory does Directus need?

The catalog lists about 512 MiB of memory for Directus across its 3 services.

Does Directus run on arm64?

For Directus, arm64 is tested; amd64 is image published.

What licence is Directus under?

Directus is licensed under BUSL-1.1, which is source-available, so read the terms before commercial use.

Does Directus need configuration before it starts?

No. The template fills in its own defaults and generates secrets at deploy time.

Which database does Directus bundle?

The template includes Postgres and Redis, running as its own service.

Which ports does Directus use?

Directus listens on port 8055 inside the stack.

Where does Directus keep its data?

In named volumes: directus_db_data mounted at /var/lib/postgresql/data, directus_uploads mounted at /directus/uploads and directus_redis_data mounted at /data.

Can I deploy Directus on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id directus for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image postgres:16-alpine, directus/directus:11, redis:7-alpine is what you deploy there.

levelrail-cli templates deploy directus --name my-directus