DEV Community

Alex Spinov
Alex Spinov

Posted on

Directus Has a Free Headless CMS With REST & GraphQL — Here's How to Use It

WordPress is bloated. Contentful charges per entry. Directus turns any SQL database into a REST & GraphQL API with a beautiful admin panel — free and open-source.

What Is Directus?

Directus is an open-source data platform that wraps any SQL database with a real-time REST & GraphQL API, plus a no-code admin app. It's not just a CMS — it's a complete backend.

Quick Start

npx create-directus-project my-project
cd my-project && npx directus start
Enter fullscreen mode Exit fullscreen mode

Visit http://localhost:8055 — instant admin dashboard.

How It Works

  1. Point Directus at any SQL database (PostgreSQL, MySQL, SQLite, etc.)
  2. It auto-generates REST & GraphQL APIs for all tables
  3. The admin app lets non-developers manage content
  4. Developers use the API in their frontend

REST API (Auto-Generated)

# Get all articles
GET /items/articles

# Get with filtering + relations
GET /items/articles?filter[status][_eq]=published&fields=*,author.name&sort=-date_published

# Create
POST /items/articles
{ "title": "My Post", "content": "...", "status": "published" }

# Update
PATCH /items/articles/42
{ "title": "Updated Title" }
Enter fullscreen mode Exit fullscreen mode

GraphQL API (Also Auto-Generated)

query {
  articles(filter: { status: { _eq: "published" } }, sort: ["-date_published"]) {
    id
    title
    content
    author {
      name
      avatar
    }
    tags {
      name
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Key Features

  • Any SQL database — bring your existing data
  • Real-time — WebSocket subscriptions
  • Authentication — SSO, OAuth, 2FA
  • Roles & permissions — granular access control
  • File storage — S3, Azure, GCS, local
  • Flows — visual automation builder
  • Extensions — custom endpoints, hooks, modules
  • Webhooks — trigger on data changes

Self-Hosted vs. Cloud

Self-Hosted Directus Cloud
Cost Free $15/month+
Control Full Managed
Hosting Your server Their infra
Updates Manual Automatic

Why Directus

Feature Directus Strapi Contentful
Database Any SQL SQLite/PostgreSQL Proprietary
API REST + GraphQL REST + GraphQL REST + GraphQL
Existing DB Yes (introspection) No No
Pricing Free (self-host) Free (self-host) Per entry
Admin UI Polished Good Polished
Real-time Yes No No

Get Started


Need content from the web? My Apify scrapers extract structured data for your CMS. Custom solutions: spinov001@gmail.com

Top comments (0)