Directus
The headless CMS and data platform for any SQL database.
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 Open the Pier dashboard and click Add service.
- 2 Pick Directus from the template list.
- 3 Choose the version, set a service name, and Pier provisions the container, storage, and ports automatically.
- 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
curl -H "Authorization: Bearer $TOKEN" \
"https://directus.example.com/items/articles?filter[status][_eq]=published&limit=20&sort=-published_at" query {
articles(filter: { status: { _eq: "published" } }, limit: 20) {
id
title
slug
author { name avatar }
tags { name }
}
} 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"],
})
); {
"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?
Default deployment on Pier?
How do I scale assets?
License?
Custom interfaces?
SSO / OAuth?
HTTPS?
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 →