# Self-host Grav

> A flat-file CMS that stores pages as Markdown files, so there is no database to run. Edit content in the admin panel or directly on the volume.

- Page: https://levelrail.com/templates/grav/
- JSON: https://levelrail.com/templates/grav.json
- Category: Applications
- Licence: MIT (Permissive license)
- Source: https://github.com/getgrav/grav
- Upstream docs: https://learn.getgrav.org/

## Requirements
- Memory: about 256 MiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: 2.2.21-ls293

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| grav | lscr.io/linuxserver/grav | 2.2.21-ls293 | 80 | config -> /config |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| grav | PGID | preset |
| grav | PUID | preset |
| grav | TZ | preset |

## Deploy

### CLI

```bash
levelrail-cli templates install grav --name my-grav
```

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain grav=app.example.com.

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/grav/install \
  -d '{
    "name": "my-grav"
  }'
```

Create a token in the dashboard first. Name, env and domains are the request fields.

## First run
1. Open /admin on the public address and create the first administrator account before anyone else does.

## Questions

### Can I deploy Grav on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Grav, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image lscr.io/linuxserver/grav:2.2.21-ls293 is what you deploy there.

Self-host Grav, Grav docker compose file, deploy Grav on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
