How to self-host Directus on Ownkube

A step-by-step guide to self-hosting Directus, the open-source headless CMS, on Ownkube with a managed Postgres database, a Valkey cache, and automatic TLS.

Ownkube team | | How-To | 5 min

Directus turns an existing Postgres database into an admin studio with a REST and GraphQL API, and you can have it running on Ownkube in a few minutes with the official image, a managed database, and a public URL that already has TLS on it.

This walks through the fastest shipped path (Ownkube’s Directus recipe in the Marketplace), the exact environment variables it wires up so you know what is actually happening under the hood, and the manual path if you want to build your own image instead.

TL;DR

  • Deploy Directus from Ownkube’s Marketplace using the official directus/directus image, pinned to a known tag, no Dockerfile required.
  • Ownkube provisions a managed Postgres database box (from $4/month) and wires the connection string into DB_CONNECTION_STRING for you.
  • KEY and SECRET, Directus’s own app secrets, plus the admin password, are generated automatically and revealable after deploy. You only supply the admin email.
  • A managed Valkey cache is wired in too, since a shared cache is Directus’s own recommended production setup.
  • The app gets a public *.ownkube.app hostname with automatic TLS as soon as its health check passes.

What you need before you start

An Ownkube account is all it takes, no cloud account of your own required. The Personal plan is $5 a month, which loads $5 of wallet credit you then spend on the database box and the app’s compute. Sign in at app.ownkube.io if you have not already.

Step 1: Open the Directus recipe in the Marketplace

Ownkube’s Marketplace has a Directus recipe that provisions three resources in one action: the Directus web app, a managed Postgres database, and a managed Valkey cache. Open it at app.ownkube.io/marketplace/directus-postgres. The Marketplace is in public early access, so the catalog page is browsable without an account, but deploying requires signing in.

Step 2: Set the one input Directus needs

The recipe asks for a single value: the email for the first Directus admin account.

ADMIN_EMAIL=you@example.com

You do not pick a password here. Directus’s admin password is generated for you and shown on the deployment page after it comes up, so there is nothing to type twice or forget.

Step 3: Choose your Postgres box size

Managed Postgres on Ownkube runs on a reserved database box starting at $4 a month, plus storage at $0.15 per GB a month, with backups included. It is single-instance and private to the app’s region today (multi-instance failover and public access are on the roadmap, not available yet). Pick a box size on the deploy form; this is what actually gets billed from your wallet for the database, separate from the app’s own compute.

Step 4: Deploy and let Ownkube wire the environment

Once you confirm, Ownkube provisions the database first, then starts the Directus container from the official directus/directus image (currently pinned at 11.17.4) with the connection details already wired in. The environment it sets looks like this:

DB_CLIENT=pg
DB_CONNECTION_STRING=postgresql://app:***@<managed-postgres-host>:5432/app
CACHE_ENABLED=true
CACHE_STORE=redis
REDIS=redis://:***@<managed-valkey-host>:6379
ADMIN_EMAIL=you@example.com
KEY=<generated>
SECRET=<generated>
ADMIN_PASSWORD=<generated>

DB_CONNECTION_STRING is Directus’s own env for a single Postgres URI, so there is no separate host, port, and credentials to assemble by hand. REDIS takes the cache’s connection URI directly, and CACHE_STORE=redis moves Directus’s API cache off the container’s local disk and onto the shared Valkey cache, so it survives restarts and stays consistent if you ever scale to more than one replica. KEY and SECRET are Directus’s own secrets for signing tokens and encrypting data, generated once at launch and stored, not something you need to invent yourself.

Ownkube waits for a readiness check against /server/health before it exposes the app publicly, so the URL stays private until Directus is actually able to serve requests.

Step 5: Log in and reveal the generated password

Once the deployment is healthy, Ownkube assigns it a public hostname on the shared region edge with TLS already issued, no certificate to request or renew. Open it, reveal the generated admin password on the deployment page, and sign in with the email you set in step 2. From there Directus’s admin studio is where you build collections, each one becoming a table in your own Postgres database.

Deploying a customized Directus image instead

The recipe above is the fastest way to run Directus’s official image as-is. If you need to bake in your own extensions or a custom Dockerfile on top of directus/directus, connect a GitHub repository instead: Ownkube builds from a Dockerfile if the repo has one, or auto-detects and builds if it does not. In that path you add a managed Postgres database to the project yourself, copy the connection string from the database’s Connect tab, and set the same environment variables by hand:

DB_CLIENT=pg
DB_CONNECTION_STRING=<paste from the database's Connect tab>
KEY=<generate your own, e.g. openssl rand -hex 32>
SECRET=<generate your own, e.g. openssl rand -hex 32>
ADMIN_EMAIL=you@example.com
ADMIN_PASSWORD=<a password you choose>

The Marketplace recipe does this wiring for you automatically; a custom image build means doing it by hand, which is worth it only if you actually need to change what is inside the container.

Move it to your own AWS later, with no rewrite

If Directus outgrows what you want to run on Ownkube Compute, the same app, the same Postgres data, and the same image move into your own AWS account with no rewrite. Logs, metrics, and health checks travel with it, so you are not starting your observability over. If you are weighing this against a platform like Railway, our Railway alternative comparison covers how that portability plays out in practice.

FAQ

Is self-hosting Directus on Ownkube free?

No. There is no free tier on Ownkube Compute. The Personal plan is $5 a month, which loads $5 of wallet credit, and the database box for this recipe starts at $4 a month. Unused wallet credit rolls over and never expires, so a quiet month is not money lost.

Does Ownkube run the actual official Directus image?

Yes. The recipe pulls directus/directus straight from Docker Hub at a pinned version, not a custom fork or a repackaged build.

Can I use MySQL instead of Postgres?

Not today. Postgres is the only managed relational database engine on Ownkube.

Do I need to manage a TLS certificate myself?

No. The public hostname Ownkube assigns gets TLS automatically, issued and renewed on the shared region edge.

Where do I find the generated admin password later?

It stays revealable on the deployment’s detail page in the dashboard, so you can look it up again if you lose it.

Where Ownkube fits

If you want Directus’s admin studio and API without running Postgres, a cache, and a container host yourself, the Marketplace recipe gets you there with the official image, generated secrets, and a TLS-covered URL in one action. Deploy your first app.

More posts