# Deploying Mautic on a Kubernetes cluster using the official Docker image 5.2.3-apache

**URL:** <https://forum.mautic.org/t/deploying-mautic-on-a-kubernetes-cluster-using-the-official-docker-image-5-2-3-apache/35830>\
**Category:** Product Support\
**Created:** [June 10, 2025, 3:39pm UTC](https://forum.mautic.org/t/deploying-mautic-on-a-kubernetes-cluster-using-the-official-docker-image-5-2-3-apache/35830 "2025-06-10T15:39:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![strma](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/strma/32/13295_2.png) [@strma](https://forum.mautic.org/u/strma)\
**Post date:** [June 10, 2025, 3:39pm UTC](https://forum.mautic.org/t/deploying-mautic-on-a-kubernetes-cluster-using-the-official-docker-image-5-2-3-apache/35830/1 "2025-06-10T15:39:04Z")

</div>

**Your software**  
My Mautic version is: 5.2.3 (official docker image mautic:5.2.3-apache)  
My PHP version is: the one packaged with the image above  
My Database type and version is: MariaDB 11.2.3

**Your problem**  
I deployed mautic on a kubernetes cluster (on bare metal) for testing purposes. This is how I set it up:

1. I created a deployment for running the web interface (running with env DOCKER\_MAUTIC\_ROLE = mautic\_web) and corresponding service/ingress for external access.

2. I created a serie of cronjobs (running with env DOCKER\_MAUTIC\_ROLE = mautic\_cron) to handle periodic tasks as follows:

- mautic:segments:update --no-interaction, --no-ansi, --batch-limit=300 with schedule 0-59/3 \* \* \* \*
- mautic:campaigns:update --no-interaction --no-ansi --batch-limit=300 with schedule 1-59/3 \* \* \* \*
- mautic:campaigns:trigger --no-interaction --no-ansi --batch-limit=100 with schedule 2-59/3 \* \* \* \*
- mautic:broadcasts:send --no-interaction --no-ansi --limit=100 --batch=50 with schedule 0-59/1 \* \* \* \*
- mautic:messages:send --no-interaction --no-ansi -vvv with schedule 0-59/1 \* \* \* \*
- messenger:consume email --no-interaction --no-ansi -vvv --time-limit=50 with schedule 0-59/1 \* \* \* \*
- messenger:consume failed --no-interaction --no-ansi -vvv --time-limit=50 with schedule 0-59/1 \* \* \* \*
- messenger:consume hit --no-interaction --no-ansi -vvv --time-limit=50 with schedule 0-59/1 \* \* \* \*
- mautic:email:fetch --no-interaction --no-ansi with schedule 0-59/1 \* \* \* \*  
and a few optional ones I do not list here because I don’t think are relevant in this context.  
I deployed mariadb 11.2.3 for database back-end and mailhog for SMTP testing using helm charts.

1. I created/mounted two volumes for persisting media (/var/www/html/media) and plugins (/var/www/html/plugins).

For both web/cron roles I set the following environment variables:  
database access:  
MAUTIC\_DB\_HOST: my-mariadb-host  
MAUTIC\_DB\_PORT: 3306  
MAUTIC\_DB\_NAME: mautic  
MAUTIC\_DB\_DATABASE: mautic # not clear if needed but mentioned sometimes  
MAUTIC\_DB\_USER: mautic  
MAUTIC\_DB\_PASSWORD: my-mariadb-password # stored in a secret  
MAUTIC\_DB\_DRIVER: pdo\_mysql  
doctrine queues:  
MAUTIC\_MESSENGER\_TRANSPORT\_DSN: doctrine://default  
MAUTIC\_MESSENGER\_DSN\_EMAIL: doctrine://default  
MAUTIC\_MESSENGER\_DSN\_HIT: doctrine://default  
MAUTIC\_MESSENGER\_DSN\_FAILED: doctrine://default

I could log in the web interface, create a new user, configure the email settings to send e-mails to my dummy mailhog deployment (DSN = smtp://my-mailhog-service:1025) and successfully sent/received the test e-mail.

I imported some test companies and contacts, created segments, and set up a simple campaign and e-mail message to be sent but, for some reason, MAUTIC IS NOT SENDING OUT ANY E-MAIL to the dummy mailhog SMTP service.

In the campaign view I can see that mautic has scheduled a few e-mails for sending (which I believe it means it placed them in the doctrine queues for sending), but it seems that the cron jobs are not correctly fetching them and have nothing to send out to the dummy SMTP service.

Here the logs from the cron job which i believe is responsible for sending messages (the docs are not clear on this):  
k logs mautic-cron-messages-send-29159474-hp22d  
[2025-06-10 15:14:01] Processing message queue  
[2025-06-10 15:14:01] Messages sent: 0

Here the logs from the cron jons responsible for consuming email:  
k logs mautic-cron-messenger-consume-email-29159476-z4qjk  
[OK] Consuming messages from transport “email”.  
// The worker will automatically exit once it has been running for 50s or  
// received a stop signal via the messenger:stop-workers command.  
// Quit the worker with CONTROL-C.

Here the logs from the cron jons responsible for consuming failed:  
k logs mautic-cron-messenger-consume-failed-29159494-2lj7l  
[OK] Consuming messages from transport “failed”.  
// The worker will automatically exit once it has been running for 50s or  
// received a stop signal via the messenger:stop-workers command.  
// Quit the worker with CONTROL-C.

So there is no error in the logs, but e-mails are not being sent out to the configured SMTP service.

Does anybody know how what’s wrong with my deployment?  
I could not find much about deploying Mautic on Kubernetes on this forum, and some threads seemed to suggest that the docker image is not maintained and should not be used, although new versions are constantly released on docker hub (a couple weeks passed and now it is at v5.2.6). IS IT POSSIBLE TO DEPLOY MAUTIC USING THE DOCKER IMAGE OR SHOULD BE AVOIDED?

---

<div class="post-metadata">

**Author:** ![strma](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/strma/32/13295_2.png) [@strma](https://forum.mautic.org/u/strma)\
**Post date:** [June 12, 2025, 4:57pm UTC](https://forum.mautic.org/t/deploying-mautic-on-a-kubernetes-cluster-using-the-official-docker-image-5-2-3-apache/35830/2 "2025-06-12T16:57:17Z")

</div>

Ok, I reply to my own post with a quick update just in case this could trigger some help from the community.  
By following LLM’s suggestion (which demonstrates just how desperate I am), I set both the MAUTIC\_MAILER\_DSN and MAILER\_DSN (thanks to mautic’s legendary documentation, you never know for sure!) environment variables in my worker deployment to point to the SMTP server and hold and behold, I’m now able to manually send an e-mail to a contact: great 🥳 🎉!  
But with mautic you can never claim a victory: of course the campaign e-mails still get lost into nowhere. The web UI says a couple of them are scheduled for sending, but they did not land in the doctrine queues stored in the “messenger\_messages” table on the database, and no e-mail is sent to the poor SMTP service. No idea where they could be: the logs of the web pod are cryptic (to me) and I can’t find any clue.  
I never struggled so much with an open source project.  
it feels almost sadistic at this point!

---

<div class="post-metadata">

**Author:** ![strma](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/strma/32/13295_2.png) [@strma](https://forum.mautic.org/u/strma)\
**Post date:** [June 16, 2025, 2:03pm UTC](https://forum.mautic.org/t/deploying-mautic-on-a-kubernetes-cluster-using-the-official-docker-image-5-2-3-apache/35830/3 "2025-06-16T14:03:57Z")

</div>

Hi everyone,  
I post once again, unfortunately without being able to report any progress..  
Has anyone out there ever managed to deploy mautic on kubernetes using the official docker image (in my case mautic:5.2.3-apache), doctrine queues and either worker or cron jobs to send e-mails out using SMTP?  
Would you mind sharing some of your hard earned wisdom with me?  
Or is it a trade secret?

---

<div class="post-metadata">

**Author:** ![marcoh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/marcoh/32/14574_2.png) [@marcoh](https://forum.mautic.org/u/marcoh)\
**Post date:** [June 18, 2025, 7:59am UTC](https://forum.mautic.org/t/deploying-mautic-on-a-kubernetes-cluster-using-the-official-docker-image-5-2-3-apache/35830/4 "2025-06-18T07:59:03Z")

</div>

I decided after numerous days, to rebuild my own dockerfile and instance. I’ll upload it, so you can use it.

---

<div class="post-metadata">

**Author:** ![strma](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/strma/32/13295_2.png) [@strma](https://forum.mautic.org/u/strma)\
**Post date:** [June 18, 2025, 9:40am UTC](https://forum.mautic.org/t/deploying-mautic-on-a-kubernetes-cluster-using-the-official-docker-image-5-2-3-apache/35830/5 "2025-06-18T09:40:34Z")

</div>

Hi @marcoh,  
Thank you 🙏: that would be great!  
I’m looking forward to it.

---

<div class="post-metadata">

**Author:** ![strma](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/strma/32/13295_2.png) [@strma](https://forum.mautic.org/u/strma)\
**Post date:** [August 12, 2025, 1:37pm UTC](https://forum.mautic.org/t/deploying-mautic-on-a-kubernetes-cluster-using-the-official-docker-image-5-2-3-apache/35830/6 "2025-08-12T13:37:32Z")

</div>

Hi everyone,

I post once again on this topic after some time, just to report that, out of frustration, I placed this in stand-by and started working on other stuff, so I did not make any progress to date.

**From my experience so far, and as suggested by the docs and other threads in this forum, it really seems that deploying on VPS is the recommended (and maybe only) way to deploy mautic,**

As for the docker image, it looks like an unmaintained side-project, and no one is seriously taking care of it (at least for v6, but I suspect for v5 as well) and the project is looking for voluntaries to work on that. Maybe this is, in the end, the answer to my own question..

**I would highly appreciate someone from this community dropping me a line saying “hey, the docker image is un-maintained and won’t work on kubernetes nor anywhere else: set it aside and deploy mautic on a VPS instead because that is the only way!”.**

That would actually help me and save me (and maybe others) a lot of time and headaches!
