Deploy Strapi | Open-source Headless CMS with DB and Meilisearch
Self Host Strapi: REST & GraphQL APIs, full-text search, admin panel
DB & Search
Just deployed
/var/lib/postgresql/data
Meilisearch
Just deployed
/meili_data
Just deployed
/public/uploads

This is a content writing task — no special skill needed. Here's the full Railway template overview:
Deploy and Host Strapi
Deploy a fully configured, self-hosted Strapi instance on Railway in one click. This template provisions Strapi from the railwayapp-templates/strapi GitHub repo alongside a managed PostgreSQL database for persistent storage and Meilisearch (getmeili/meilisearch:v1.9.0) for fast full-text search — all pre-wired with internal private networking, auto-generated secrets, and zero manual configuration.

Getting Started with Strapi on Railway
After deploying, open your Railway project's public domain at /admin — e.g. https://your-app.railway.app/admin. You'll be prompted to register the first administrator account; this is your superadmin. From there, use the Content-Type Builder to define your data models, then switch to Content Manager to start adding entries. Your REST API is immediately live at /api/[content-type] and requires an API token (generated under Settings → API Tokens) for authenticated access.

About Hosting Strapi
Strapi is an open-source, Node.js-based headless CMS that decouples content management from content delivery. It exposes your content via REST or GraphQL APIs, letting you push data to any frontend — Next.js, React Native, Vue, or IoT devices — without being locked into a templating layer.
Key features:
- REST and GraphQL APIs out of the box
- Customisable content types via a visual builder
- Role-based access control (RBAC) and API token management
- Plugin ecosystem: i18n, media library, Meilisearch, and more
- Self-hosted or Strapi Cloud — you own your data either way
Template architecture: Strapi (port 1337) connects to Postgres over Railway's private network for persistent content storage, and to Meilisearch (port 7700) for search indexing — no public exposure of either dependency required.
Why Deploy Strapi on Railway
Running Strapi on a VPS means managing Node.js versions, PM2 process managers, Nginx reverse proxies, SSL renewals, and database backups yourself. Railway removes that entire layer:
- Private networking — Postgres and Meilisearch communicate with Strapi over internal hostnames, never the public internet
- Auto-generated secrets —
APP_KEYS,JWT_SECRET,ENCRYPTION_KEY, and all salts are provisioned securely on deploy - Managed Postgres — persistent storage with connection pooling, no
pgmodule debugging required - Git-based deploys — push to your fork of the GitHub repo and Railway redeploys automatically
- Instant rollbacks — every deploy is versioned
Common Use Cases
- Marketing and editorial sites — manage blog posts, landing pages, and structured content served to a Next.js or Astro frontend
- eCommerce backends — model product catalogues, inventory, and personalisation data via API, delivered omnichannel
- Mobile app content layer — serve dynamic content to iOS/Android apps without rebuilding and resubmitting for copy changes
- Multi-tenant SaaS platforms — use RBAC and API tokens to isolate content access per customer or team
Dependencies for Strapi
- PostgreSQL — primary relational database for all Strapi content, user, and configuration data
- Meilisearch (
getmeili/meilisearch:v1.9.0) — typo-tolerant full-text search engine, integrated via the Strapi Meilisearch plugin
Environment Variables Reference
| Variable | Description | Required |
|---|---|---|
URL | Public base URL of your Strapi app | Yes |
APP_KEYS | Comma-separated session security keys | Yes |
JWT_SECRET | Secret for user authentication tokens | Yes |
ADMIN_JWT_SECRET | JWT secret for admin panel auth | Yes |
API_TOKEN_SALT | Salt for API token generation | Yes |
ENCRYPTION_KEY | Key for encrypting sensitive data | Yes |
DATABASE_URL | Internal Postgres connection string | Yes |
DATABASE_PUBLIC_URL | External Postgres connection string | Yes |
MEILISEARCH_HOST | Internal Meilisearch endpoint URL | Yes |
MEILISEARCH_ADMIN_API_KEY | Master key for Meilisearch admin access | Yes |
PORT | Strapi HTTP port (default: 1337) | Yes |
STRAPI_TELEMETRY_DISABLED | Disable usage telemetry reporting | No |
All secrets are auto-generated via Railway's secret(32) helper on first deploy.
Deployment Dependencies
- Node.js 20, 22, or 24 (handled by Railway's build environment)
- Strapi GitHub repo: railwayapp-templates/strapi
- Meilisearch Docker image:
getmeili/meilisearch:v1.9.0 - Strapi docs: docs.strapi.io
Minimum Hardware Requirements for Strapi
Strapi's Node.js build process is memory-intensive. Recommended minimums for a stable self-hosted deployment:
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2 vCPU |
| RAM | 1 GB | 2 GB |
| Storage | 10 GB | 20 GB+ |
| Node.js | v20 LTS | v22 LTS |
The admin panel build (npm run build) requires at least 1 GB of RAM. Deployments on under-resourced instances will fail silently during build.
Self-Hosting Strapi Outside Railway
To run this template's stack on your own machine or VPS:
# Clone the Railway template repo
git clone https://github.com/railwayapp-templates/strapi
cd strapi
# Install dependencies
npm install
# Copy and configure environment variables
cp .env.example .env
# Edit .env with your Postgres and Meilisearch connection details
# Build the admin panel
NODE_ENV=production npm run build
# Start in production
NODE_ENV=production npm run start
For Meilisearch, run the official Docker image alongside it:
docker run -d \
-p 7700:7700 \
-e MEILI_MASTER_KEY=your_master_key \
-e MEILI_ENV=production \
-v $(pwd)/meili_data:/meili_data \
getmeili/meilisearch:v1.9.0
Point MEILISEARCH_HOST=http://localhost:7700 and MEILISEARCH_ADMIN_API_KEY in your .env accordingly.
Strapi vs Contentful vs Sanity
| Strapi | Contentful | Sanity | |
|---|---|---|---|
| Open source | Yes | No | Partial |
| Self-hostable | Yes | No | No |
| Pricing | Infrastructure only | From $300/mo | Free tier, then usage-based |
| Database | PostgreSQL, MySQL, SQLite | Hosted only | Hosted only |
| API | REST + GraphQL | REST + GraphQL | GROQ + REST |
| Plugin ecosystem | Community plugins | Marketplace apps | Studios |
Strapi's primary advantage over Contentful and Sanity is full data ownership. When you self-host on Railway, you pay only for compute and storage — there are no per-seat or per-API-call fees at scale.
How Much Does Strapi Cost?
Strapi itself is free and open-source (MIT licence). Your only cost is the infrastructure you run it on — in this case, Railway's compute and storage. Strapi does offer a managed Strapi Cloud product with paid tiers starting around $29/month, and an Enterprise Edition that adds SSO, audit logs, and SLA-backed support for larger teams. For most projects, the self-hosted open-source version on Railway covers everything needed.
FAQ
What is Strapi? Strapi is a flexible, open-source headless CMS used for websites, mobile apps, and eCommerce platforms. It exposes content via REST or GraphQL APIs and offers advanced customisation, role-based access control, and robust security features including API tokens and data encryption.
What does this Railway template deploy? It deploys Strapi connected to a managed PostgreSQL database (for persistent content storage) and Meilisearch (for full-text search), all pre-configured with internal private networking and auto-generated secrets.
Why is Postgres included instead of SQLite? SQLite resets on redeploy in ephemeral environments. Postgres persists data across deployments and restarts, making it the correct choice for any production Strapi instance on Railway.
What is Meilisearch used for in this template?
Meilisearch powers Strapi's search functionality via the official Meilisearch plugin. It indexes your content types and returns typo-tolerant results significantly faster than database-level LIKE queries.
Can I use this template for a production site?
Yes. All secrets are auto-generated, Postgres is persistent, and Strapi runs in production mode (NODE_ENV=production). You should configure a custom domain and review RBAC settings before going live.
Does Strapi support GraphQL?
Yes. Install the @strapi/plugin-graphql package and a /graphql endpoint becomes available alongside the default REST API.
Template Content
Meilisearch
getmeili/meilisearch:v1.9.0