---
title: "Deploy Strapi | Open-source Headless CMS with DB and Meilisearch"
description: "Self Host Strapi: REST & GraphQL APIs, full-text search, admin panel"
category: "CMS"
url: https://railway.com/deploy/self-host-strapi
---

# Deploy Strapi | Open-source Headless CMS with DB and Meilisearch

Self Host Strapi: REST & GraphQL APIs, full-text search, admin panel

**[Deploy Strapi | Open-source Headless CMS with DB and Meilisearch on Railway](https://railway.com/template/self-host-strapi)**

- **Creator:** Heimdall
- **Category:** CMS
- **Total deploys:** 3

## Template content

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

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

### Meilisearch https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/meilisearch.svg

- **Image:** getmeili/meilisearch:v1.9.0
- **Public domain:** Yes

### Strapi https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/strapi.svg

- **Source:** https://github.com/railwayapp-templates/strapi
- **Health check:** /admin
- **Public domain:** Yes

## Documentation

![Strapi logo](https://cdn.sanity.io/images/2ejqxsnu/production/6a57cfd54a6354c93abc1e76ccdfc3fcf4a6c3c7-1138x302.png?w=3840&q=75&fit=clip&auto=format)

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`](https://github.com/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.
![Strapi railway arch](https://res.cloudinary.com/asset-cloudinary/image/upload/v1773124673/strapi_railway_arc_wsdexx.png)

---


## 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.

![Strapi dashboard screenshot](https://res.cloudinary.com/asset-cloudinary/image/upload/v1773124672/Heimdal_hxozdu.png)

---

## 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 `pg` module 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](https://github.com/railwayapp-templates/strapi)
- **Meilisearch Docker image:** `getmeili/meilisearch:v1.9.0`
- Strapi docs: [docs.strapi.io](https://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.

## Similar templates

- [Libredesk - Complete Setup](https://railway.com/deploy/libredesk-complete-setup) — [Jul'26] Complete self-hosted omnichannel customer support desk.
- [Paperless-ngx](https://railway.com/deploy/paperless-ngx-3) — Document management with OCR on Railway with PostgreSQL and Redis
- [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/self-host-strapi
