Deploy Grav CMS
Fast Markdown CMS with no database, an admin panel and Redis cache.
Just deployed
/var/www/html
Redis
Just deployed
/data
Deploy and Host Grav on Railway
Grav is an open source flat-file CMS: every page is a Markdown file with YAML front matter, every setting is a YAML file, and there is no database to install, migrate or back up. It's built in PHP with Twig templates and Symfony components, has an admin panel for editing pages and media in the browser, and a package manager for hundreds of themes and plugins. Grav is MIT-licensed and has about 15,700 GitHub stars. This template runs Grav on Railway with a persistent volume that holds the whole site and Redis as a fast cache. It creates your admin account before the site goes public, so nobody can claim an unconfigured install, and the password is generated for each deploy. It's a lighter alternative to WordPress for blogs, docs and marketing sites, with fewer moving parts to secure and update. Hosting costs about $5–10/month on Railway.
What This Template Deploys
| Service | Purpose |
|---|---|
| Grav | Grav on Apache and PHP 8.4, built from the official getgrav/grav image with the latest Grav release baked in. Port 8080 with a public domain. Volume at /var/www/html. |
| Redis | Redis 8.2 with a password and a volume. Grav's page and object cache. |
The volume at /var/www/html is the whole site: pages, media, configuration, user accounts, themes and plugins. Redis only holds cache, so it can be cleared at any time.
About Hosting Grav
Most small websites don't need a database. A blog, a documentation site or a company homepage is mostly text and images, and a flat-file CMS stores exactly that, as files. That makes Grav fast, easy to back up and easy to version with Git.
Admin created before launch. Grav normally shows a setup screen to whoever opens the URL first. This template creates the admin account from GRAV_ADMIN_USER and GRAV_ADMIN_PASSWORD before Apache starts listening, so the public URL never serves an unclaimed site.
Seeded once, then yours. The admin account, site title and cache settings are written on the very first boot. After that, the admin panel owns those files, so changing the variables later has no effect. Use the admin panel or edit the YAML files instead.
Modular pages. Build landing pages from reusable modular blocks, each a Markdown file with its own template, so layouts stay flexible without a page builder.
Plugins for the basics. Plugins add contact forms, sitemaps, SEO metadata and comments, all configured in YAML or the admin panel.
Twig themes. Themes are Twig templates with CSS, so a front-end developer can build or adjust one without learning a complex plugin API.
Redis cache. Grav caches compiled pages, Twig templates and configuration. This template points that cache at Redis, which keeps response times low and survives container restarts.
Updates from the admin. Grav's built-in package manager updates the core, themes and plugins from the admin panel, and because everything lives on the volume, updates persist across redeploys.
Backups are just files. Download a zip from the admin's backup tool or copy the user folder; restoring means unpacking it again.
Fast by design. Grav compiles pages once and serves them from cache, so a small container handles a surprising amount of traffic.
Behind Railway's proxy. HTTPS is handled at Railway's edge, and the wrapper configures Grav for the reverse proxy so links and redirects use your public URL.
Typical cost: ~$5–10/month on Railway for Grav and Redis at small to medium traffic. Managed WordPress hosting usually costs more, and it still needs a database.
Deploy Grav in Under 5 Minutes
- Click Deploy on Railway. Optionally set
GRAV_SITE_TITLEandGRAV_ADMIN_EMAILfirst. - Copy
GRAV_ADMIN_PASSWORDfrom the Grav service's Variables. - Open
https://your-domain/adminand sign in asadmin. - Pick a theme, edit the home page and add your first pages in the admin panel.
- Install plugins such as a contact form, SEO tools or a blog from Plugins.
Your site is live at the public domain as soon as you save a page. Open it in a private window to see it the way visitors will.
Common Use Cases
- Blogs. Write posts in Markdown with categories, tags and RSS.
- Documentation sites. Use a docs theme to publish product or API documentation.
- Marketing and company sites. Fast pages with no database to secure.
- Portfolios. Showcase work with image galleries and simple page layouts.
- Landing pages. Spin up a campaign site in minutes.
- Multilingual sites. Serve pages in several languages with Grav's built-in multi-language support.
- Knowledge bases. Organise help articles in folders, with search from the SimpleSearch plugin.
- Event sites. Publish schedules, speakers and updates quickly.
- Personal wikis. Keep notes as Markdown pages you can edit from anywhere.
- Git-based publishing. Keep content in a Git repository and sync it with the Git Sync plugin.
- Client sites for agencies. Give clients a simple admin panel without WordPress upkeep.
Configuration
| Variable | Required | Description |
|---|---|---|
GRAV_ADMIN_PASSWORD | 🔐 Auto-generated | First admin password. Needs upper and lower case letters and a digit. |
GRAV_ADMIN_USER | ✅ Set | admin. 3–16 lowercase letters, digits, dashes or underscores. |
GRAV_ADMIN_EMAIL | Optional | Used for password recovery. |
GRAV_SITE_TITLE | Optional | Site title written on the first boot. |
GRAV_REDIS_HOST, GRAV_REDIS_PORT | ✅ Auto-injected | Redis connection for the cache. |
GRAV_REDIS_PASSWORD | ✅ Auto-injected | Redis password. |
GRAV_REDIS_DATABASE | Optional | 0. |
PORT | ✅ Set | 8080, where Apache listens. |
After the first boot. Change the password, title and cache settings in the admin panel; the variables only seed a new site.
Security. Keep the core, admin and plugins updated from the admin panel, use a strong password, and turn on two-factor authentication in your admin user settings.
Custom domain. Add your domain to the Grav service in Railway and redeploy; HTTPS certificates are issued automatically.
Email. Install and configure the Email plugin with an SMTP provider for contact forms and password resets.
Grav vs. Alternatives
| Grav on Railway | WordPress | Ghost | Hugo (static) | |
|---|---|---|---|---|
| Monthly cost | ~$5–10 usage | Hosting plus database | Hosting or Ghost(Pro) | Static hosting |
| Database needed | ✅ None | ❌ MySQL | ❌ MySQL | ✅ None |
| Browser admin panel | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
| Content as Markdown files |