Documentation Index
Fetch the complete documentation index at: https://mintlify.com/directus/directus/llms.txt
Use this file to discover all available pages before exploring further.
Quick Start Guide
Get Directus up and running in under 5 minutes. This guide will take you from installation to making your first API call.Prerequisites: Node.js 22 or higher is required. Check your version with
node -vInstallation Methods
Choose your preferred installation method:- npx (Easiest)
- Docker (Recommended)
- pnpm
- npm
The fastest way to get started - no global installation required:This creates a new Directus project in the
my-project directory.Step-by-Step Setup
Initialize the Project
Create a new Directus project:The
init command will:- Create a new directory for your project
- Set up the file structure
- Generate security keys
- Create a basic
.envconfiguration file
Configure Database
Directus works with SQLite by default (perfect for getting started). For production, you’ll want to use PostgreSQL or MySQL.
Bootstrap the Database
Install the database schema and create an admin user:You’ll be prompted to create an admin account. The bootstrap command will:
- Create all necessary database tables
- Set up system collections and fields
- Create the admin role
- Create your first admin user
If you’re using Docker, the bootstrap happens automatically on first run.
Start the Server
Start the Directus server:The server will start on
http://localhost:8055 by default.You can customize the host and port with environment variables:
HOST=0.0.0.0(default)PORT=8055(default)
Access the Dashboard
Open your browser and navigate to:You’ll be redirected to the admin login page at
http://localhost:8055/admin. Log in with the admin credentials you created during bootstrap.Congratulations! You now have a fully functional Directus instance running.
Create Your First Collection
Collections are like database tables. Let’s create one:
- Click the Settings icon in the sidebar (gear icon)
- Navigate to Data Model
- Click Create Collection
- Name it
articles - Add these fields:
title(String)content(Text, Interface: WYSIWYG)published_date(DateTime)status(String, Interface: Dropdown with options: draft, published)
Using the TypeScript SDK
For a better developer experience, use the official Directus SDK:Using GraphQL
Directus automatically generates a GraphQL endpoint at/graphql:
Available CLI Commands
Directus provides several useful CLI commands:Next Steps
Installation Guide
Learn about production deployment with Docker and environment configuration
Data Model
Design your database schema with collections, fields, and relationships
API Reference
Explore all available REST API endpoints and parameters
SDK Documentation
Deep dive into the TypeScript SDK and advanced usage
Authentication
Set up authentication providers: OAuth, LDAP, SAML, and more
Extensions
Extend Directus with custom interfaces, layouts, and endpoints
Common Issues
Port 8055 already in use
Port 8055 already in use
If port 8055 is already in use, you can change it by setting the Or add it to your
PORT environment variable:.env file:Database connection failed
Database connection failed
Make sure your database is running and the connection details in your
.env file are correct:- Check
DB_HOST,DB_PORT,DB_DATABASE,DB_USER, andDB_PASSWORD - Ensure the database exists
- Verify network connectivity to the database server
- For PostgreSQL, install the
pgpackage:npm install pg - For MySQL, install the
mysql2package:npm install mysql2
KEY and SECRET not set
KEY and SECRET not set
If you see errors about Then add them to your
KEY or SECRET not being set, generate them:.env file:Cannot find module '@directus/api'
Cannot find module '@directus/api'
If you’re running from source or development, make sure to build the project first:
Production Checklist
Before deploying to production:- Use PostgreSQL or MySQL (not SQLite)
- Set strong
KEYandSECRETvalues - Configure
PUBLIC_URLto your domain - Enable CORS if needed for your frontend
- Set up Redis for caching and rate limiting
- Configure email transport for password resets
- Enable rate limiting
- Set up SSL/TLS certificates
- Configure proper backups
- Review security and permissions