Skip to main content

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 -v

Installation Methods

Choose your preferred installation method:
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

1

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 .env configuration file
2

Configure Database

Directus works with SQLite by default (perfect for getting started). For production, you’ll want to use PostgreSQL or MySQL.
SQLite is great for development and testing. For production deployments, use PostgreSQL or MySQL.
3

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.
4

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)
5

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.
6

Create Your First Collection

Collections are like database tables. Let’s create one:
  1. Click the Settings icon in the sidebar (gear icon)
  2. Navigate to Data Model
  3. Click Create Collection
  4. Name it articles
  5. Add these fields:
    • title (String)
    • content (Text, Interface: WYSIWYG)
    • published_date (DateTime)
    • status (String, Interface: Dropdown with options: draft, published)
Your collection is now ready to use!
7

Make Your First API Call

Now let’s interact with the API. First, get an access token:
Then create your first article:
Retrieve all articles:

Using the TypeScript SDK

For a better developer experience, use the official Directus SDK:
Here’s a complete example:

Using GraphQL

Directus automatically generates a GraphQL endpoint at /graphql:
You can explore the GraphQL API using the built-in GraphQL playground at:

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

If port 8055 is already in use, you can change it by setting the PORT environment variable:
Or add it to your .env file:
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, and DB_PASSWORD
  • Ensure the database exists
  • Verify network connectivity to the database server
  • For PostgreSQL, install the pg package: npm install pg
  • For MySQL, install the mysql2 package: npm install mysql2
If you see errors about KEY or SECRET not being set, generate them:
Then add them to your .env file:
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 KEY and SECRET values
  • Configure PUBLIC_URL to 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
See the Installation Guide for detailed production setup instructions.