Drupal
Enterprise-grade CMS for complex websites and applications.
Overview
Drupal is an enterprise-grade content management system (CMS) built on PHP that has powered millions of websites since 2001. Known for its flexibility, security, and scalability, Drupal excels at managing complex content structures with advanced user permissions, multilingual capabilities, and extensive customization options. Unlike simpler CMS platforms, Drupal is designed for organizations that need sophisticated content workflows, enterprise integrations, and the ability to handle high-traffic applications with complex data relationships.
This stack combines Drupal 10 with PostgreSQL 16 to create a robust content management platform optimized for enterprise requirements. PostgreSQL's ACID compliance and advanced querying capabilities complement Drupal's complex content modeling needs, providing superior data integrity compared to MySQL setups. The combination excels at handling structured content with relationships, supporting Drupal's entity system and field API while delivering the performance needed for high-traffic sites with complex queries.
This configuration is ideal for organizations building sophisticated web applications, corporate intranets, educational platforms, or government websites that require enterprise-level security, scalability, and content management features. The PostgreSQL backend provides the reliability and performance needed for Drupal's advanced features like Views, Entity API, and custom content types, making it perfect for developers who need to build complex, data-driven websites with professional-grade infrastructure.
Key Features
- Drupal 10 with modern Symfony-based architecture and Twig templating engine
- PostgreSQL 16 with JSON/JSONB support for Drupal's configuration and field storage
- Apache web server with mod_rewrite enabled for clean URLs and .htaccess support
- Persistent volumes for modules, themes, profiles, and sites directories to survive container updates
- Entity-relationship modeling with PostgreSQL's advanced constraint and indexing capabilities
- Full-text search integration using PostgreSQL's built-in search features with Drupal's Search API
- Composer-ready environment for installing Drupal modules and themes via Packagist
- Database connection pooling and transaction support optimized for Drupal's entity system
Common Use Cases
- 1Corporate websites with complex content hierarchies and multiple content types
- 2Educational institutions requiring multilingual content and user role management
- 3Government portals with strict accessibility and security compliance requirements
- 4Publishing platforms with editorial workflows and content scheduling
- 5E-commerce sites using Drupal Commerce with complex product catalogs
- 6Community portals with user-generated content and social features
- 7Intranet applications with document management and employee directories
Prerequisites
- Minimum 2GB RAM recommended for Drupal and PostgreSQL combined workload
- Basic understanding of PHP, Drupal architecture, and content management concepts
- Familiarity with Drupal's admin interface and module/theme management
- Port 8080 available for web access to the Drupal installation
- Environment variable POSTGRES_PASSWORD configured in .env file
- Understanding of PostgreSQL connection parameters for Drupal database configuration
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 drupal: 3 image: drupal:10-apache4 container_name: drupal5 restart: unless-stopped6 volumes: 7 - drupal_modules:/var/www/html/modules8 - drupal_profiles:/var/www/html/profiles9 - drupal_themes:/var/www/html/themes10 - drupal_sites:/var/www/html/sites11 ports: 12 - "8080:80"13 depends_on: 14 - postgres15 networks: 16 - drupal-network1718 postgres: 19 image: postgres:16-alpine20 container_name: drupal-postgres21 environment: 22 POSTGRES_DB: drupal23 POSTGRES_USER: drupal24 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}25 volumes: 26 - postgres_data:/var/lib/postgresql/data27 networks: 28 - drupal-network2930volumes: 31 drupal_modules: 32 drupal_profiles: 33 drupal_themes: 34 drupal_sites: 35 postgres_data: 3637networks: 38 drupal-network: 39 driver: bridge.env Template
.env
1POSTGRES_PASSWORD=changemeUsage Notes
- 1Docs: https://www.drupal.org/docs
- 2Access at http://localhost:8080 - complete installation wizard
- 3Database host: postgres, database: drupal, user: drupal
- 4Install Drush CLI: composer require drush/drush
- 5Modules/themes persist in mounted volumes across updates
- 6Strong ecosystem for enterprise sites, multilingual, accessibility
Individual Services(2 services)
Copy individual services to mix and match with your existing compose files.
drupal
drupal:
image: drupal:10-apache
container_name: drupal
restart: unless-stopped
volumes:
- drupal_modules:/var/www/html/modules
- drupal_profiles:/var/www/html/profiles
- drupal_themes:/var/www/html/themes
- drupal_sites:/var/www/html/sites
ports:
- "8080:80"
depends_on:
- postgres
networks:
- drupal-network
postgres
postgres:
image: postgres:16-alpine
container_name: drupal-postgres
environment:
POSTGRES_DB: drupal
POSTGRES_USER: drupal
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- drupal-network
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 drupal:5 image: drupal:10-apache6 container_name: drupal7 restart: unless-stopped8 volumes:9 - drupal_modules:/var/www/html/modules10 - drupal_profiles:/var/www/html/profiles11 - drupal_themes:/var/www/html/themes12 - drupal_sites:/var/www/html/sites13 ports:14 - "8080:80"15 depends_on:16 - postgres17 networks:18 - drupal-network1920 postgres:21 image: postgres:16-alpine22 container_name: drupal-postgres23 environment:24 POSTGRES_DB: drupal25 POSTGRES_USER: drupal26 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}27 volumes:28 - postgres_data:/var/lib/postgresql/data29 networks:30 - drupal-network3132volumes:33 drupal_modules:34 drupal_profiles:35 drupal_themes:36 drupal_sites:37 postgres_data:3839networks:40 drupal-network:41 driver: bridge42EOF4344# 2. Create the .env file45cat > .env << 'EOF'46POSTGRES_PASSWORD=changeme47EOF4849# 3. Start the services50docker compose up -d5152# 4. View logs53docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/drupal/run | bashTroubleshooting
- Database connection failed during installation: Verify postgres container is running and use 'postgres' as database host, not 'localhost'
- Permission denied errors on file uploads: Check that www-data user has write permissions to sites/default/files directory
- Memory limit exceeded errors: Increase PHP memory_limit in custom php.ini or switch to drupal:10-fpm-alpine for better memory management
- Clean URLs not working: Ensure Apache mod_rewrite is enabled and .htaccess files are being processed
- Drupal installation stalls at database setup: Increase PHP max_execution_time and ensure PostgreSQL has sufficient shared_buffers allocated
- Module installation fails: Mount a custom sites/default/settings.php with proper database credentials and trusted host patterns configured
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Ad Space
Shortcuts: C CopyF FavoriteD Download