Skip to main content
[ PIER ]

Directus

The headless CMS and data platform for any SQL database.

Service #cms#headless#api#graphql#rest

Directus is a modern, open-source headless CMS that wraps your existing SQL database (PostgreSQL, MySQL, SQLite, MSSQL, OracleDB) with a beautiful admin UI, instant REST + GraphQL APIs, granular permissions, asset management, flows (no-code workflows), and webhooks. Your data stays in plain SQL — no proprietary models, no lock-in.

Deploy with Pier

  1. 1 Open the Pier dashboard and click Add service.
  2. 2 Pick Directus from the template list.
  3. 3 Choose the version, set a service name, and Pier provisions the container, storage, and ports automatically.
  4. 4 Attach a domain if you want HTTPS. Traefik auto-provisions the Let's Encrypt certificate.

What is Directus?

Directus takes a different angle from most headless CMSs: instead of defining its own data model and asking you to migrate to it, Directus points at any existing SQL database, reflects the schema, and instantly gives you a polished admin UI plus REST and GraphQL APIs. Your data stays in plain PostgreSQL or MySQL — pg_dump works, your existing app’s ORM still queries it, and the day you stop using Directus you still have your data.

Beyond CRUD and API generation, Directus includes asset management with image transformations, no-code workflow automation (Flows), granular permissions (role + collection + field + row), dashboards with insights, and SSO integration with the major identity providers. It’s positioned between Strapi (code-first CMS) and Retool (custom internal tool builder) — polished, opinionated, batteries-included.

How Pier deploys it

Pier offers two templates: directus (single container with SQLite, simplest) and directus-postgresql (multi-container compose with a dedicated PostgreSQL backend, production-ready). Both expose port 8055/tcp internally.

The Directus admin URL is shown on the Pier service page along with the auto-generated admin email and password. For HTTPS, attach a domain — Traefik handles the cert; Directus’s PUBLIC_URL is set automatically.

For asset storage, configure S3 environment variables via Pier’s service settings to push uploads to MinIO, Backblaze, R2, or AWS S3.

When NOT to use Directus

For code-first CMSs where you want to define schemas in TypeScript and version everything in Git — Strapi or Payload may fit better. For pure API generation without an admin UI — Hasura or PostgREST are leaner. For “build me a custom internal dashboard with mixed data sources” — Retool or Tooljet are more flexible. Directus shines when you want the CMS, the API, and the admin all wired up around your existing SQL database.

Key features

Database-first

Point Directus at any existing SQL database; it reflects the schema and instantly gives you a UI + API. No data migration, no ORM gymnastics — your tables stay yours.

REST + GraphQL out of the box

Every table becomes a REST and GraphQL endpoint with filtering, sorting, pagination, joins, aggregations. JWT and OAuth2 auth, granular field-level permissions.

Beautiful admin UI

Custom layouts per collection, M2M and M2A relations, conditional fields, custom interfaces, dashboards with insights. Replace Retool / Tooljet for internal tooling.

Flows (no-code automation)

Visual workflow builder — listen to events (insert/update/delete), call APIs, transform data, send notifications. Zapier-style automations inside Directus.

Asset management

File uploads with image transformations (resize, crop, format), folders, metadata, signed URLs. S3, Google Cloud Storage, Azure Blob backends supported.

Multi-tenant via roles

Roles + permissions at the table, column, and row level. Conditional permissions ("user can edit their own records") via filter expressions.

Use cases

Headless CMS for marketing sites

Replace Strapi, Contentful, or Sanity. Content editors work in the Directus admin; your Next.js / Astro / Nuxt site pulls via REST/GraphQL.

Internal admin panel

Point Directus at your existing app database. Get a polished admin UI in minutes — no React skills needed.

B2B data delivery platform

Expose curated subsets of your data to partners with row-level permissions. API-first; no need to build a custom portal.

Multi-channel content (omnichannel)

Same content surfaces to web, mobile apps, IoT devices, voice assistants. Directus is the canonical source; channels pull what they need.

Game backend / configuration server

Tweak game balancing via the admin UI, push to clients via REST. Used by indie game studios for live-ops without app updates.

Code examples

Query an item via REST bash
curl -H "Authorization: Bearer $TOKEN" \
  "https://directus.example.com/items/articles?filter[status][_eq]=published&limit=20&sort=-published_at"
GraphQL query graphql
query {
  articles(filter: { status: { _eq: "published" } }, limit: 20) {
    id
    title
    slug
    author { name avatar }
    tags { name }
  }
}
SDK from JS javascript
import { createDirectus, rest, readItems } from "@directus/sdk";

const client = createDirectus("https://directus.example.com").with(rest());
const articles = await client.request(
  readItems("articles", {
    filter: { status: { _eq: "published" } },
    limit: 20,
    sort: ["-published_at"],
  })
);
Flow that posts to Slack on new article json
{
  "trigger": "filter",
  "event": "articles.items.create",
  "operations": [
    {
      "key": "webhook",
      "type": "request",
      "options": {
        "method": "POST",
        "url": "https://hooks.slack.com/services/...",
        "body": "{\"text\": \"New article: {{ $trigger.title }}\"}"
      }
    }
  ]
}

How it compares

vs Strapi Strapi is also a leading headless CMS but defines its own schema in code. Directus wraps your existing DB without migrations — pick Directus if you already have a database, Strapi for greenfield code-first projects.
vs Contentful / Sanity Hosted SaaS headless CMSs. Beautiful but expensive. Directus is OSS, self-hosted, equivalent functionality at a fraction of the cost.
vs Hasura Hasura generates GraphQL from Postgres. No admin UI, no flows, no asset management. Use Hasura for pure API, Directus for "API + admin + automation + assets" combo.
vs Retool / Tooljet Retool is for building custom internal tools. Directus is for the "give me a polished CRUD admin on top of my database" use case. Less flexible, but zero-build.

Frequently asked questions

Which databases does Directus support?
PostgreSQL, MySQL/MariaDB, SQLite, Microsoft SQL Server, Oracle DB, CockroachDB, AWS Aurora. PostgreSQL is most thoroughly tested.
Default deployment on Pier?
The basic `directus` template uses SQLite (single container, simplest). For real production, use the `directus-postgresql` template which bundles Directus + PostgreSQL.
How do I scale assets?
Configure S3 (or any S3-compatible store like MinIO, Backblaze B2, Cloudflare R2) as the storage backend via env vars. Pier has S3 Storages settings you can reuse.
License?
Directus is licensed under the Business Source License (BSL 1.1) which becomes GPLv3 after 4 years. For non-SaaS-resale use, it's effectively open-source.
Custom interfaces?
Yes — Directus extensions API lets you build custom field interfaces, displays, layouts, and operations in Vue 3. Drop them into `/extensions` and restart.
SSO / OAuth?
Built-in support for Google, GitHub, GitLab, Microsoft, Discord, Auth0, Okta, OpenID Connect, SAML. Configure via env vars or the admin UI.
HTTPS?
Attach a domain in Pier — Traefik handles TLS termination and X-Forwarded headers so Directus knows its public URL.

Related services

Deploy on your VPS

Directus is a modern, open-source headless CMS that wraps your existing SQL database (PostgreSQL, MySQL, SQLite, MSSQL, OracleDB) with a beautiful admin UI, instant REST + GraphQL APIs, granular permissions, asset management, flows (no-code workflows), and webhooks. Your data stays in plain SQL — no proprietary models, no lock-in.

Deploy this service →