netresearch/docker-mautic provides a basic environment for Mautic to run correctly.
Clone this git repo and run docker compose up
, wait for it to initialize completely, and visit https://localhost
or https://host-ip
.
This main container image is a multipurpose image for running the httpd or RTE for Mautic.
The container image will be used to start the Mautic application itself as a container and the httpd as a separate container.
For this to work, you need to provide CMD and ENTRYPOINT when starting the containers.
See docker-compose.yml
for details.
- Application
- Mautic
- RTE
- PHP 7.4, 8.0, (ToDo 8.1)
- httpd
- nginx mainline
- Scheduler
- ofelia
- Database Management System
- MariaDB 10
- ToDo: WAF
- nginx + mod_security
- ToDo: buildbox
- composer, git, ...
- Caching
- Redis
- Queueing
- beanstalkd
- ToDo: Logging - everything to stdout
- Logging in Mautic is special - maybe needs some PR
- ToDo: run rector (on themes on upgrade)
If you want to pull the latest stable v4 image from netresearch/docker-mautic:
docker pull ghcr.io/netresearch/mautic:4
This container image is built with latest released Mautic 4 version.
There are also previous minor versions available, f.e.:
- ghcr.io/netresearch/mautic:4.0
- ghcr.io/netresearch/mautic:4.0.0
- ghcr.io/netresearch/mautic:4.1
- ghcr.io/netresearch/mautic:4.1.2
- ghcr.io/netresearch/mautic:4.2
- ghcr.io/netresearch/mautic:4.2.5
These container images are built for every Mautic 4 release.
Every Mautic release has a preferred RTE, but there are also images available for every supported RTE:
- ghcr.io/netresearch/mautic:4-php7.4
- ghcr.io/netresearch/mautic:4.0.1-php8.1
- ghcr.io/netresearch/mautic:4.1-php8.0
ToDo: There also builds from development branches of Mautic available:
- ghcr.io/netresearch/mautic:4.0-dev
- ghcr.io/netresearch/mautic:4.1-dev
- ghcr.io/netresearch/mautic:4.2-dev
You can pass any Mautic configuration option as environment variable. You just need to uppercase the configuration settings name and prefix it with 'MAUTIC_'.
MAUTIC_DB_HOST=dbms
Database host nameMAUTIC_DB_USER=mautic
Database user nameMAUTIC_DB_PASSWORD=mautic
Database user passwordMAUTIC_DB_NAME=mautic
Database nameMAUTIC_DB_TABLE_PREFIX=
Add prefix do Mautic tables. Very useful when migrate existing databases from another server to docker.
MAUTIC_TRUSTED_PROXIES=
If Mautic is behind a reverse proxy you can set a list of comma-separated CIDR network addresses, it sets those addresses as trusted proxies. You can use["0.0.0.0/0"]
or See documentation
Cron jobs are executed by ofelia service: https://github.com/mcuadros/ofelia
See docker-compose.yml service 'mautic' labels to configure cron jobs.
ToDo: Mount a custom.ini into container:/etc/php/custom.ini
Mautic has no separation of user content and delivered/vanilla source code. The whole application folder (/var/www/html) is placed in a volume.
You need ot differentiate here between upgrade of the environment and upgrade of Mautic
Replacing your container image with a newer one does not automatically update or upgrade your Mautic instance. You need to do it manually.
To update or upgrade to a newer version of Mautic, you have to use the CLI updater:
https://docs.mautic.org/en/setup/how-to-update-mautic/updating-at-command-line
f.e.:
docker compose exec mautic
/var/www/html # php bin/console mautic:update:find
/var/www/html # php bin/console mautic:update:apply
/var/www/html # php bin/console mautic:update:apply --finish
To update the Runtime Environment, f.e. to latest PHP 7.4.x version, you just need to re-pull the container image you are currently using, they will be rebuild periodically to include latest version of all built-in components, including PHP:
docker compose pull
The above command will pull all container images in docker-compose.yml.
docker compose up -d
The above command will restart containers from new images.
To upgrade your environment, you need to switch your container image to a newer version, f.e. replace mautic:4 or mautic:4-php7 with mautic:4-php8
To enable SSL support in bundled nginx service, you need to mount your certificates into the nginx service container and include /etc/nginx/conf.d/https.conf
in /etc/nginx/nginx.conf
If you run a proxy or LB with SSL termination, you need to configure Mautic accordingly:
Set Site Address of Mautic General Settings tab to HTTPS
Add your SSL proxy/LB IP address as trusted proxy: see Proxies
- Check https://github.com/mautic/mautic/blob/features/app/release_metadata.json when building new versions
- https://www.mautic.org/download/requirements
- https://github.com/mautic/mautic/blob/features/composer.json
- mautic/mautic#8171
- mautic/mautic-documentation#89
- https://docs.mautic.org/en/mautic-3-upgrade/upgrade-steps
- https://github.com/mautic/mautic/blob/features/app/bundles/InstallBundle/Configurator/Step/CheckStep.php
- "mautic.install.function." in https://github.com/mautic/mautic/blob/features/app/bundles/InstallBundle/Translations/en_US/messages.ini#L49
If you have any problems with or questions about this image, please contact us through a GitHub issue.
You can also reach the Mautic community through its online forums or the Mautic Slack channel.
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
This is a multi-stage Dockerfile, therefore you require buildkit or buildx enabled to be able to build your own container image.
- https://docs.docker.com/develop/develop-images/build_enhancements/
- https://docs.docker.com/develop/develop-images/multistage-build/
See workflows/docker-publish.yml for examples on how to build your own image.
The Dockerfile has two ARG where you can specify the version to be built into container image:
MAUTIC_VERSION
MAUTIC_SHA1
You can update the default values for this to the latest version by running update_mautic_version.sh in folder ./mautic
Or you can override this during build with --build-arg
to build Mautic 3.0.2 or 3.1.2
The Dockerfile has an ARG PHP_VERSION, which defaults to "8.0".
PHP_VERSION
You can override this during build with --build-arg PHP_VERSION=7.4
See docker-compose.dev.yml for examples.
Put only user content data on volume: