Installation and Setup of Kirby CMS
Kirby doesn't require database — PHP 8.1+ and web server are enough. Installed via Composer or archive. License needed only for production, works without in development.
System Requirements
- PHP 8.1 or higher
- Extensions:
mbstring,curl,gdorimagick,json,fileinfo - Apache with
mod_rewriteor Nginx - Write access to
content/,media/,site/accounts/directories
Installation via Composer
composer create-project getkirby/plainkit my-site
cd my-site
For start with admin panel:
composer create-project getkirby/starterkit my-site
Structure after installation:
my-site/
├── content/ # content (no need outside web root)
├── kirby/ # CMS core (don't touch)
├── media/ # generated images (gitignore)
├── site/ # customization
└── index.php # entry point
Nginx Setup
server {
listen 80;
server_name mysite.com;
root /var/www/my-site;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to system directories
location ~ ^/(kirby|site/accounts|site/sessions) {
return 403;
}
# cache static
location ~* \.(jpg|jpeg|png|webp|svg|css|js|woff2)$ {
expires 30d;
add_header Cache-Control "public, immutable";
}
}
Apache Setup (.htaccess)
Kirby comes with ready .htaccess, but check few things:
RewriteEngine On
RewriteBase /
# deny direct access to system folders
RewriteRule ^kirby/.*$ - [F,L]
RewriteRule ^site/accounts/.*$ - [F,L]
RewriteRule ^site/sessions/.*$ - [F,L]
# routing
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]
Basic Config
<?php
// site/config/config.php
return [
'debug' => false, // true only in development
'url' => 'https://mysite.com',
'locale' => 'en_US.UTF-8',
'timezone' => 'Europe/London',
'languages' => true, // enable multilingual
'panel' => [
'install' => false, // only on first setup
'slug' => 'admin', // panel URL
'css' => 'assets/admin.css',
],
'cache' => [
'pages' => [
'active' => true,
],
],
'thumbs' => [
'driver' => 'im', // ImageMagick instead of GD
'quality' => 85,
'format' => 'webp',
],
];
Create First User
After installation, panel available at /panel. On first visit Kirby offers to create administrator via browser. For automation (CI, Docker):
php vendor/bin/kirby create-user \
--name="Admin" \
--email="[email protected]" \
--password="SecurePassword123" \
--role="admin"
Or programmatically via site/config/install.php:
<?php
use Kirby\Cms\User;
User::create([
'name' => 'Admin',
'email' => '[email protected]',
'password' => 'SecurePassword123',
'role' => 'admin',
]);
Multilingual Setup
// site/config/config.php
return [
'languages' => true,
];
Then create languages via panel or files:
// site/languages/en.php
return [
'code' => 'en',
'name' => 'English',
'default' => true,
'locale' => 'en_US.UTF-8',
'url' => '/',
'direction' => 'ltr',
'translations' => [
'read.more' => 'Read more',
'published' => 'Published',
],
];
Content for English stored in about.en.txt, for Russian — in about.ru.txt.
Git and Deploy
In .gitignore minimal set:
/kirby
/media
/site/accounts
/site/sessions
/.env
kirby/ added as Composer dependency, not committed directly. Deploy via composer install --no-dev on server.
Development Timelines
Setup and basic configuration with Nginx, SSL, and panel — 2–4 hours. With multilingual, user roles, and custom config — 1 day.







