Concrete CMS (formerly concrete5) is a PHP CMS with in-context editing — content authors click into a page block and edit it where it appears, instead of switching to a separate admin view. The install is a LEMP stack plus a wizard that creates the database tables. This article walks through a Concrete CMS 9 install on Ubuntu 22.04 with the file ownership, cache configuration, and hardening the wizard doesn’t apply itself.
How to verify
A correctly installed Concrete CMS site shows:
curl -sI https://example.org/ | head -1
# HTTP/2 200
curl -s https://example.org/ | grep -oP '<meta name="generator" content="\K[^"]+'
# Concrete CMS
ls -la /var/www/concrete/application/files/
# drwxrwx--- 1 deployer www-data files/
# drwxrwx--- 1 deployer www-data trash/
cd /var/www/concrete && ./concrete/bin/concrete c5:info
# Concrete CMS Version: 9.x.x
# Database: concrete (MySQL)
mysql -h127.0.0.1 -uconcrete -p concrete -e "SHOW TABLES LIKE 'Pages';"
# Pages
If /concrete/bin/concrete c5:info fails, the CLI isn’t wired up — symlink it from the system PATH or invoke it with the full path.
What’s happening
Concrete CMS is a PHP application on a LEMP stack. The codebase splits in two: concrete/ is the framework (think vendor/ plus the core CMS code), application/ is your site’s customizations (themes, blocks, single pages, packages). The split matters for upgrades — you replace concrete/ on every release; application/ stays put.
Three directories on disk are mandatory and must be writable by the web server user: application/files/ (uploads), application/config/generated_overrides/ (where the wizard and admin write config), and application/files/cache/ (compiled views, Doctrine proxies, the URL cache). The wizard chmods them to 777 by default — operator-grade is www-data:www-data 750 with deployer in the www-data group, never world-writable.
Concrete uses Doctrine ORM under the hood. After every block install, every theme change, and every package update, the Doctrine cache must be cleared — the admin’s “Clear Cache” button does this, but operators prefer the CLI: concrete c5:clear-cache --all. Stale Doctrine metadata is the most common “the site just stopped working” symptom.
The procedure
-
Install the LEMP stack.
sudo apt update sudo apt install -y nginx mariadb-server \ php8.2-fpm php8.2-mysql php8.2-gd php8.2-curl php8.2-mbstring \ php8.2-xml php8.2-zip php8.2-intl php8.2-bcmath php8.2-opcache \ php8.2-imagick unzip wget composer -
Provision the database.
DBPASS=$(openssl rand -hex 24) sudo mariadb <<SQL CREATE DATABASE concrete CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'concrete'@'127.0.0.1' IDENTIFIED BY '${DBPASS}'; GRANT ALL ON concrete.* TO 'concrete'@'127.0.0.1'; FLUSH PRIVILEGES; SQL -
Download and unpack Concrete CMS 9.
sudo useradd -m -s /bin/bash deployer sudo usermod -aG www-data deployer sudo mkdir -p /var/www/concrete && sudo chown deployer:www-data /var/www/concrete sudo -u deployer -- bash -lc ' cd /var/www/concrete wget -q https://github.com/concretecms/concretecms/releases/download/9.3.0/concrete-cms-9.3.0.zip unzip -q concrete-cms-9.3.0.zip mv concrete-cms-9.3.0/* concrete-cms-9.3.0/.[^.]* . rmdir concrete-cms-9.3.0 rm concrete-cms-9.3.0.zip ' sudo chown -R deployer:www-data /var/www/concrete sudo find /var/www/concrete -type d -exec chmod 755 {} \; sudo find /var/www/concrete -type f -exec chmod 644 {} \; sudo chmod -R 770 /var/www/concrete/application/files \ /var/www/concrete/application/config/generated_overrides \ /var/www/concrete/packages -
Configure Nginx at
/etc/nginx/sites-available/concrete:server { listen 443 ssl http2; server_name example.org; root /var/www/concrete; index index.php; ssl_certificate /etc/letsencrypt/live/example.org/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.org/privkey.pem; client_max_body_size 200m; 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; } # protect concrete internals location ~ /concrete/(bootstrap|core|config|tools|vendor)/ { deny all; } location ~ /application/(config|controllers|files/cache|files/incoming|libraries|src|views)/ { deny all; } location ~ /\.(?!well-known) { deny all; } } -
Run the web installer. Visit
https://example.org/install/. Enter the DB credentials, the admin email and password, the site name. The wizard creates ~150 tables; it takes a minute. -
Lock the config files post-install.
sudo chmod 440 /var/www/concrete/application/config/database.php sudo chmod 440 /var/www/concrete/application/config/app.php -
Configure cache and full-page cache. From admin > System & Settings > Cache & Speed Settings, enable “Block cache”, “Asset cache”, and “Full-page caching” for non-logged-in users. Then on the CLI:
cd /var/www/concrete sudo -u www-data php concrete/bin/concrete c5:cache:warm -
Wire OPcache and the Concrete cron. OPcache settings in
/etc/php/8.2/fpm/conf.d/10-opcache.ini:opcache.enable=1 opcache.memory_consumption=256 opcache.max_accelerated_files=20000 opcache.revalidate_freq=60Concrete’s automated jobs run via a single cron entry:
echo '*/5 * * * * deployer cd /var/www/concrete && php concrete/bin/concrete c5:job:run-scheduled --quiet' \ | sudo tee /etc/cron.d/concrete
Common pitfalls
- The “Allow developers to install packages from the marketplace” toggle in admin > System lets editors install code from a third party — turn it off in production and force packages through deploy.
- File uploads above the PHP
upload_max_filesizelimit fail silently in the in-context editor — setupload_max_filesize = 200Minphp.iniandclient_max_body_size 200min Nginx. - The Concrete URL cache (
application/files/cache/expensive/) regenerates on every page change — slow disk shows up immediately as TTFB on page saves. - Marketplace packages installed through the admin write files under
packages/— those must be writable by the web user. After installing a package, change perms back to 750 to avoid leaving the door open. - Upgrades run migrations in the same transaction as the schema change; on a busy DB, that can deadlock and leave the site half-upgraded. Run upgrades from a maintenance window.
For sites running on Concrete CMS, Stack Harbor operates the boring half — package inventory audited, Doctrine cache cleared on every deploy, file permissions enforced by a cron, MariaDB backed up and PITR-capable — so the editorial team only sees the in-context editor. That model lives under managed operations, with related notes in the knowledge base.