What is Directus?
Directus is an open-source headless CMS that wraps any SQL database with a REST and GraphQL API.
What is Directus?
Directus is an open-source, self-hostable headless CMS that sits on top of an existing SQL database and instantly generates both REST and GraphQL APIs from the schema. Originally released in 2004 as a PHP project, it was fully rewritten in Node.js (v9) in 2021 and has been on a rapid release cadence since — the current stable line is v11.x as of early 2026. Unlike schema-first CMS platforms like Strapi, Directus is database-first: it mirrors your existing tables rather than generating them from a content model. This means you can connect it to a production Postgres, MySQL, MariaDB, SQLite, MS SQL, or CockroachDB instance without altering the schema. We've shipped Directus on 20+ client projects, mostly paired with Postgres and a Next.js or Astro frontend. It's our go-to when the client needs a self-hosted data studio — not just a blog CMS.
How it works
Directus runs as a Node.js application (typically deployed via Docker) that connects to your SQL database using Knex.js under the hood. On startup it introspects every table, column, and relation, then exposes:
- REST API at
/items/<collection>with filtering, sorting, deep field selection, and aggregation. - GraphQL API at
/graphqlwith equivalent query power. - Real-time subscriptions via WebSockets (added in v10.4).
The admin app — called "Data Studio" — is a Vue 3 SPA bundled with the server. It gives non-technical editors a polished interface for CRUD, roles, permissions, file management, and Flows (a built-in automation engine similar to n8n or Zapier).
Permissions are granular. You define rules per role, per collection, per CRUD action, down to individual fields and row-level filters. A typical config looks like:
{
"role": "editor",
"collection": "articles",
"action": "update",
"fields": ["title", "body", "status"],
"permissions": { "_and": [{ "author": { "_eq": "$CURRENT_USER" } }] }
}
This rule lets editors update only their own articles, and only the title, body, and status fields. No code needed — this is configured entirely in the Data Studio UI.
Extensibility is handled through Extensions SDK: custom endpoints, hooks, modules, interfaces, displays, layouts, and operations (for Flows). Extensions are written in TypeScript and loaded at runtime.
When to use it
Directus excels when the data model already exists or when content management is only one concern alongside operational data.
Use Directus when:
- You have an existing Postgres (or other SQL) database and need an admin UI + API without rewriting your schema.
- You need fine-grained, row-level permissions — editorial workflows, multi-tenant data, internal tools.
- Self-hosting is a requirement (compliance, data residency, cost control).
- You want a single tool for content, file/asset management, and lightweight workflow automation.
Skip Directus when:
- You want a fully managed SaaS with zero ops burden — Directus Cloud exists but costs more than competitors like Sanity or Contentful at scale.
- Your content is document-oriented or deeply nested — Sanity's GROQ or a document database will serve you better.
- You need edge-cached content delivery out of the box — you'll need to layer a CDN or use ISR on the frontend.
Directus vs alternatives
| Feature | Directus | Strapi | Sanity | Contentful |
|---|---|---|---|---|
| Open source | Yes (BSL 1.1 → GPLv3) | Yes (MIT community) | No (proprietary) | No (proprietary) |
| Database approach | Database-first (mirrors existing) | Schema-first (generates tables) | Document store (hosted) | Document store (hosted) |
| API types | REST + GraphQL + WebSocket | REST + GraphQL | GROQ + GraphQL | REST + GraphQL |
| Self-hosted | Yes | Yes | No | No |
| Built-in Flows/automation | Yes | No (needs plugins) | No (needs webhooks) | No (needs webhooks) |
| Admin framework | Vue 3 | React (Strapi 5) | React (Sanity Studio) | Proprietary |
Note on licensing: Directus switched from GPLv3 to BSL 1.1 in v11 for the core, with the SDK and extensions remaining MIT. This matters if you're building a competing hosted CMS. For end-user projects it changes nothing.
Real-world example
We built an internal asset management platform for a media company with ~50,000 image and video records in an existing Postgres 15 database. Instead of writing a custom admin panel, we pointed Directus at the live database. Within a day we had a working Data Studio with role-based access for editors, reviewers, and admins. Flows handled automated thumbnail generation (calling a Cloudflare Worker via webhook) and Slack notifications on new uploads. The Next.js 14 frontend consumed the REST API with on-demand ISR, keeping page loads under 1.2s on a 90th-percentile Lighthouse performance score. Total time from kickoff to production: 3 weeks. Our initial estimate for a custom-built admin was 10 weeks.