# Concrete CMS

> In-context editing CMS with drag-and-drop page building.

- Category: CMS & Blogging
- Difficulty: beginner
- Components: concrete, mysql
- Tags: concrete5, drag-drop, in-context, php
- Source: https://docker.recipes/cms/concrete-cms

## Overview

Concrete CMS, formerly known as Concrete5, is a PHP-based content management system that revolutionizes website editing through its innovative in-context editing approach. Unlike traditional CMS platforms that require users to navigate to separate admin panels, Concrete CMS allows content editors to click directly on page elements and modify them in real-time while viewing the actual website. The platform features a sophisticated drag-and-drop page builder with block-based architecture, enabling users to construct complex layouts without technical expertise. Built with developer-friendly APIs and extensive customization options, Concrete CMS has powered thousands of websites since its inception in 2003, from small business sites to large enterprise portals. This Docker stack combines Concrete CMS with MySQL 8.0 to create a robust content management environment. MySQL's InnoDB storage engine provides ACID compliance and transactional integrity for Concrete's complex data relationships, including page versions, block configurations, and user permissions. The database's full-text search capabilities enhance Concrete's built-in search functionality, while MySQL's query cache optimizes performance for the frequent database queries generated by Concrete's dynamic page rendering system. This combination delivers exceptional performance for content-heavy websites that require frequent updates and complex permission structures. Content creators, marketing teams, and small development agencies will find this stack particularly valuable for projects requiring rapid content deployment and non-technical user management. The in-context editing eliminates the learning curve typically associated with CMS adoption, while MySQL's reliability ensures content remains accessible even under high traffic loads. Organizations migrating from static websites or seeking alternatives to WordPress will appreciate Concrete's intuitive interface and built-in features like form builders, file management, and user role systems.

## Features

- In-context page editing with live preview - edit content directly on the frontend without backend admin panels
- Drag-and-drop block system with over 30 built-in block types including galleries, forms, and social media widgets
- Advanced page versioning and approval workflows with rollback capabilities for content management
- Built-in eCommerce functionality through the integrated marketplace and payment processing blocks
- Multilingual content management with translation interfaces and localized URL structures
- MySQL 8.0 JSON data type support for storing flexible block configurations and custom attributes
- Concrete's Express framework for rapid custom data structure creation with automatic form generation
- MySQL Group Replication compatibility for high-availability content delivery networks

## Use cases

- Marketing agencies managing multiple client websites with frequent content updates and custom layouts
- Educational institutions requiring multilingual sites with complex user hierarchies and course catalogs
- Real estate companies showcasing property listings with integrated search and filter capabilities
- Non-profit organizations building donation forms and event management systems with volunteer portals
- Small businesses transitioning from WordPress seeking more intuitive content editing workflows
- Corporate intranets requiring document management with granular permission controls and approval processes
- Event management companies creating registration systems with custom data collection and payment processing

## Prerequisites

- Minimum 1GB RAM for MySQL 8.0 operations and Concrete's PHP processing requirements
- Port 80 available for web traffic, or modify the port mapping for alternative configurations
- Basic understanding of Concrete CMS block system and page types for effective content management
- Environment variables configured: DB_PASSWORD and ROOT_PASSWORD for database security
- Docker and Docker Compose installed with support for bind mounts and named volumes
- Understanding of PHP application deployment for custom theme development and troubleshooting

## docker-compose.yml

```yaml
services:
  concrete:
    image: concretecms/cms:latest
    container_name: concrete
    restart: unless-stopped
    environment:
      CONCRETE5_DB_SERVER: mysql
      CONCRETE5_DB_USERNAME: concrete
      CONCRETE5_DB_PASSWORD: ${DB_PASSWORD}
      CONCRETE5_DB_DATABASE: concrete
    volumes:
      - concrete_data:/var/www/html/application/files
    ports:
      - "80:80"
    depends_on:
      - mysql
    networks:
      - concrete-network

  mysql:
    image: mysql:8.0
    container_name: concrete-mysql
    environment:
      MYSQL_ROOT_PASSWORD: ${ROOT_PASSWORD}
      MYSQL_DATABASE: concrete
      MYSQL_USER: concrete
      MYSQL_PASSWORD: ${DB_PASSWORD}
    volumes:
      - mysql_data:/var/lib/mysql
    networks:
      - concrete-network

volumes:
  concrete_data:
  mysql_data:

networks:
  concrete-network:
    driver: bridge
```

## .env

```bash
DB_PASSWORD=changeme
ROOT_PASSWORD=changeme
```

## Usage notes

- Docs: https://documentation.concretecms.org/
- Access at http://localhost - installation wizard on first visit
- In-context editing: click on page elements to edit
- Block-based design with drag-and-drop
- Marketplace for themes, blocks, and add-ons
- Form builder, file manager, users/groups built-in

## Troubleshooting

- Installation wizard shows database connection error: Verify CONCRETE5_DB_SERVER matches the MySQL service name and containers are on the same network
- Concrete CMS displays 'Fatal error: Maximum execution time exceeded': Increase PHP max_execution_time or optimize large file uploads through volume configuration
- MySQL container fails to start with 'Access denied for user': Check MYSQL_USER and MYSQL_PASSWORD environment variables match CONCRETE5_DB_USERNAME and CONCRETE5_DB_PASSWORD
- Page blocks disappear after container restart: Ensure concrete_data volume is properly mounted to persist uploaded files and cache data
- Concrete marketplace won't connect: Configure proper DNS resolution in the container or use manual package installation through volume mounts
- MySQL 'Table doesn't exist' errors during installation: Allow sufficient time for MySQL initialization or add healthcheck dependencies to ensure database readiness

