What Directus Does
Directus provides a complete backend toolkit:
- Instant APIs: REST and GraphQL APIs auto-generated from your database schema
- Admin App: No-code admin panel for content management, built with Vue.js
- Authentication: Email/password, SSO (OAuth 2.0, OpenID, LDAP, SAML), and API tokens
- Access Control: Granular role-based permissions at collection, field, and record level
- File Storage: Asset management with transforms (resize, crop) and CDN support
- Flows (Automation): Visual workflow builder for triggers, conditions, and actions
- Webhooks: Real-time notifications on data changes
- Insights: Built-in analytics dashboard builder with charts and metrics
Architecture
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Admin App │────▶│ Directus │────▶│ Your SQL DB │
│ (Vue.js) │ │ Server │ │ (Postgres / │
│ │ │ (Node.js) │ │ MySQL / etc)│
└──────────────┘ └──────┬───────┘ └──────────────┘
│
│ Your Frontend │───▶ REST / GraphQL API
│ (Any framework)│Self-Hosting
Docker Compose
services:
directus:
image: directus/directus:latest
ports:
- "8055:8055"
environment:
SECRET: your-random-secret-key
DB_CLIENT: pg
DB_HOST: postgres
DB_PORT: 5432
DB_DATABASE: directus
DB_USER: directus
DB_PASSWORD: directus
ADMIN_EMAIL: admin@example.com
ADMIN_PASSWORD: your-admin-password
depends_on:
- postgres
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: directus
POSTGRES_PASSWORD: directus
POSTGRES_DB: directus
volumes:
- pg-data:/var/lib/postgresql/data
volumes:
pg-data:Key Features
Database-First Approach
Directus never modifies your database schema:
-- Your existing database tables work as-is
CREATE TABLE products (
id SERIAL PRIMARY KEY,
name VARCHAR(255),
price DECIMAL(10,2),
category_id INTEGER REFERENCES categories(id),
created_at TIMESTAMP DEFAULT NOW()
);
-- Directus automatically provides:
-- REST: GET /items/products
-- GraphQL: query { products { id name price } }
-- Admin UI with forms, filters, and relationsSupported Databases
| Database | Status |
|---|---|
| PostgreSQL | Full support |
| MySQL / MariaDB | Full support |
| SQLite | Full support |
| MS SQL Server | Full support |
| CockroachDB | Community |
| OracleDB | Community |
Flows (Visual Automation)
Build automations without code:
Trigger: Item Created in "orders"
→ Condition: order.total > 1000
→ Action: Send Email to sales team
→ Action: Create record in "high_value_orders"
→ Action: Call webhook to fulfillment APIExtensions System
Directus is fully extensible:
// Custom endpoint extension
export default {
id: 'custom-reports',
handler: (router, context) => {
router.get('/sales-report', async (req, res) => {
const { ItemsService } = context.services;
const orders = new ItemsService('orders', { schema: req.schema });
const data = await orders.readByQuery({ aggregate: { sum: ['total'] } });
res.json(data);
});
},
};Extension types:
- Interfaces: Custom input components
- Displays: Custom value renderers
- Layouts: Custom collection views
- Modules: Full custom pages
- Endpoints: Custom API routes
- Hooks: Event-driven logic
Directus vs Alternatives
| Feature | Directus | Strapi | Payload | Hasura |
|---|---|---|---|---|
| Open Source | Yes | Yes | Yes (MIT) | Yes (Apache) |
| Approach | Database-first | CMS-first | Code-first | Database-first |
| Existing DB | Connect any SQL | Own schema | Own schema | Connect PostgreSQL |
| APIs | REST + GraphQL | REST + GraphQL | REST + GraphQL | GraphQL only |
| Admin UI | Built-in (Vue) | Built-in (React) | Built-in (React) | Console |
| Automation | Visual Flows | Webhooks | Hooks | Event triggers |
| No-code | Extensive | Moderate | Minimal | Moderate |
FAQ
Q: Will Directus modify my existing database? A: It won't modify your business tables. Directus only creates its own system tables (prefixed with directus_) for configuration, permissions, and metadata. Your business data tables stay untouched.
Q: Is it suitable for traditional CMS websites? A: Very much so. Directus works as a headless CMS paired with Next.js, Nuxt.js, Gatsby, and other frontends. Built-in asset management, multi-language support, and versioning are all CMS essentials.
Q: Directus or Strapi? A: If you have an existing database to connect to, choose Directus (database-first). If you're building a content model from scratch, either works. Directus has stronger no-code capabilities; Strapi has a larger developer ecosystem.