Installation and Configuration of Cockpit CMS
Cockpit CMS runs on PHP 8.1+ and supports SQLite (by default), MongoDB or PostgreSQL. Minimum requirements: PHP with extensions curl, gd, zip, intl.
Docker Compose
version: '3.8'
services:
cockpit:
image: agentejo/cockpit:latest
ports:
- "8080:80"
volumes:
- ./storage:/var/www/html/storage
- ./config:/var/www/html/config
environment:
- COCKPIT_SESSION_NAME=cockpit_session
- COCKPIT_SECRET_KEY=change-me-32-chars-minimum-length
restart: unless-stopped
Nginx + PHP-FPM
server {
listen 80;
server_name cms.mysite.com;
root /var/www/cockpit;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass php-fpm:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
# Protect storage
location ~* /storage/(.*)$ {
deny all;
}
}
Configuration (config/config.php)
<?php
return [
'app.name' => 'My CMS',
'app.language' => 'en',
// Database (SQLite by default — no setup required)
// For MongoDB:
'database' => [
'server' => 'mongodb://localhost:27017',
'options' => ['db' => 'cockpitdb'],
],
// Email
'mailer' => [
'from' => '[email protected]',
'from_name' => 'My Site',
'transport' => 'smtp',
'host' => 'smtp.mailgun.org',
'user' => '[email protected]',
'password' => 'password',
'port' => 587,
'auth' => true,
'encryption' => 'tls',
],
// File storage
'filestorage' => [
's3' => [
'region' => 'eu-west-1',
'key' => 'ACCESS_KEY',
'secret' => 'SECRET_KEY',
'bucket' => 'my-cockpit-media',
],
],
];
API Keys and Access
After installation: go to /install, create admin account. API tokens are created in Settings → API Access Tokens. It is recommended to create a separate read-only token for the frontend.
Setting up Cockpit on a prepared server takes 1–2 hours.







