---
title: "Self-host Directus on Edge | Instant API over any database"
description: "Run Directus on Edge — Node.js on real VMs, S3-compatible file library backed by Edge Storage, global CDN for the API. Wrap any SQL database with a polished admin app and headless API."
url: https://edge.network/solutions/directus/
---

# Self-host Directus on Edge | Instant API over any database

For Directus

# Directus on Edge, any database, instant API

Wrap any SQL database with a polished admin app and a headless
API. Self-host on a real VM, store files in S3-compatible Edge
Storage, deliver globally through the Edge CDN.

[Start free](https://edge.network/account) [Read the deploy guide](https://edge.network/docs/compute/getting-started)

# .env — Directus + Edge Storage

DB_CLIENT="pg"

DB_HOST="127.0.0.1"

DB_DATABASE="directus"

STORAGE_LOCATIONS="edge"

STORAGE_EDGE_DRIVER="s3"

STORAGE_EDGE_ENDPOINT="https://storage.edge.run"

STORAGE_EDGE_BUCKET="directus-files"

STORAGE_EDGE_KEY="..."

STORAGE_EDGE_SECRET="..."

# Run as a systemd service

$ sudo systemctl enable --now directus

## Why Directus teams pick Edge

Real database access, real file storage, real network — without paying SaaS multiples for any of it.

### Bring your own SQL database

Postgres, MySQL, MariaDB, SQLite, MS SQL — Directus mirrors the schema and exposes a REST + GraphQL API instantly. Your data stays yours.

### S3-compatible file library

Configure the Directus file driver with Edge Storage credentials. Uploads, generated thumbnails and exports all live in a CDN-fronted bucket.

### On-the-fly image transforms

Directus has its own asset transformation API; for very high-volume sites you can offload to Edge Image Optimization at the CDN.

### Flows + webhooks at scale

Run automation flows on the same VM; long-running ones can fan out to a worker VM via private networking. No serverless time-outs to dance around.

### Global CDN for the API

Front the REST/GraphQL endpoints through the Edge CDN. Cache GETs aggressively, mutate at origin, no egress on the way out.

### Agent-deployable

The Edge agentic API can stand up a Directus instance, point a domain at it, and configure the file storage bucket — all from a single prompt.

Reference architecture

## How Directus maps to Edge

A small VM running Directus + Postgres, files in object storage, and the global CDN out front.

Compute Runs Directus (Node.js) + your existing or new SQL database

Storage S3-compatible file driver for the asset library

CDN Caches public API responses and asset URLs globally

Image Optimization Optional: replace Directus transforms with edge processing

DNS Anycast DNS for the API subdomain

# Front-end → Directus on Edge

import { createDirectus, rest } from '@directus/sdk'

const directus = createDirectus(

'https://cms.example.com'

).with(rest())

# Cached via Edge CDN

const articles = await directus.request(

readItems( 'articles' , { fields: ['*'] })

)

## Common questions

### Self-hosted vs Directus Cloud?

Directus Cloud is the official managed service. Self-hosting on Edge gives you root, custom extensions, and full control over your database — at the cost of running a VM yourself.

### Can I point Directus at an existing database?

Yes — that's arguably the killer feature. Directus introspects your existing schema and gives you an admin UI and API on top, without forcing migrations.

### How do I run flows and webhooks?

On the same VM for low-volume use, or split into a worker VM that handles flows separately. Both connect to the same database via Edge's private networking.

### How do I deploy custom extensions?

Mount your extensions folder, ship via git, restart the systemd service. Or build a Docker image and use our Docker stack page for a container-based deploy.

By Stack

## Other stacks on Edge

[View all stacks →](https://edge.network/solutions/stacks)
[Payload TypeScript-first headless CMS, Next.js-ready](https://edge.network/solutions/payload)[WooCommerce Self-host the world's most popular store](https://edge.network/solutions/woocommerce)[Medusa Modern headless commerce, Node.js-native](https://edge.network/solutions/medusa)[Magento Enterprise PHP commerce without Adobe pricing](https://edge.network/solutions/magento)

## Ship Directus on Edge

Start free. Bring an existing database or scaffold a fresh project.

[Start free](https://edge.network/account) [Talk to an engineer](https://edge.network/contact)
