---
title: "Deploy Strapi"
description: "Strapi 5 with Postgres, admin created at deploy, uploads on a volume"
category: "CMS"
url: https://railway.com/deploy/strapi-2
---

# Deploy Strapi

Strapi 5 with Postgres, admin created at deploy, uploads on a volume

**[Deploy Strapi on Railway](https://railway.com/template/strapi-2)**

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

- **Creator:** Dektion
- **Category:** CMS
- **Total deploys:** 1

## Template content

### Strapi https://raw.githubusercontent.com/strapi/strapi/v5.55.1/packages/core/admin/admin/src/assets/images/logo-strapi-2022.svg

- **Source:** dektionstudio/railway-template-images
- **Health check:** /_health
- **Public domain:** Yes

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

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:17

## Documentation

# Deploy and Host Strapi on Railway

[Strapi](https://github.com/strapi/strapi) is an open-source headless CMS. You define content types, editors fill them in an admin panel, and your website or app reads them through a REST or GraphQL API.

This template runs Strapi 5.55.1 with Postgres, the first admin created at deploy and uploads on a volume.

## About Hosting Strapi

A new Strapi asks whoever opens `/admin` first to register the admin account, so a fresh deploy on a public URL can be claimed by someone else before you get there. Here Strapi creates the admin from `STRAPI_ADMIN_EMAIL` (you enter it when deploying) and `STRAPI_ADMIN_PASSWORD` (generated) before it starts listening, and the admin registration refuses anyone else.

Railway serves your app over HTTPS through a proxy. Strapi 5.55 only trusts the proxy's headers when `server.proxy.koa` is set; the plain `proxy: true` that older guides use is ignored. The config here sets `proxy.koa`, so Strapi knows requests are secure and marks the admin session cookie as secure.

Strapi runs in production mode, where the Content-Type Builder is read-only, because content types are code files in the project. To add your own, copy the project folder into your own repo, run `npm run develop` locally, build the types in the admin panel, commit, and point the Strapi service at your repo. The steps are in the project's README. Content, users and API tokens live in Postgres and uploaded files on the volume, so they stay when you switch the source.

Strapi's end-user sign-up (`/api/auth/local/register`, for your app's users, not the admin panel) is on by default, as in any Strapi. If your app doesn't use it, turn it off in Settings &gt; Users &amp; Permissions plugin &gt; Advanced settings.

Before publishing I tested it on Railway. The admin already existed at the first request, a stranger's attempt to register the first admin was refused, and the admin signed in with a secure session cookie and the Super Admin role. A full-access API token uploaded a file, which was then served from `/uploads`, and created an end user through the content API. After restarting Strapi and Postgres the admin signed in again, the file was served with the same content and the user was still there.

Idle, Strapi used 0.16 GB of RAM and Postgres about 0.1 GB, around $3 a month on Railway's usage pricing.

## Common Use Cases

- Content backend for a Next.js, Nuxt, Astro or mobile app, edited by people who don't write code
- Blog, docs or marketing pages managed in an admin panel and published through the API
- A small catalog or structured data store with roles, API tokens and media uploads

## Dependencies for Strapi Hosting

Nothing beyond the template. To add content types you need Node.js 20 or newer on your computer and a Git repository of your own.

### Deployment Dependencies

- Strapi: https://github.com/strapi/strapi
- Docs: https://docs.strapi.io
- The project this template builds: https://github.com/dektionstudio/railway-template-images/tree/main/strapi

### Implementation Details

```
STRAPI_ADMIN_URL                            # open this and sign in
STRAPI_ADMIN_EMAIL / STRAPI_ADMIN_PASSWORD  # the first admin (password generated)
PUBLIC_URL                                  # change it when you add a custom domain
curl -H "Authorization: Bearer " "$PUBLIC_URL/api/upload/files"
```

Create API tokens in Settings &gt; API Tokens.

## Why Deploy Strapi on Railway?

Strapi and Postgres run side by side on Railway's private network and uploads stay on a volume, so you get a working CMS on HTTPS in one deploy. The tradeoff is production mode: schema changes go through Git, while content editing happens in the admin panel.


## 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/strapi-2
