Create a Website with Kirby CMS

Start a project with Composer

composer create-project getkirby/plainkit your-project

Add /kirby and /vendor to .gitignore — dependencies are managed by Composer, not committed.

Composer also needs to be installed on the cyon host for deploys. See cyon.ch — Composer installieren.

Installing Composer on cyon

  1. Download and install:
    cd && mkdir bin
    curl -sS https://getcomposer.org/installer | php -- --install-dir=bin --filename=composer
  2. Set permissions:
    chmod u+x ~/bin/composer
  3. Add an alias to ~/.bashrc:
    alias composer='~/bin/composer'
  4. Reload the shell:
    bash

Environment-specific config files

Kirby loads config files based on the domain. Add domain-specific files to override the base config.php:

/site/config/config.localhost.php
/site/config/config.staging.yourdomain.com.php
/site/config/config.yourdomain.com.php
/site/config/config.www.yourdomain.com.php

The standard config.php settings always apply. Domain-specific files override individual settings. Keep general settings in config.php to avoid duplication.

See also: Kirby CMS — Environment title prefix for a practical example.

Pull content from live server

Use rsync via Composer scripts to sync the live content/ folder to local dev. Always dry-run first.

"scripts": {
  "pull-content": "rsync -av felixf.de:/home/felixfde/public_html/kr2.felixf.de/content/ content",
  "dry-pull-content": "rsync -anv felixf.de:/home/felixfde/public_html/kr2.felixf.de/content/ content"
}
  • -a — archive mode (recursive, preserves permissions)
  • -v — verbose output
  • -n — dry run (simulate only)