---
title: "Deploy Directus"
description: "Headless CMS and data platform with Postgres, Redis and S3 bucket storage"
category: "CMS"
url: https://railway.com/deploy/directus-1
---

# Deploy Directus

Headless CMS and data platform with Postgres, Redis and S3 bucket storage

**[Deploy Directus on Railway](https://railway.com/template/directus-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/directus-1/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** CMS

## Template content

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2.11@sha256:b0b01167ff47bc3868e56a967895a26be4230891a1f42a78ab61cdd227accc8d
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18.6@sha256:4fc833b43d2aaf6ecc9b18615f5533602b723a32d0e2efe2dae8ca0f7217c863

### Directus https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/directus.svg

- **Image:** directus/directus:12.6.1@sha256:e1561b5e526e8e7a2ac19b7bb6eab63611dd84a862a8c45b864118768a2baff4
- **Start command:** `/bin/sh -c 'export DB_CLIENT=pg IP_TRUST_PROXY="${IP_TRUST_PROXY:-true}" CACHE_ENABLED="${CACHE_ENABLED:-true}" CACHE_STORE="${CACHE_STORE:-redis}" CACHE_AUTO_PURGE="${CACHE_AUTO_PURGE:-true}" RATE_LIMITER_ENABLED="${RATE_LIMITER_ENABLED:-true}" RATE_LIMITER_STORE="${RATE_LIMITER_STORE:-redis}" SYNCHRONIZATION_STORE="${SYNCHRONIZATION_STORE:-redis}" WEBSOCKETS_ENABLED="${WEBSOCKETS_ENABLED:-true}" STORAGE_LOCATIONS="${STORAGE_LOCATIONS:-s3}" STORAGE_S3_DRIVER="${STORAGE_S3_DRIVER:-s3}" EXTENSIONS_LOCATION="${EXTENSIONS_LOCATION:-s3}" LOG_STYLE="${LOG_STYLE:-raw}"; exec node docker-entrypoint.cjs'`
- **Health check:** /server/ping
- **Public domain:** Yes

## Buckets

- **Bucket**

## Documentation

# Deploy and Host Directus on Railway

Directus is a data platform and headless CMS. It sits on top of a SQL database, gives your team a no-code app for managing content and files, and generates REST and GraphQL APIs for the same data. Directus 12 is source-available under the MSCL-1.0-GPL licence.

## About Hosting Directus

Hosting Directus means running its Node.js server next to a SQL database, with durable storage for uploaded files and a shared cache. This template runs the official `directus/directus` 12.6.1 image, pinned by digest, with Railway's PostgreSQL, Redis for caching, rate limiting and websocket sync, and a Railway bucket for uploads and extensions, so the Directus service keeps no local state. On first boot Directus creates its tables and an administrator from the email you enter and a generated password. Database, Redis and bucket credentials are wired in with Railway reference variables, and a `/server/ping` health check gates every deploy.

## Common Use Cases

* Headless CMS for websites and apps built with Next.js, Nuxt, Astro or mobile frameworks
* Admin app plus REST and GraphQL APIs over a PostgreSQL database
* Digital asset library, internal tools and content workflows with roles and permissions

## Dependencies for Directus Hosting

* PostgreSQL 18 (Railway's `postgres-ssl` image, with a volume)
* Redis 8.2 (cache, rate limiter and websocket sync, with a volume)
* Railway bucket (S3-compatible storage for uploads and extensions)

### Deployment Dependencies

* [Directus v12.6.1 release notes](https://github.com/directus/directus/releases/tag/v12.6.1)
* [Directus self-hosting guide](https://directus.com/docs/self-hosting/deploying)
* [Directus configuration reference](https://directus.com/docs/configuration/general)
* [`directus/directus` image on Docker Hub](https://hub.docker.com/r/directus/directus)
* [Directus licensing overview](https://directus.com/docs/licensing/overview)

### Implementation Details

**First sign-in.** Open your Railway domain and sign in with `ADMIN_EMAIL` and the generated `ADMIN_PASSWORD` (Directus service → Variables), then change the password in your user profile. Directus creates this admin only on the first boot, so changing `ADMIN_PASSWORD` later has no effect. Because the admin exists from the start, a stranger can't use Directus's first-run setup screen to claim your new instance.

**Licence.** Directus 12 is licensed under MSCL-1.0-GPL. Instances without a licence key run on the Core tier, which has plan limits on user seats and collections. Individuals and organisations with under $5M annual revenue and fewer than 50 employees can get a free licence key through the [Open Innovation Grant](https://directus.com/oig). Features such as SSO, custom permission rules and higher limits need a licence. Add a key under Settings → License.

**Settings.** The start command sets these defaults: Postgres client, `IP_TRUST_PROXY=true`, Redis-backed cache (with auto-purge), rate limiter and sync store, websockets on, and S3 storage for files (`STORAGE_LOCATIONS=s3`) and extensions (`EXTENSIONS_LOCATION=s3`). To override any of them except the database client, add a service variable with the same name.

**Email.** No mail server is configured, so password-reset and invite emails won't be sent. To enable them, set `EMAIL_TRANSPORT=smtp`, `EMAIL_FROM` and the `EMAIL_SMTP_*` variables.

**Health check.** Since Directus 12, `/server/health` requires a signed-in user, so the template checks `/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.



## Similar templates

- [Libredesk - Complete Setup](https://railway.com/deploy/libredesk-complete-setup) — Complete self-hosted omnichannel customer support desk.
- [Paperless-ngx](https://railway.com/deploy/paperless-ngx-3) — Paperless-ngx — document management with OCR and full-text search
- [Instatic CMS - Postgres](https://railway.com/deploy/instatic-cms-postgres) — Design, build and manage powerful static sites from state-of-the-art CMS

Open this page in a browser: https://railway.com/deploy/directus-1
