This guide installs a minimal Concrete CMS stack with Apache, PHP, and MariaDB.
It supports Debian 10 to latest stable, Ubuntu LTS, and RHEL 9+ compatible systems.
- name: Install Concrete CMS
hosts: concrete5
become: true
vars:
concrete_version: "9.3.1"
concrete_webroot: /var/www/concretecms
tasks:
- name: Install dependencies on Debian/Ubuntu
apt:
name:
- apache2
- mariadb-server
- php
- php-mysql
- php-gd
- php-xml
- php-mbstring
- php-curl
- php-zip
- php-intl
- unzip
- wget
- curl
state: present
update_cache: true
when: ansible_os_family == "Debian"
- name: Install dependencies on RHEL family
dnf:
name:
- httpd
- mariadb-server
- php
- php-mysqlnd
- php-gd
- php-xml
- php-mbstring
- php-curl
- php-zip
- php-intl
- unzip
- wget
state: present
when: ansible_os_family == "RedHat"
- name: Ensure web and database services are enabled and started
service:
name: "{{ item }}"
state: started
enabled: true
loop:
- "{{ 'apache2' if ansible_os_family == 'Debian' else 'httpd' }}"
- mariadb
- name: Create Concrete CMS web root
file:
path: "{{ concrete_webroot }}"
state: directory
mode: "0755"
- name: Download Concrete CMS release archive
get_url:
url: "https://github.com/concretecms/concretecms/releases/download/{{ concrete_version }}/concretecms-{{ concrete_version }}.zip"
dest: /tmp/concretecms.zip
mode: "0644"
- name: Extract Concrete CMS
unarchive:
src: /tmp/concretecms.zip
dest: /tmp
remote_src: true
- name: Sync Concrete CMS files into web root
shell: |
set -euo pipefail
src_dir="$(find /tmp -maxdepth 2 -type d -name 'concretecms-*' | head -n1)"
rsync -a --delete "$src_dir"/ "{{ concrete_webroot }}/"
args:
executable: /bin/bash
- name: Set ownership for web root
file:
path: "{{ concrete_webroot }}"
state: directory
recurse: true
owner: "{{ 'www-data' if ansible_os_family == 'Debian' else 'apache' }}"
group: "{{ 'www-data' if ansible_os_family == 'Debian' else 'apache' }}"
We develop tailored automation solutions for:
Let’s discuss your requirements: office@linux-server-admin.com | Contact