English
Get started

← All templates · Websites and shops

Deploy Grav in one click

A flat-file CMS: a fast website or blog with an admin panel and no database

A self-hosted alternative to WordPress.

What is Grav?

Grav is an open-source flat-file CMS, a WordPress alternative that keeps each page as a Markdown file in a folder instead of rows in a database. Settings are YAML files and themes are Twig templates. You write and arrange pages in a browser admin, or straight in the files. Images are resized and cached on the fly, and themes and plugins install from GPM, its package manager.

People self-host Grav for a site that is only files, with no database server to run or upgrade. It is free under the MIT license. Grav 2 adds a REST API and an MCP server, so an AI agent can edit pages with the permissions of the user whose API key it holds. The catch is that layouts are Twig templates, so reshaping a theme takes some code.

Hosting Grav on Pethost

  1. You sign in to Pethost with a passkey, GitHub or Google. No machine yet? You pick a plan, and the link waits until it is ready.
  2. New project opens at Grav. You fill in what it asks for and click Create project: Email, Admin password.
  3. In a minute or two Grav is live at its own address with HTTPS. Its secrets are made at random, and its data is in the nightly backup.
  4. It is a project like any other: you or your agent can change it, roll it back or restore it.

Questions about Grav

Is Grav CMS free?

Yes. Grav is open source under the MIT license. The Grav team also sells premium plugins and themes, such as SEO Magic and the Helios documentation theme.

Does Grav need a database?

No. Pages live as Markdown files in user/pages and settings as YAML in user/config, so a backup is a zip of the folder and the whole site can be kept in Git.

How do I migrate from WordPress to Grav?

Install the wp2grav_exporter plugin in WordPress and run wp wp2grav-all with WP-CLI. It exports posts, pages, users, roles and site settings for Grav's user folder, and accounts get new random passwords.

How do I upgrade Grav 1.7 to 2.0?

Not with bin/gpm self-upgrade: 2.0 is a fresh install. On 1.7.50 or later, the Migrate to Grav 2.0 plugin stages it in a grav-2 subfolder with your pages, config and accounts, and promotes it after you test it.

Does Grav support multiple languages?

Yes. One Grav site can serve many languages with automatic route mapping, and the Grav 2 admin is multilingual too, with right-to-left layouts.

How much memory and disk does Grav need?

Grav is very light: under 100 MB of memory, and a site's pages and images take little disk. On Pethost the Starter plan is enough for it, with room for other apps beside it.

Grav Docker Compose file

The template is this compose.yaml and the variables written into the project’s .env as it is created. Pethost runs the file as it is written.

Containers: grav (getgrav/grav:php8.4).

Volumes, in the nightly backup: site.

services:
  grav:
    image: getgrav/grav:php8.4
    restart: unless-stopped
    # The image downloads Grav with its admin into the volume on the first start. The admin
    # account is made from the fields before Apache starts, so the admin's "create the first
    # account" page is never open to a visitor; Grav refuses a password without an upper-case
    # letter, a lower-case letter and a digit, at least 8 characters, and the start stops then.
    entrypoint:
      - bash
      - -c
      - |
        cat > /docker-entrypoint.d/admin.sh <<'SCRIPT'
        #!/bin/bash
        set -e
        cd /var/www/html
        if ! ls user/accounts/*.yaml >/dev/null 2>&1; then
          runuser -u www-data -- bin/plugin login new-user --user=admin --password="$$ADMIN_PASSWORD" \
            --email="$$ADMIN_EMAIL" --permissions=b --fullname=Admin --title=Administrator --language=en
        fi
        SCRIPT
        chmod +x /docker-entrypoint.d/admin.sh
        exec docker-entrypoint.sh apache2-foreground
    environment:
      GRAV_VERSION: 2.2.9
      ADMIN_EMAIL: ${ADMIN_EMAIL}
      ADMIN_PASSWORD: ${ADMIN_PASSWORD}
    volumes:
      - site:/var/www/html

volumes:
  site:

More in Websites and shops