Deploy ApostropheCMS

Node.js CMS where editors change pages on the page itself

Deploy ApostropheCMS

MongoDB

mongo:8.0

Just deployed

/data/db

Just deployed

/app/data

Deploy and Host ApostropheCMS on Railway

ApostropheCMS is an open-source content management framework on Node.js, Express and MongoDB, known for in-context editing: an editor opens the live page, clicks the area they want to change, and edits it where it appears rather than in a separate admin form. Developers get a module system where a page type, widget or content type is one directory, and every content type gets a REST API automatically — so one project can serve server-rendered pages and act as a headless backend.

This template lets you deploy ApostropheCMS on Railway without assembling the pieces yourself. The apostrophe service builds an ApostropheCMS 4 project from a GitHub repository — the official Essentials starter kit plus a production Dockerfile — and reaches a managed MongoDB over the private network for pages, media records and sessions. A volume at /app/data holds uploads and their resized variants, the administrator is created on first boot, and the asset bundle is compiled into the image. To self-host ApostropheCMS beyond the defaults, fork github.com/gridalpha/apostrophe-railway and build your site there.

Diagram of the Apostrophe and MongoDB services on Railway

Getting Started with ApostropheCMS on Railway

Set ADMIN_PASSWORD when you deploy — the only value the template needs — and optionally ADMIN_USERNAME, which defaults to admin. Open the generated Railway URL; the home page shows a short welcome block until you give it content. Go to /login and sign in. ApostropheCMS has no public registration, so this account is the only way in until you add users under Users.

Signed in, the admin bar appears on every page. Click Edit in the context bar to enter edit mode: dotted outlines mark each editable area and the round + handles insert a rich text, image, video or layout widget. Add an image widget and upload a file — that proves the volume is mounted and the media pipeline works, since Apostrophe writes the original plus resized copies under /uploads/attachments/. Press Update to publish the draft, use Pages for child pages and Images for the media library. Then open the public URL in a private window and confirm it renders anonymously.

ApostropheCMS home page with rich text and an uploaded image Editing an Apostrophe page in place with widget controls Apostrophe media library holding four uploaded images Apostrophe page manager showing a three page site tree

About Hosting ApostropheCMS

ApostropheCMS sits between a page builder marketers like and a framework developers can live in. Editors manipulate the real page; developers get plain JavaScript modules, Nunjucks or JSX templates, and a schema that generates the editing interface and the API from one field definition. Teams self-host it to own the content database, run the CMS beside their other infrastructure, or embed a CMS in a product they ship.

  • In-context visual editing, with a draft and a published version of every document
  • A page tree with nesting, reordering and per-document publish state
  • A media library that resizes and crops images on upload
  • Custom page types, piece types and widgets as project modules
  • An automatic REST API over every content type
  • Localization, and roles for admins, editors and contributors

apostrophe runs the Node application in cluster mode, serving the site and the admin interface on one public domain. MongoDB stores every document — pages, images, users and sessions — and is reachable only over the private network.

Why Deploy ApostropheCMS on Railway

Railway removes the setup work between you and a running CMS:

  • No Docker, MongoDB or volume configuration to write yourself
  • Private networking between the app and its database
  • Managed TLS, a public domain and custom domains
  • Push to the repository and the site rebuilds and redeploys
  • The first administrator is created on the first boot

Common Use Cases

  • Marketing sites a non-technical team maintains. Editors change copy, swap images and reorder sections on the live page without filing a ticket.
  • A headless backend for Astro or Next. Use the REST API while keeping Apostrophe's editing experience for the writers.
  • Client work you hand over. Build page types and widgets as modules, then give the client an interface they can use unsupervised.

Dependencies for ApostropheCMS

  • apostrophe — the app, built from github.com/gridalpha/apostrophe-railway (the apostrophecms/starter-kit-essentials starter plus a deployment Dockerfile) on node:22-bookworm-slim. Public, port 3000, volume at /app/data.
  • MongoDB — Railway's managed mongo:8.0, holding all content and login sessions. Private only.

Environment Variables Reference

VariableDescriptionRequired
ADMIN_PASSWORDPassword for the administrator created on first bootYes
ADMIN_USERNAMELogin name for it, defaults to adminNo
APOS_DB_URIMongoDB connection string, already wired upYes (pre-wired)
APOS_BASE_URLBase URL; set it when you attach a custom domainNo
APOS_SESSION_SECRETSigns session cookies; generated if unsetNo
APOS_CLUSTER_PROCESSESWorker processes, default 2No
APOS_COOKIE_SECURESet to 0 only if serving over plain HTTPNo
PORTHTTP port, default 3000No

Deployment Dependencies

  • Node.js 22 LTS or newer, MongoDB 8 or newer
  • Source:
  • Upstream:
  • Docs:

Minimum Hardware Requirements for Self-Hosting ApostropheCMS

ResourceMinimumRecommended
CPU1 vCPU2+ vCPU
RAM1 GB, single process2–4 GB, ~500 MB per cluster process
Storage1 GB for uploads5 GB+ depending on media
RuntimeNode.js 22 LTSNode.js 22 LTS
DatabaseMongoDB 8MongoDB 8 with backups

The admin interface is compiled with Vite during the image build, the memory peak; give the builder at least 2 GB. Each cluster process is a full copy of the app, so size APOS_CLUSTER_PROCESSES against memory, not CPU count.

How to Self-Host ApostropheCMS Outside Railway

ApostropheCMS projects are scaffolded, not pulled as an image. These commands create one, add an administrator and run it in development:

npm create apostrophe@latest my-site
cd my-site
echo 'APOS_DB_URI=mongodb://localhost:27017/my-site' > .env
npm install
node app @apostrophecms/user:add admin admin
npm run dev

For production, build the assets once and run with NODE_ENV=production, with MongoDB beside it in Docker:

docker run -d --name mongo -p 27017:27017 -v mongo-data:/data/db mongo:8.0
export APOS_DB_URI=mongodb://localhost:27017/my-site
export APOS_RELEASE_ID=$(git rev-parse --short HEAD)
npm run build
npm run serve

APOS_RELEASE_ID must match at build and run time: built assets are served from a path containing it.

Is ApostropheCMS Free?

The ApostropheCMS core is open source under the MIT licence and free to self-host, with no user, site or page limits. Apostrophe Technologies sells licence tiers adding advanced workflow, multitenancy through Assembly and enterprise support, plus managed hosting. On Railway you pay only for the infrastructure the deployment uses.

ApostropheCMS vs Strapi vs Payload CMS

ApostropheCMSStrapiPayload CMS
LicenceMITCommunity edition, source-available enterpriseMIT
DatabaseMongoDB, PostgreSQL, SQLitePostgreSQL, MySQL, SQLitePostgreSQL, MongoDB
EditingIn-context, on the live pageAdmin forms onlyAdmin forms, live preview
Front endBuilt-in templates or headlessHeadless onlyHeadless or Next.js

Apostrophe is the only one of the three with true in-context editing: pick it when the people editing are not developers, and a form-based headless CMS when the content is structured data an application consumes.

FAQ

What is ApostropheCMS?

An open-source Node.js content management framework combining in-context visual editing with a module system and an automatic REST API for developers, on MongoDB.

What does this Railway template deploy?

An ApostropheCMS 4 application built from a public GitHub repository, with a volume for uploaded media, plus a managed MongoDB on the private network. The administrator is created on first boot from the variables you set.

Why does the template include MongoDB, and where do uploads go?

Apostrophe stores every document in MongoDB — pages, media records, users and sessions, which keeps you signed in across a redeploy. Uploads live on the volume at /app/data, served from /uploads/ with the resized versions Apostrophe generates.

Can I use ApostropheCMS as a headless CMS with Astro or Next.js?

Yes. Every page type and piece type is exposed through a REST API automatically, and Apostrophe publishes an Astro integration that keeps in-context editing working with an external front end. Add your own types by dropping a directory under modules/ in your fork.

Can I run ApostropheCMS with more than one worker process?

Yes. APOS_CLUSTER_PROCESSES sets how many processes the container forks; the default is 2. Each is a full copy of the app, so raise memory first.


Template Content

More templates in this category

View Template
Libredesk - Complete Setup
Complete self-hosted omnichannel customer support desk.

codestorm
1
View Template
Paperless-ngx
Paperless-ngx — document management with OCR and full-text search

INAPP
1
View Template
Instatic CMS - Postgres
Design, build and manage powerful static sites from state-of-the-art CMS

Instatic
162