A production-ready Docker setup for Mautic 7.0.0-rc2 with support for custom plugins, themes, and patches.
- Mautic 7.0.0-rc2 (or build from your own fork)
- PHP 8.4 with optimized configuration
- RabbitMQ for reliable message queuing
- Multi-role containers: Web, Cron, and Worker services
- Coolify-ready with proper environment variable handling
- Custom plugins & themes via Composer
- Persistent volumes for data safety
mautic-custom/
βββ Dockerfile # Custom Mautic image build
βββ docker-compose.yml # Full stack deployment
βββ docker-entrypoint.sh # Container initialization
βββ .env.example # Environment variable template
βββ plugins/ # Custom plugins (add .gitkeep or your plugins)
βββ themes/ # Custom themes (add .gitkeep or your themes)
βββ supervisor/
β βββ mautic-workers.conf # Worker process management
βββ scripts/ # Custom startup scripts
βββ cron/ # Custom cron configurations
# Clone this repository
git clone https://github.com/YOUR-USERNAME/mautic-custom.git
cd mautic-custom
# Copy and edit environment file
cp .env.example .env
# Edit .env with your settingsAdd plugins to the plugins/ directory or install via Composer by editing the Dockerfile:
# In Dockerfile, uncomment and modify:
RUN composer require vendor/plugin-name:^1.0 --no-update \
&& composer update --no-dev --optimize-autoloaderAdd themes to the themes/ directory:
# Example: Add a custom theme
cp -r /path/to/your-theme themes/your-theme# Build and start all services
docker compose up -d --build
# Watch logs
docker compose logs -f mautic_web-
Push to GitHub: Push this repository to your GitHub account
-
Create Service in Coolify:
- Go to your Coolify dashboard
- Create a new "Docker Compose" service
- Point to your GitHub repository
- Branch:
main
-
Configure Environment Variables in Coolify UI:
MAUTIC_VERSION=7.0.0-rc2 MAUTIC_RUN_MIGRATIONS=true MAUTIC_LOAD_TEST_DATA=false RABBITMQ_PASSWORD=your-secure-password -
Deploy: Click Deploy in Coolify
-
First Login: After deployment completes, login with default credentials:
- Username:
admin - Password:
Mautic1234! - Change the password immediately after first login!
- Username:
| Variable | Default | Description |
|---|---|---|
MAUTIC_VERSION |
7.0.0-rc2 |
Mautic version to build |
MAUTIC_RUN_MIGRATIONS |
true |
Run DB migrations on start |
MAUTIC_LOAD_TEST_DATA |
false |
Load demo data |
MAUTIC_EMAIL_WORKERS |
2 |
Email queue workers |
MAUTIC_HIT_WORKERS |
2 |
Tracking queue workers |
PHP_MEMORY_LIMIT |
512M |
PHP memory limit |
To build from your forked Mautic repository (e.g., proofoftom/mautic):
# Build with custom repository
docker build \
--build-arg MAUTIC_VERSION=dev-7.0.0-rc2 \
--build-arg MAUTIC_REPO=https://github.com/proofoftom/mautic.git \
-t mautic-custom:7.0.0-rc2 .Or in docker-compose.yml, uncomment:
build:
args:
MAUTIC_REPO: 'https://github.com/proofoftom/mautic.git'Edit the Dockerfile to add Composer packages:
# After "Install Mautic dependencies" section, add:
RUN composer require \
vendor/plugin-one:^1.0 \
vendor/plugin-two:^2.0 \
--no-update \
&& composer update --no-dev --optimize-autoloaderExample marketplace plugins:
# GrapesJS Builder
RUN composer require mautic/grapesjsbuilder-bundle:^3.0 --no-update
# Focus Bundle (popups)
RUN composer require mautic/focus-bundle:^3.0 --no-update
# Update after adding all requirements
RUN composer update --no-dev --optimize-autoloaderCreate a patches/ directory and use Composer's patch feature:
-
Add patch file:
patches/fix-something.patch -
Update
composer.json:
{
"extra": {
"patches": {
"mautic/core-lib": {
"Fix something": "patches/fix-something.patch"
}
}
}
}| Service | Port | Description |
|---|---|---|
mautic_web |
80 | Main web application |
mautic_cron |
- | Scheduled tasks (segments, campaigns) |
mautic_worker |
- | Message queue processors |
mysql |
3306 | Database |
rabbitmq |
5672, 15672 | Message queue (+ management UI) |
All services include health checks:
- mautic_web: HTTP check on
/ - mautic_cron: Process check for
cron - mautic_worker: Process check for
messenger:consume - mysql:
mysqladmin ping - rabbitmq:
rabbitmq-diagnostics ping
# View logs
docker compose logs -f mautic_web
# Clear Mautic cache
docker compose exec mautic_web php bin/console cache:clear
# Run Mautic commands
docker compose exec --user www-data mautic_web php bin/console mautic:segments:update
# Access MySQL
docker compose exec mysql mysql -u root -p mautic
# Access RabbitMQ Management
# Visit: http://localhost:15672 (guest/guest or your configured credentials)
# Rebuild images
docker compose build --no-cache
# Full restart
docker compose down && docker compose up -d --build- Set strong passwords for MySQL and RabbitMQ
- Set
MAUTIC_LOAD_TEST_DATA=false - Configure HTTPS via Coolify/reverse proxy
- Set up backup schedule for volumes
- Configure email sending (SMTP or API)
- Review and adjust cron schedules
- Set appropriate worker counts for your load
- Enable monitoring/logging
- Update
MAUTIC_VERSIONin.envordocker-compose.yml - Rebuild:
docker compose build --no-cache - Backup your database
- Redeploy:
docker compose up -d - Migrations run automatically if
MAUTIC_RUN_MIGRATIONS=true
# Check logs
docker compose logs mautic_web
# Verify database connection
docker compose exec mautic_web php bin/console doctrine:database:create --if-not-exists# Fix permissions
docker compose exec mautic_web chown -R www-data:www-data /var/www/html/var# Clear cache and reinstall assets
docker compose exec --user www-data mautic_web php bin/console cache:clear
docker compose exec --user www-data mautic_web php bin/console mautic:assets:installMIT License - Feel free to use and modify for your needs.