Headless CMS for your AI-built frontend on Railway

By Tracklayer · Updated 2026-11-20

Short answer: a headless CMS stores your content and serves it over an API, so a frontend built with an AI tool can fetch it. Directus is one option you can host on Railway: it turns a SQL database into REST and GraphQL APIs with a visual Studio for content, files and users. Tracklayer’s template runs Directus 12 with Postgres, Redis and a file Bucket, and creates the administrator for you.

Deploy Directus on Railway

When you need a headless CMS

AI app builders are good at generating a frontend in Next.js, Nuxt, Astro or SvelteKit. They are less reliable at inventing a content backend: editors, roles, image uploads and an API that stays stable. A headless CMS covers that part, and the generated frontend only needs to call its API.

The template’s README lists these uses:

Which headless CMS templates people deploy

TemplateCreatorDeploymentsServices
StrapiMilo's Projects7,6762
WordPressJack7,5642
DirectusMedim's Projects3,2943
Ghost + MySQLalphasec1,4622
Instatic CMS - SQLiteInstatic1,3951
GhostFaraz Patankar1,3332
Strapi 5Szilard Koppel's Projects9002
DirectusDirectus8853

Railway marketplace data as of 2026-11-19. Full ranking: Best headless CMS templates on Railway.

Compare services, storage and login handling before you pick. For a CMS the questions that matter are: where do uploaded files go, who can create the first admin, and what licence applies.

What the Directus template deploys

Service Role Storage
Directus 12.6.1 API, Studio, WebSockets, MCP; public on port 8055 None; files in the Bucket
Postgres 18 with PostGIS 3.7 Content, users, settings Volume
Redis 8.2 Cache, rate limits, multi-replica sync Volume
Railway Bucket Uploaded files and extensions S3-compatible bucket

Versions are pinned by digest. PostGIS means geometry fields and map layouts work.

Deploy Directus, step by step

  1. Deploy the template. It creates Directus, Postgres, Redis and a Bucket. Secrets are generated.
  2. Wait until the Directus deployment is active. The start script waits for Postgres and Redis before it opens the port.
  3. Open the admin. Go to https://{your-domain}/admin. Sign in with ADMIN_EMAIL (default admin@example.com) and ADMIN_PASSWORD from the Directus service’s Variables tab. There is no shared default password.
  4. Set your own e-mail. Change it under the user menu, or set ADMIN_EMAIL before the first deploy.
  5. Create collections and a token. Build your content model in the Studio, then call the REST or GraphQL API from your frontend. Frontends in the same Railway project can reach the API privately at http://${{Directus.RAILWAY_PRIVATE_DOMAIN}}:8055.
  6. Set PUBLIC_URL for a custom domain. Use https://{your-custom-domain}.

If you lose the admin password, set ADMIN_PASSWORD (8 to 256 characters) and DIRECTUS_RESET_ADMIN_PASSWORD=true, redeploy, log in, then set the flag back to false.

What persists

Content is in Postgres on a volume and files are in the Bucket, so redeploying Directus loses nothing. To scale, raise the replica count on the Directus service. Files live in the Bucket, and cache, locks and WebSockets go through Redis, so replicas need no extra setup.

Costs

Railway bills usage. The template README gives measurements taken idle on Railway: Directus about 260 MiB, Postgres about 180 MiB and Redis about 25 MiB, with near-zero CPU. It states roughly $5 to $7 per month idle, plus Bucket storage at $0.015 per GB-month. Each service fits the Trial plan’s 1 GB per service. Directus also started and served requests with a 0.5 GB limit, but heavy image transformations or large imports need more memory, so raise the limit if you see restarts. Treat these as the README’s own figures, not a quote for your workload.

Licence notes

Directus is source-available under the Monospace Sustainable Core License 1.0 (MSCL), not an OSI open-source licence. In short:

This summary is not legal advice. Read the licence, and ask counsel if your use is unclear. Check the seat and collection limits against your project before you build on Directus.

Limits

Other options

Browse the full headless CMS ranking for other CMS templates. For a general backend for an app built with AI tools, see the backend guide. More guides are listed at /guides/.

FAQ

How do I log in to Directus after deploying?

Open https://{your-domain}/admin and sign in with ADMIN_EMAIL (default admin@example.com) and the generated ADMIN_PASSWORD from the Directus service's Variables tab. The administrator is created during the first start, before the public port opens, so nobody else can complete the onboarding screen. Change the e-mail to your own under the user menu.

Is Directus open source? What are the limits without a licence key?

Directus is source-available under the Monospace Sustainable Core License 1.0 (MSCL), not an OSI open-source licence, and each version also becomes GPL-3.0 four years after release. Without a key it runs on the Core tier: 3 seats, 25 active collections, 5 active flows, 30 days of activity and revision history, no SSO and no custom permission rules, with telemetry on. Organisations under USD 5M annual revenue and 50 employees can get a free Open Innovation Grant key; larger ones needing more than Core need a commercial licence. Offering Directus as a competing commercial service is not permitted. This is not legal advice.

Do I lose uploaded files when the service redeploys?

No. Content lives in Postgres on a volume, and uploads and extensions go to a Railway Bucket, so the Directus service keeps no local state. Redeploys lose nothing and replicas work without extra setup.

How much does it cost to run?

Railway bills usage. The template's README measured idle memory at about 260 MiB for Directus, 180 MiB for Postgres and 25 MiB for Redis, and states roughly $5 to $7 per month idle plus Bucket storage at $0.015 per GB-month. Heavy image transformations or large imports need more memory.

Can Directus send password-reset e-mails?

Only after you configure a mail transport: set EMAIL_FROM and EMAIL_TRANSPORT (smtp, mailgun, sendgrid or ses) with its EMAIL_* settings. Railway allows outbound SMTP only on Pro plans, so on other plans use Mailgun or SendGrid, which use HTTP APIs.