Railway

Deploy Directus | (Just Updated) Headless CMS You Can Actually Log Into

Seeds the admin account a stock deploy never creates. Uploads on a volume.

Deploy Directus | (Just Updated) Headless CMS You Can Actually Log Into

Just deployed

/directus/uploads

Just deployed

/var/lib/postgresql

Deploy and Host Directus on Railway

Directus is an open-source headless CMS and data platform: point it at a SQL database and it gives you an admin app, a REST and GraphQL API, roles and permissions, file storage, flows and webhooks over your own schema. This template deploys it with the administrator account already created, because a stock Directus deploy creates no user at all and offers no way to make one.

About Hosting Directus

This template runs Directus 12.3.0 as two services: the app itself with its file library on a persistent volume, and PostgreSQL for the schema, content, users and permissions. The administrator is seeded during the boot sequence, before the public port is ever opened, and the password is re-applied on every boot, so a redeploy doubles as a working password reset. The volume is ownership-repaired before Directus starts, because Railway mounts volumes as root while the Directus image runs as an unprivileged user. SECRET is generated once per deployment and published as a template variable, so sessions and tokens survive a restart. The app honours Railway's injected port and is healthchecked on /server/ping.

Why Deploy Directus on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Directus on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

  • You can actually sign in — Directus only creates the first administrator when the admin credentials are present at install time. Without them the server starts, the healthcheck passes, and the user table is empty forever: no HTTP route creates the first account. Here the account exists before the URL answers a request.
  • Uploads survive a redeploy — the file library sits on a volume whose ownership is repaired for the unprivileged user Directus runs as, so writes actually land on disk.
  • Password reset by redeploy — the credential is re-applied each boot from the template variable, which is the only recovery path a deployment with no SMTP account has.
  • Pinned and prebuilt — a fixed upstream version on an app that migrates its schema forward on boot, pulled as an image rather than rebuilt on your build minutes.

Common Use Cases

  • A backend for a website or app — model your content, then read it over REST or GraphQL from Next.js, Nuxt, Astro or a mobile client.
  • An admin panel over an existing database — Directus introspects tables you already have and gives your team a UI for them without generating a new schema.
  • Digital asset management — upload, transform and serve images and documents with per-role access rules.

Dependencies for Directus Hosting

  • PostgreSQL (included in this template) for schema, content, users and permissions.
  • A volume mounted at /directus/uploads (included) for the file library.

Deployment Dependencies

Implementation Details

Sign in at your deployment's URL with ADMIN_EMAIL and the generated ADMIN_PASSWORD from the service variables. To rotate the password, change ADMIN_PASSWORD and redeploy; the new value is applied during boot.

Keep SECRET stable — changing it invalidates every existing session and token.


Template Content

More templates in this category

View Template
Libredesk - Complete Setup
[Jul'26] Complete self-hosted omnichannel customer support desk.

codestorm
1
View Template
Paperless-ngx
Document management with OCR on Railway with PostgreSQL and Redis

INAPP
1
View Template
Instatic CMS - Postgres
Design, build and manage powerful static sites from state-of-the-art CMS

Instatic
140