Statamic Installation and Setup
Statamic requires PHP 8.1+, Composer, and Node.js for asset compilation. It comes in two variants: Statamic Free (single site, no commercial features) and Statamic Pro (license ~$259/site, multisite, revisions, Git integration, roles).
Installation via Composer
# New project
composer create-project statamic/statamic my-site
cd my-site
# Create first user
php artisan statamic:make:user
.env
APP_NAME="My Site"
APP_ENV=production
APP_KEY=base64:...
APP_URL=https://mysite.com
STATAMIC_LICENSE_KEY=your-license-key # for Pro
STATAMIC_STACHE_WATCHER=false # disable in production
# If using Eloquent (database instead of files)
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=mysite
DB_USERNAME=mysite
DB_PASSWORD=secret
CACHE_DRIVER=redis
SESSION_DRIVER=redis
QUEUE_CONNECTION=redis
Key Configs
// config/statamic/stache.php
'stores' => [
// By default — flat files
'entries' => ['driver' => 'entries', 'directory' => base_path('content/collections')],
],
'watcher' => env('STATAMIC_STACHE_WATCHER', true), // false in production
// config/statamic/cp.php
'start_page' => 'collections',
'date_format' => 'd.m.Y',
'time_format' => 'H:i',
'theme' => 'rad', // or 'classic'
Switching to Eloquent
php artisan statamic:install:eloquent-driver
php artisan migrate
php artisan statamic:eloquent:import --all # import existing content
Nginx Configuration
server {
server_name mysite.com;
root /var/www/mysite/public;
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;
}
# Cache for static files
location ~* \.(css|js|jpg|png|gif|ico|svg|woff2)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}
Static Caching (Pro)
// config/statamic/static_caching.php
'strategy' => env('STATAMIC_STATIC_CACHING_STRATEGY', null),
// 'null' — no caching
// 'file' — file cache (requires Nginx rewrite rule)
// 'application' — Laravel Cache
Statamic installation and basic setup — 2–4 hours.







