Skip to main content

Deploy Mautic with Docker

Shenzhen, China

Mautic is an Open Source Marketing Automation platform that provides you with the greatest level of audience intelligence, thus enabling you to make more meaningful customer connections. Use Mautic to engage your customers and create an efficient marketing strategy. It can be installed using the official Docker Image.

Docker-Compose Up

version: "3.9"

services:
  database:
    image: mariadb:latest
    container_name: mautic-db
    environment:
      MYSQL_ROOT_PASSWORD: mypassword
    ports:
      - "3306:3306"
    volumes:
      - database:/var/lib/mysql:rw
    restart: always
    networks:
      - mauticnet
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --sql-mode=""

  mautic:
    container_name: mautic
    image: mautic/mautic:v4-apache
    volumes:
      - mautic_data:/var/www/html:rw
    environment:
      - MAUTIC_DB_HOST=database
      - MAUTIC_DB_USER=root
      - MAUTIC_DB_PASSWORD=mypassword
      - MAUTIC_DB_NAME=mautic4
      - MAUTIC_DB_TABLE_PREFIX=mautic4
    restart: always
    depends_on:
      - database
    links:
      - database
    networks:
      - mauticnet
    ports:
      - "8888:80"

networks:
  mauticnet:

volumes:
  database:
  mautic_data:

Optional Environment Variables

Mautic Options

  • -e MAUTIC_RUN_CRON_JOBS=...: (defaults to true - enabled) If set to true runs mautic cron jobs using included cron daemon
  • -e MAUTIC_RUN_MIGRATIONS=...: (defaults to false - disabled) If set to true runs database migrations automatically on startup.
  • -e MAUTIC_TRUSTED_PROXIES=...: (defaults to empty) If Mautic sits behind a reverse proxy, you can set a json array of CIDR network addresses here, and mautic will set those addresses as trusted proxies. You can use ["0.0.0.0/0"] or See documentation
  • -e MAUTIC_CRON_HUBSPOT=...: (defaults to empty) Enables mautic crons for Hubspot CRM integration
  • -e MAUTIC_CRON_SALESFORCE=...: (defaults to empty) Enables mautic crons for Salesforce integration
  • -e MAUTIC_CRON_PIPEDRIVE=...: (defaults to empty) Enables mautic crons for Pipedrive CRM integration
  • -e MAUTIC_CRON_ZOHO=...: (defaults to empty) Enables mautic crons for Zoho CRM integration
  • -e MAUTIC_CRON_SUGARCRM=...: (defaults to empty) Enables mautic crons for SugarCRM integration
  • -e MAUTIC_CRON_DYNAMICS=...: (defaults to empty) Enables mautic crons for Dynamics CRM integration

PHP options

  • -e PHP_INI_DATE_TIMEZONE=...: (defaults to UTC) Set PHP timezone
  • -e PHP_MEMORY_LIMIT=...: (defaults to 256M) Set PHP memory limit
  • -e PHP_MAX_UPLOAD=...: (defaults to 20M) Set PHP upload max file size
  • -e PHP_MAX_EXECUTION_TIME=...: (defaults to 300) Set PHP max execution time

PHP options

  • -e PHP_INI_DATE_TIMEZONE=...: (defaults to UTC) Set PHP timezone
  • -e PHP_MEMORY_LIMIT=...: (defaults to 256M) Set PHP memory limit
  • -e PHP_MAX_UPLOAD=...: (defaults to 20M) Set PHP upload max file size
  • -e PHP_MAX_EXECUTION_TIME=...: (defaults to 300) Set PHP max execution time

Initial Setup

Start the Docker containers with docker-compose up -d:

Mautic Docker

Mautic Docker

Mautic Docker

Mautic Docker

Mautic Docker

Mautic Docker