MirrorNest
← All guides

Directus

Directus is a headless CMS and data platform that wraps a REST/GraphQL API and an admin app around your own SQL database, deployed via an official Docker Compose example.

Target: Any Docker hostDatabaseCMSOfficial homepage ↗Official docs ↗
This guide is synthesized from Directus's own official documentation, linked above — always cross-check exact package/version names there before running these commands on a production server, since distro and project versions move over time.
  1. 1Create your project directory

    Create a directus/ directory with database, uploads, and extensions subfolders to persist data outside the container.

  2. 2Write a production docker-compose.yml

    Directus's official example wires together a directus service, a PostGIS/PostgreSQL database service, and a Redis cache service.

    Set DB_CLIENT=pg with DB_HOST/DB_PORT/DB_DATABASE/DB_USER/DB_PASSWORD pointing at the database service, and CACHE_STORE=redis with REDIS pointing at the cache service.

  3. 3Set the required secret and admin account

    Set a unique SECRET value (used to sign tokens) and, optionally, ADMIN_EMAIL and ADMIN_PASSWORD to pre-seed the first admin account, plus PUBLIC_URL for your deployment's address.

  4. 4Start Directus

    docker compose up -d
  5. 5Log in

    Open your PUBLIC_URL. If you didn't pre-set ADMIN_EMAIL/ADMIN_PASSWORD, Directus will walk you through its Studio onboarding screen to create the first admin account.

    Check container health via the built-in /server/health and /server/ping endpoints.