Deploy Strapi
Strapi 5 headless CMS on Postgres, admin ready on first boot
Strapi
Just deployed
Just deployed
Deploy and Host Strapi on Railway
Strapi is the leading open-source headless CMS. You model content types in the admin panel, editors fill them in, and Strapi serves them through a REST API (GraphQL with a plugin) to any website, app or static-site build. This template runs Strapi 5 in production mode on Postgres, with Media Library uploads on a volume and the super admin created on first boot.
About Hosting Strapi
Two services: Strapi (the admin panel and the API) and Postgres (content, users, settings). Uploads from the Media Library go to a volume at /data, so images and files survive redeploys.
A fresh Strapi shows a "create the first administrator" form at /admin to whoever opens it first. This template creates that account on first boot from STRAPI_ADMIN_EMAIL and STRAPI_ADMIN_PASSWORD instead, so the form is never offered. Every secret (APP_KEYS, the JWT secrets, token salts and the encryption key) is generated per deploy.
Common Use Cases
- A content backend for a Next.js, Nuxt, Astro, SvelteKit or mobile app
- A blog, docs or marketing site where editors work in the admin panel and developers fetch JSON
- Multi-language content with Strapi's built-in internationalization
- A user and permissions API (sign-up, login, roles) for an app's end users
Dependencies for Strapi Hosting
- Nothing else is required. Add an email provider or a storage provider plugin when you need them.
Deployment Dependencies
Implementation Details
First use:
- Open the Strapi service's domain at
/adminonce it's green. - Log in with
STRAPI_ADMIN_EMAIL(by defaultadmin@your Railway domain) andSTRAPI_ADMIN_PASSWORDfrom the Variables tab. - Change the email and password under your profile, top right.
- To call the API, create a token under Settings → API Tokens, or allow public read access per content type under Settings → Users & Permissions → Roles → Public.
curl https://‹your-domain›/api/articles -H "Authorization: Bearer ‹api token›"
Adding content types: Strapi only allows the Content-Type Builder in development mode, because content types are code in src/api. In Railway, open the Strapi service's Settings → Source and eject to get your own copy of this repository. Clone it, run npm install and npm run develop locally, build your content types, and push: Railway rebuilds with them. Content you enter in production stays in Postgres.
Plugins (GraphQL, SEO, an S3 or Cloudinary upload provider, an email provider) are added the same way: npm install them in your copy and push.
Notes and limits:
- The admin variables only matter on first boot. Change the password in Strapi afterwards.
- Keep
ENCRYPTION_KEY,API_TOKEN_SALTandAPP_KEYSunchanged: changing them breaks stored secrets, API tokens or sessions. - Set
PUBLIC_URLto your custom domain when you add one, so media URLs and the admin panel use it. - About 150 MB of RAM for Strapi and 80-130 MB for Postgres at idle, so it fits the smallest plans. Builds take a few minutes, since the admin panel is compiled at build time.
- Each template update moves to a newer Strapi release. Back up Postgres (Railway backups) before updating.
Why Deploy Strapi 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 Strapi 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.
Template Content