Nov 27, 2022 2 min read

How To Install Mautic With Docker

Self-host your newsletter with Mautic, an excellent self-hosted open-source option for you. Let's jump in and set up Mautic with docker.

How To Install Mautic With Docker
Table of Contents

Mautic is a modern-day open-source marketing automation platform enabled and used by more than 200 thousand organizations worldwide. It has over 1000 community contributors and more than 35 language translation options. If you want to self-host your newsletter then Mautic can be an excellent self-hosted open-source option for you. Let's jump in and set up Mautic with docker.

Also Read:

How To Install Listmonk With Docker
Want to run your own newsletter? Listmonk is a self-hosted free and open-source, high-performance mailing list and newsletter manager.

Docker Compose Config

Our first step is to create the docker-compose YAML file and copy it to our docker host in a central folder where you store all your docker-compose directories. Copy the YAML code below:

version: "2"
services:
  mautic:
    image: mautic/mautic
    container_name: mautic-web
    restart: always
    volumes:
      - /docker/mautic/data:/var/www/html
    depends_on:
      - mysql
    ports:
      - "80:80"
    environment:
      MAUTIC_DB_HOST: mysql
      MAUTIC_DB_USER: mautic
      MAUTIC_DB_PASSWORD: mauticdbpass
      MAUTIC_TRUSTED_PROXIES: 0.0.0.0/0

  mysql:
    image: mysql:5.6
    container_name: mautic-db
    restart: always
    volumes:
      - /docker/mautic/mysql:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: mysqlrootpassword
      MYSQL_DATABASE: mautic
      MYSQL_USER: mautic
      MYSQL_PASSWORD: mauticdbpass

Once the code has been copied navigate to the directory with the terminal CLI and run the following command to deploy the docker containers and set up the application stack:

docker-compose up -d

If successfully deployed you can run docker ps to see if the Mautic containers are running and then open your web browser and navigate to the IP address of the docker host and port number that you bound to the web application ie 192.168.0.60 if configured over port 80 or 192.168.0.60:8080 if configured on another port.

Setup Mautic Web Application

Once you open the web application through the browser, you must set up your Mautic platform. You will get to the page like in the example below and you can follow the prompts and set up your newsletter platform from campaigns and SMTP providers etc.

Mautic Web Setup

Conclusion

In conclusion, Mautic is a widely used open-source newsletter platform with rich features for individuals and organizations. If you enjoyed this article consider signing up for our newsletter and don't forget to share it with people that would find it useful. Leave a comment below with a tutorial you would like us to cover.

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to Opensource Geeks.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.