# Self-host Grist

> A modern relational spreadsheet that combines spreadsheet flexibility with database structure.

- Page: https://levelrail.com/templates/grist/
- JSON: https://levelrail.com/templates/grist.json
- Category: Productivity
- Licence: Apache-2.0 (Permissive license)
- Source: https://github.com/gristlabs/grist-core
- Upstream docs: https://support.getgrist.com

## Requirements
- Memory: about 512 MiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: 16-alpine

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| db | postgres | 16-alpine | none | grist_db_data -> /var/lib/postgresql/data |
| grist | gristlabs/grist | 1.3.3 | 8484 | grist_data -> /persist |
| redis | redis | 7-alpine | none | grist_redis_data -> /data |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| db | POSTGRES_DB | preset |
| db | POSTGRES_PASSWORD | generated |
| db | POSTGRES_USER | generated |
| grist | GRIST_SESSION_SECRET | generated |
| grist | REDIS_URL | preset |
| grist | TYPEORM_DATABASE | preset |
| grist | TYPEORM_HOST | preset |
| grist | TYPEORM_PASSWORD | generated |
| grist | TYPEORM_TYPE | preset |
| grist | TYPEORM_USERNAME | generated |

## Deploy

### CLI

```bash
levelrail-cli templates deploy grist --name my-grist
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/grist/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## Questions

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

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id grist for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image postgres:16-alpine, gristlabs/grist:1.3.3, redis:7-alpine is what you deploy there.

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