Install Kirby with Composer, deploy with Git, sync contents with rsync

Hi Kirby community, Frank from fortrabbit here.

VERY Happy to see Kirby 3 - congrats. I would like to write an install guide for fortrabbit, making use of Composer, Git, rsync (to sync the content folder up and down). But it seems that I am missing some things.

basic rundown:

  1. Install Kirby locally with Composer (works fine)
  2. Init Git but exclude “vendor”, “kirby” and “content” from Git
  3. Deploy with Git > triggers Composer
  4. Upload the content folder

It kinda works, files seem to be there, but it only returns a “Not found” page. Not sure how to debug this.

Here is the current draft with more details:

Thanks for your help!

Hi Frank,

That tutorial looks great already, thank you for creating it!

Unfortunately I’m not 100 % familiar with the internals of your deployment setup. Is that “Not Found” page one of the web server or a Kirby one?

Regarding the difference with the Composer installation: The kirby directory we ship with our Starterkit/Plainkit (the ZIP downloads) contains all dependencies so that running Composer is not required to run Kirby. If you do however run Composer on the top level, Composer will fetch Kirby from GitHub again and will place it into the kirby directory without the dependencies inside it – Composer now puts them into the top level where the composer install command was run.

Do you maybe have a test installation I could take a look at? The URL is enough, I don’t need access to the server for now.

PS: With Kirby 3, we have updated our logo – it’s no longer red. You can find the new icon on our press page.

The “Not found” is rendered by Kirby, I believe. This is how it looks like:

We have custom 404…

Thanks soooooo much. I have invited Bastian to become a “App Collaborator”. Need to signup, add SSH key to login via SSH/SFTP and deploy by Git.

It’s currently maybe in a different state. Let me reset and restore.

BTW: The deployment process will synchronize the contents of Git into the actual web storage. When content is in “.gitignore”, it will be ignored.

BTW (probably not related to the issue): Does your deployment process overwrite the whole htdocs directory or are files that are not in the repo (like content) preserved?

Hey Frank! Would it be possible to get access to such an installation on the server? I don’t really understand what’s happening there.

Status of test App on fortrabbit restored. Now freshly installed via Git with Composer. “content” folder was synced via rsync.

Dependencies are installed within “/vendor”, there is no “kirby/vendor” folder, I think that is expected, just FYI.

Happy to see a proper guide coming up :slight_smile:

I tested it last week on fortrabbit and I got it working without any problems with the git deployment in a professional stack. So I did not sync the content folder with rsync. The error seems to come from a (the) missing content folder. At least thats one way I was able to get the Not found error locally.

Was able to resolve the issue! Thanks a ton for pointing me in the right direction, the tip with the missing content folder made me look for it. It was a stupid mistake on my side, the rsync command to sync the “content” folder was wrong:

rsync -av ./content
that creates a “content” folder in “content”.

rsync -av ./content
which just ups that folder.

Ok, I am pretty happy with setup that now. Kirby is the first file based CMS I got working here in a sophisticated way. Code is deployed with Git. Dependencies managed with Composer. Content synced with rsync, so that it works up and down. SoC! So far, with Kirby 2 I usually stored everything in Git, or didn’t used Git at all.

@lukaskleinschmidt This kind of setup will only work with the Universal Stack with fortrabbit. The Pro Stack has an ephemeral storage, that means, everything, also content needs to be in Git, no edits on the App itself. —÷ ARGH: sorry for talking about our service so much here.

Always interested to learn how you deploy Kirby.

Will finish the install guide article soon. Hopefully will have the chance to work on a real project in Kirby one day. So I have just touched it briefly.

1 Like

Nice to see you got it working. I had a great experience with Fortrabbit for a recent Kiby 2 site. I will certainly be back.

I’m a big fan of rsync too, and use a bash script that i kick off from NPM scripts to handle simulations and actual deploys. It also syncs the content folder down from the server if I want it to. You can check it out here. Lets you feed it paths and files to exclude in a text file too, which is great for skipping things like cache folders. i deploy the whole thing with rsync, rather then using Git.

I kick it off from NPM like this:

    "deploy:live:sim": "./deploy live",
    "deploy:live": "./deploy live go",
    "deploy:staging:sim": "./deploy staging",
    "deploy:staging": "./deploy staging go",
    "content:sync:sim": "./deploy sync",
    "content:sync": "./deploy sync go",

Worked great on Fortrabbit and superfast too.

Awesome that you got it working! Is there anything we can help with to get the logo updated for the guide? Fortrabbit has always been an interesting service for Kirby users and I’m glad that v3 is running smoothly on it now.