Sync Kirby with rsync

Deploy Kirby CMS on fortrabbit using rsync.

# Get ready

Our recommendation is to use a combination of Git and rsync where code is deployed via Git and the content folder is synced down (and up) by rsync. But you can also deploy the whole project using rsync as well. Upload code changes and download content changes.

# Local installation

It is recommended to have a local development environment. Here is a quick guide on how quickly get the Kirby plainkit running locally without Git from your terminal:

# Make a directory and move into it
$ mkdir {{app-env-id}} && cd {{app-env-id}}

# Get the plainkit
$ wget https://github.com/getkirby/plainkit/archive/main.zip

# Unzip the plainkit
$ unzip main.zip

# Move all contents from the folder one level up
$ mv plainkit-main/* .

# Remove artifacts
$ rm -rf main.zip plainkit-main

# Make the site locally available
# This uses valet, there are other tools too
$ valet link

# After that you can see the page locally
# http://{{app-env-id}}.test
shell

See the official Kirby docs quick start installation. There are many more ways to do it.

# Deployment

# UP: from local to remote
$ rsync -av ./ {{app-env-id}}@ssh.{{region}}.frbit.app:

# DOWN: from remote to local
$ rsync -av {{app-env-id}}@ssh.{{region}}.frbit.app: ./
shell

See the rsync article for more details.

# The vendor folder

When syncing the whole project folder, the vendor folder will be synced along. In most cases this works surprisingly well. Keep in mind that the local development environment and the software versions of the local PHP environment and the fortrabbit remote should roughly match for that to work. It's possible to run composer install with the fortrabbit environment. A better alternative is to use Git deployment and automate composer with build commands.

Found a tpyo?Edit