← Back to Guides
Header image for blog post: How to deploy Directus: step-by-step deployment guide
Daniel Adeboye
Published 24th October 2025

How to deploy Directus: step-by-step deployment guide

If you’re looking for a powerful and open-source platform to manage your data and content, Directus is one of the best options available. It wraps any SQL database with a dynamic API and an intuitive admin app ideal for teams building headless CMS, internal tools, or data-driven applications.

With Northflank, you can deploy Directus in minutes using a one-click template or set it up manually. Northflank handles scaling, networking, and infrastructure, allowing you to focus on your content and API design.

Prerequisite

Before you begin, create a Northflank account.

What this tutorial covers

  • Deploying Directus with a one-click template on Northflank
  • Deploying Directus manually on Northflank

What is Northflank?

Northflank is a modern developer platform that makes it easy to build, deploy, and scale applications, databases, jobs, and GPU workloads. It abstracts away Kubernetes complexity with smart defaults, giving you production-ready deployments while still allowing advanced customization.

Option 1: Deploy Directus with a one-click template

You can launch Directus on Northflank in just a few minutes using the ready-made template. This option is ideal if you want to quickly spin it up or demo it without performing a manual setup.

image-27.png

Template overview

The Directus deployment on Northflank includes:

  • 1 PostgreSQL addon for data storage
  • 1 Redis addon for caching and session management
  • 1 MinIO addon for file and media storage (S3-compatible)
  • 1 Secret group for managing environment variables and credentials
  • 1 Directus service deployed from the official Docker image: directus/directus:11.7.2

Getting started

  1. Visit the Directus template on Northflank.
  2. Click Deploy.
  3. Northflank will automatically:
    • Create a project, database, Redis, MinIO, and the Directus deployment
    • Link all required credentials to your secret group
    • Expose a public URL for your Directus dashboard
  4. Once the deployment completes, open the generated public URL to access the Directus Admin UI.
  5. Log in using the credentials you set in the template arguments (ADMIN_EMAIL and ADMIN_PASSWORD).

Option 2: Deploy Directus manually on Northflank

If you want more flexibility or need to customize your setup, you can deploy Directus manually. This approach provides complete control over configuration and integration.

Note: You can also customise Northflank's one-click deploy templates.

Step 1: Create a Northflank project

Log in to your Northflank dashboard, click the “Create new” button (+ icon) in the top right corner of your dashboard. Then, select “Project” from the dropdown.

image-28.png

Projects serve as workspaces that group together related services, making it easier to manage multiple workloads and their associated resources.

Step 2: Configure your project

You’ll need to fill out a few details before moving forward.

  • Enter a project name, such as directus-project and optionally pick a color for quick identification in your dashboard.

  • Select Northflank Cloud as the deployment target. This uses Northflank’s fully managed infrastructure, so you do not need to worry about Kubernetes setup or scaling.

    (Optional) If you prefer to run on your own infrastructure, you can select Bring Your Own Cloud and connect AWS, GCP, Azure, or on-prem resources.

  • Choose a region closest to your users to minimize latency for calendar syncing and video calls.

  • Click Create project to finalize the setup.

image-29.png

Step 3: Create a PostgreSQL database

Inside your project, go to the Addons tab at the top menu and click "Create new addon". Then, select  PostgreSQL as the Addon type, give it a descriptive name such as directus-db, select your prefered version, and choose a compute plan size.

  • If you’re just testing or experimenting, the smallest option is cost-effective and sufficient.
  • For production, we recommend starting with nf-compute-50. This provides more resources and stability, ensuring Directus runs reliably under real workloads.

Once you’ve configured the settings, click Create addon to provision your database.

image-30.png

Step 4: Create a Redis addon

Next, you’ll need a Redis instance for caching and session management.

  1. Go to the Addons tab again and click Create new addon.
  2. Select Redis as the Addon type.
  3. Give it a name like directus-rd.
  4. Choose a version (the default latest version is recommended) and a compute plan.
  5. Click Create addon to provision your Redis service.

Redis helps Directus store sessions, authentication tokens, and caching data efficiently.

image-31.png

Step 5: Create a MinIO addon

If you want to manage file and media uploads within Directus, you can use MinIO an S3-compatible object storage.

  1. Navigate again to Addons → Create new addon.
  2. Select MinIO as the Addon type.
  3. Name it directus-s3 and select your preferred plan.
  4. Click Create addon to launch it.

Once it’s ready, you can connect it to Directus by setting the S3-related environment variables during service setup.

image-32.png

Step 6: Create a Secret group to store environment variables

Next, go to the Secrets tab and click Create Secret Group. Name it something easy to recognize, such as directus-secrets. This group will hold all the environment variables required by Directus. You can find the full list of supported variables in the Directus documentation.

image-33.png

If you don't want to go through the stress of manually configuring or searching for environment variables to use, you can use the already configured ones below:

DB_CLIENT="pg"
ADMIN_EMAIL={Update this}
ADMIN_PASSWORD={Update this}
SECRET=${fn.randomSecret(32)}
CACHE_ENABLED=true
CACHE_STORE="redis"
STORAGE_S3_DRIVER="s3"
STORAGE_S3_BUCKET="directus-uploads"
STORAGE_S3_REGION="us-east-1"
STORAGE_S3_FORCE_PATH_STYLE=true
DB_SSL__REJECT_UNAUTHORIZED=false
WEBSOCKETS_ENABLED=true
REDIS_ENABLED=true
CORS_ENABLED=true
CORS_ORIGIN="https://${refs.directus-server.ports.0.dns}"
CORS_CREDENTIALS=true
REFRESH_TOKEN_TTL="7d"
REFRESH_TOKEN_COOKIE_SECURE=true
REFRESH_TOKEN_COOKIE_SAME_SITE="None"
SESSION_COOKIE_SECURE=true
SESSION_COOKIE_SAME_SITE="None"
SESSION_COOKIE_TTL="1d"
IP_TRUST_PROXY=true

Notes about these values:

  • ADMIN_EMAIL and ADMIN_PASSWORD are your Directus admin credentials. Update them before deployment to secure your instance.
  • SECRET is automatically generated using fn.randomSecret(32) — this ensures a strong, unique key for session and token encryption.
  • DB_CLIENT="pg" tells Directus to use PostgreSQL as the database driver, matching the addon created in your Northflank project.
  • CACHE_ENABLED and CACHE_STORE="redis" enable caching and session management through the Redis addon.
  • The STORAGE_S3_* variables configure Directus to use MinIO as S3-compatible storage for file uploads and media.
  • DB_SSL__REJECT_UNAUTHORIZED=false allows SSL connections to the PostgreSQL database, even if the certificate is self-signed.
  • WEBSOCKETS_ENABLED=true activates real-time features like live updates in the Directus Admin UI.
  • CORS_* settings ensure secure cross-origin communication between your dashboard and API by automatically referencing your Northflank service domain.
  • REFRESH_TOKEN_* and SESSION_COOKIE_* settings handle secure authentication and session persistence across browser sessions.
  • IP_TRUST_PROXY=true is necessary when running behind a reverse proxy, which Northflank uses to route traffic.

Link the PostgreSQL, Redis, and MinIO addons to your secret group

Northflank addons like PostgreSQL, Redis, and MinIO expose connection details such as username, password, host, and ports.

Instead of copying these values manually into your secrets, you can link each addon directly to your secret group.

This way, whenever credentials are rotated, your Directus service automatically receives the updated values.

Under the Linked addons section:

  • For PostgreSQL, click Configure and map the following

    USERNAME → DB_USER

    PASSWORD → DB_PASSWORD

    DATABASE → DB_DATABASE

    HOST → DB_HOST

    PORT → DB_PORT

    image-34.png

  • For Redis, link

    REDIS_MASTER_URL → REDIS

    image-35.png

  • For MinIO, link

    ACCESS_KEY → STORAGE_S3_KEY

    SECRET_KEY → STORAGE_S3_SECRET

    MINIO_NDPOINT → STORAGE_S3_ENDPOINT

    image-36.png

Finally, click Create secret group to save everything.

Step 5: Create a deployment service

Within your project, navigate to the Services tab in the top menu and click “Create New Service.” Select Deployment and give your service a name such as directus-server.

For the deployment source, choose External image and enter the official Directus Docker image: directus/directus:11.7.2

image-37.png

Select compute resources

Choose the compute size that best matches your workload:

  • Small plans are fine for testing or lightweight usage.
  • Larger plans are recommended for production, as Directus can be resource-intensive under real-world traffic.

The flexibility to adjust resources later means you can start small and scale up as your usage grows.

image-38.png

Set up a port so your app is accessible:

  • Port: 8055
  • Protocol: HTTP
  • Public access: enable this to let people access your Directus instance from the internet

Northflank will automatically generate a secure, unique public URL for your service. This saves you from having to manage DNS or SSL certificates manually.

image-39.png

Deploy your service

When you’re satisfied with your settings, click “Create service.” Northflank will pull the image, provision resources, and deploy Label Studio.

Once the deployment is successful, you’ll see your service’s public URL at the top right corner, e.g.: p01--directus-server--lppg6t2b6kzf.code.run

image-40.png

Conclusion

Deploying Directus on Northflank gives you a production-ready way to manage data and content without worrying about infrastructure.

Whether you use the one-click template for speed or set it up manually for full control, Northflank handles scaling, storage, and networking so you can focus on building great digital experiences.

This setup is ideal for teams, startups, or organizations that need a flexible, secure, and scalable headless CMS platform with minimal operational overhead.

Share this article with your network
X