Directus is an open-source data platform that wraps any SQL database with a real-time REST and GraphQL API, plus a beautiful no-code admin app. It's perfect for building content-managed websites, internal tools, and applications where you want full control over your database schema.
Why Directus?
- Database-first: Works with your existing database schema — doesn't lock you in
- REST + GraphQL: Automatic API generation from your database tables
- No-code admin: Non-technical users can manage content through an intuitive interface
- Self-hosted: Complete control over your data and infrastructure
- Extensible: Custom endpoints, hooks, and modules via JavaScript/TypeScript
Installation with Docker Compose
mkdir -p /opt/directus && cd /opt/directus
cat > docker-compose.yml "$BACKUP_DIR/db-$DATE.sql.gz"
# Uploads backup
tar czf "$BACKUP_DIR/uploads-$DATE.tar.gz" \
-C /var/lib/docker/volumes/directus_directus-uploads/_data .
# Keep 30 days
find "$BACKUP_DIR" -name "*.gz" -mtime +30 -delete
Best Practices
- Use Directus Flows for automated workflows like sending emails on content publish
- Set up proper roles: Create separate roles for editors, authors, and API access
- Enable caching: Redis caching dramatically improves API response times
- Use the real-time API (WebSockets) for live content updates in your frontend
- Version your schema: Export schema snapshots with
npx directus schema snapshot