Deploy Grav

Flat-file Markdown CMS with a browser admin, no database needed

Deploy Grav

/data

Deploy and Host Grav on Railway

Grav is an open-source, MIT-licensed flat-file CMS written in PHP. Pages are Markdown files with YAML front matter, settings are YAML files, and there is no database. It has a browser admin (Admin2), Twig themes, a plugin system and a package manager for themes and plugins.

About Hosting Grav

This template runs one service, Grav: the official getgrav/grav image (PHP 8.4 and Apache), pinned by digest, with Grav 2.2.32 baked in and checked against the sha256 GitHub publishes. The site itself (pages, media, configuration, accounts, plugins, themes, backups and logs) lives on a Railway volume at /data; Grav core lives in the image. On first boot the start script copies Grav's default site to the volume, writes Railway's HTTPS proxy settings and creates the admin account from generated variables before the web server starts, so nobody else can claim the site. The health check is /healthz.

Common Use Cases

  • Blogs, documentation and small company or project sites written in Markdown
  • Sites edited by non-developers in a browser admin, without a database to run or back up
  • A lightweight replacement for WordPress when you want fewer moving parts

Dependencies for Grav Hosting

  • A Railway volume mounted at /data (included in the template)
  • No database: Grav stores everything as files

Deployment Dependencies

Implementation Details

After deploy: open the public URL to see the site, then https://YOUR-DOMAIN/admin to log in. The username is GRAV_ADMIN_USER (default admin) and the password is the generated GRAV_ADMIN_PASSWORD: find both in the Grav service's Variables tab. Change the password and email in the admin under your account. Both variables are read only on the first boot; changing them later doesn't change the account.

Variables:

VariableDefaultWhat it does
GRAV_ADMIN_USERadminUsername of the first admin (3-16 lowercase letters, digits, -, _)
GRAV_ADMIN_PASSWORDgenerated, 32 charactersPassword of the first admin
PORT8080Port Apache listens on

Optional: GRAV_ADMIN_EMAIL (first admin's email, defaults to admin@example.com), APACHE_MAX_WORKERS (default 6). Email (password resets, forms) is set up in the admin under Plugins, Email, with your SMTP provider.

Updates: a new Grav version reaches you as a Railway "update available" notice for this service. Applying it rebuilds the image with the new Grav core; at start the script runs Grav's post-upgrade steps and updates the plugins that ship with Grav (Admin2, API, Login and others) when the new image has a newer version. Your pages, settings, accounts and the plugins and themes you installed stay on the volume. See CHANGELOG.md before applying. Don't use the admin's "Update Grav" button: core lives in the image, so that update would be lost at the next restart. Plugin and theme updates in the admin are fine.

Resources: about 50-60 MB of RAM idle and under light load; it runs within Railway's 0.5 GB / 1 vCPU limit. Apache runs at most APACHE_MAX_WORKERS PHP workers (default 6), PHP memory_limit is 256M.

Backups: Grav's admin can make a zip backup of the site (Tools, Backups); they're stored on the volume under /data/backup. Download them from the admin to keep a copy elsewhere.

Why Deploy Grav 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 Grav 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

More templates in this category

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

codestorm
2
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
169