# Deploy Grav with Git and rsync

Source: https://docs.fortrabbit.com/guides/more/grav-git-rsync
Published: 2026-10-24
Updated: 2026-10-24
Reviewed: 2026-10-24

> Deploy the code of a Grav site to fortrabbit with Git, and keep pages, accounts and config on the environment, synced with rsync.


## Keep Grav runtime files out of Git

The code lives in a Git repository, the content stays on the environment. See the [deployment intro](/platform/deployment/intro) for connecting a repository. Add these rules to `.gitignore` in the project root:



```shell
# .gitignore

# Composer, installed by the build command
/vendor

# Written by Grav at runtime
/cache
/logs
/tmp
/backup
/images
/assets

# Owned by the environment, synced with rsync
/user/pages
/user/accounts
/user/data
/user/config
```

## Deployment settings

The [software template](/platform/concepts/software-templates) preconfigures the matching deployment settings when Grav is chosen as software: the [replace strategy](/platform/deployment/strategy) with the same paths as [exclude patterns](/platform/deployment/exclude-patterns), a `composer install` [build command](/platform/deployment/build-commands), and a [post-deploy command](/platform/deployment/post-deploy-commands) that recreates the empty runtime folders:



```shell
$ mkdir -p logs tmp backup images assets user/pages user/accounts user/data user/config
```

Grav refuses to boot when one of those folders is missing, and none of them are in the repo.

## Content with rsync

Content moves with [rsync](/dev/how-to/rsync), in both directions:



```shell
# SYNC UP: local pages to the environment
$ rsync -av ./user/pages/ {{app-env-id}}@ssh.{{region}}.frbit.app:user/pages/

# SYNC DOWN: pages edited in the admin panel back to the local project
$ rsync -av {{app-env-id}}@ssh.{{region}}.frbit.app:user/pages/ ./user/pages/
```

Seed `user/config` the same way on first setup. After that it belongs to the environment.

Plugins and themes count as code here. Install them locally, commit, then push — a plugin installed through the admin panel on the environment is gone after the next deployment. Configuration goes the other way: the admin panel writes to `user/config`, and so do plugins that generate their own secrets, so that folder is excluded from deployment and changes there have to be made on the environment.

---

- [Grav install guide](/guides/more/grav)
- [Grav configuration](/guides/more/grav-configuration)
