---
title: "Deploy Grav"
description: "Flat-file Markdown CMS with a browser admin, no database needed"
category: "CMS"
url: https://railway.com/deploy/grav-2
---

# Deploy Grav

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

**[Deploy Grav on Railway](https://railway.com/template/grav-2)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/grav-2/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** CMS

## Template content

### Grav https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/grav.png

- **Source:** https://github.com/aalfath/grav-railway-template
- **Health check:** /healthz
- **Public domain:** Yes

## Documentation

# 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

* Grav: https://getgrav.org and https://github.com/getgrav/grav
* Grav 2.2.32 release: https://github.com/getgrav/grav/releases/tag/2.2.32
* Official Docker image: https://hub.docker.com/r/getgrav/grav and https://github.com/getgrav/docker-grav
* Template source: https://github.com/aalfath/grav-railway-template

### 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:**

| Variable | Default | What it does |
|---|---|---|
| `GRAV_ADMIN_USER` | `admin` | Username of the first admin (3-16 lowercase letters, digits, `-`, `_`) |
| `GRAV_ADMIN_PASSWORD` | generated, 32 characters | Password of the first admin |
| `PORT` | `8080` | Port 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.



## Similar templates

- [Libredesk - Complete Setup](https://railway.com/deploy/libredesk-complete-setup) — Complete self-hosted omnichannel customer support desk.
- [Paperless-ngx](https://railway.com/deploy/paperless-ngx-3) — Paperless-ngx — document management with OCR and full-text search
- [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/grav-2
