This guide is for developers and server admins who run, or are about to run, a Statamic site in production. Statamic is a flat-file content management system (CMS) built on Laravel, a popular PHP framework. Flat-file means it saves your pages and posts as plain YAML and Markdown files in your project, not in a database. That appeals to teams who want every content change tracked in git, but it raises practical questions about what lives where and how to deploy safely. The short answer is that content and blueprints (the YAML files that define your fields) always live in files, and user accounts can live in files or a database. Editors work in the Control Panel, Statamic’s web-based admin screen, and each save writes a file that Statamic can commit to git automatically.
How to verify
A working Statamic install shows:
cd /var/www/statamic
php artisan statamic:install --check
# Statamic version: v5.x
# Laravel version: v11.x
curl -sI https://example.org/cp/ | head -1
# HTTP/2 200
ls content/collections/
# pages.yaml blog.yaml ...
ls content/collections/blog/
# 2024-01-15.first-post.md
# 2024-02-03.second-post.md
php artisan stache:warm
# Stache warmed!
If php artisan stache:warm reports errors, the on-disk content is malformed (usually YAML frontmatter syntax) — the Control Panel hides this; the CLI surfaces it.
What’s happening
Statamic is a Laravel package — it installs into a fresh Laravel skeleton or into an existing Laravel app. Content lives in content/: collections (one YAML per collection definition, one Markdown per entry), taxonomies, navigation, globals, and assets. Each Markdown entry has YAML frontmatter for fields and a body for the main content. Field definitions live in “blueprints” (more YAML) under resources/blueprints/.
A piece called the “Stache” (sic) is Statamic’s in-memory cache of the parsed content. On boot, Statamic loads content/ from disk, parses it, and keeps the structured representation in memory plus a serialized cache file. Subsequent requests don’t re-parse the YAML. After every content change in the Control Panel, Statamic writes the file and invalidates the relevant Stache entry; on a deploy, the cache is warmed via php artisan stache:warm.
The Control Panel is a Vue.js SPA served by Laravel under /cp/. Users are stored either in flat files (users/users.yaml) or in a database — your call at install time. Sessions are Laravel sessions, so cookie config follows the standard Laravel setup. Assets (images uploaded through the CP) are stored in whatever disk you configure: local for single-server installs, S3 for clustered.
The procedure
-
Install Laravel and Statamic. The starter does both:
composer create-project statamic/statamic /var/www/statamic cd /var/www/statamic -
Make the user. Statamic 5 supports DB or file users:
php artisan make:user # email, password, super admin? yesFile users are easiest for a single-tenant install. DB users are required if you want SSO, password reset emails to scale, or audit trails.
-
Configure storage. In
.env:APP_URL=https://example.org APP_ENV=production APP_DEBUG=false STATAMIC_LICENSE_KEY=<your-license-or-blank-for-solo> STATAMIC_GIT_ENABLED=true STATAMIC_GIT_COMMIT=true STATAMIC_GIT_AUTOMATIC=true STATAMIC_GIT_NAME="Statamic" STATAMIC_GIT_EMAIL=statamic@example.org STATAMIC_GIT_USE_NATIVE=trueWith
STATAMIC_GIT_ENABLED=true, every CP save runsgit commiton the changed content file. This is the audit log most teams pick Statamic for. -
Set up the web server. Nginx config is standard Laravel:
server { listen 443 ssl http2; server_name example.org; root /var/www/statamic/public; index index.php; ssl_certificate /etc/letsencrypt/live/example.org/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.org/privkey.pem; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { fastcgi_pass unix:/run/php/php8.2-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } -
Set file permissions.
sudo chown -R deployer:www-data /var/www/statamic sudo find /var/www/statamic -type d -exec chmod 755 {} \; sudo find /var/www/statamic -type f -exec chmod 644 {} \; sudo chmod -R 775 /var/www/statamic/storage /var/www/statamic/bootstrap/cache sudo chmod -R 775 /var/www/statamic/contentcontent/needs to be writable bywww-databecause the CP writes there. Many teams instead run the queue worker as a different user and write through that. -
Warm caches and enable static site cache.
php artisan stache:warm php artisan statamic:assets:generate-presetsFor high-traffic public pages, enable the Static Caching strategy (
STATAMIC_STATIC_CACHING_STRATEGY=full); Statamic renders the page once and serves it as a static file frompublic/static/until invalidated. -
Wire CI for content changes. Editors who hit Save in the CP commit to git through the auto-commit feature. A push hook in your git provider can trigger a redeploy on the server, or you can pull on a cron. Pick one.
Operational notes
- The Stache cache must be regenerated on every code release that touches blueprints — leftover stale entries cause “field not found” errors that don’t show in the CP.
STATAMIC_GIT_AUTOMATIC=truecommits on every CP save — a noisy log. Many teams turn it off and runphp please git:commitfrom cron once an hour to batch changes.- Static caching is per-route; routes that depend on query string or cookies need explicit invalidation rules in
config/statamic/static_caching.php. - The Control Panel’s “Updates” UI checks the Statamic marketplace API on page load — block egress to Statamic.com if your operating policy forbids that, or accept the latency.
- Search uses Laravel Scout — the default driver is
Algolia, butMeilisearchand a local filesystem driver are both supported. Pick filesystem for single-server installs.
For sites that picked Statamic specifically for git-versioned content, Stack Harbor operates the host — git auto-commit configured to a deploy user, Stache warmed in CI, static cache invalidation wired to release, content directory backed up — so the editorial team only sees the Control Panel. That model lives under managed operations, with related Tina and Plone notes alongside.