# Update Mautic Docker from v3 to v4

**URL:** <https://forum.mautic.org/t/update-mautic-docker-from-v3-to-v4/28590>\
**Category:** Documentation\
**Created:** [July 12, 2023, 10:48pm UTC](https://forum.mautic.org/t/update-mautic-docker-from-v3-to-v4/28590 "2023-07-12T22:48:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![irarevalo](https://avatars.discourse-cdn.com/v4/letter/i/aca169/32.png) [@irarevalo](https://forum.mautic.org/u/irarevalo)\
**Post date:** [July 12, 2023, 10:48pm UTC](https://forum.mautic.org/t/update-mautic-docker-from-v3-to-v4/28590/1 "2023-07-12T22:48:11Z")

</div>

Hello, here is a quick guide for upgrading Mautic from v3 to v4 when running on docker.

1. First stop your mautic containers

```auto
$ docker-compose down

```

1. change the image tag on your docker-compose.yml and start your containers again

```auto
$ docker-compose up -d

```

1. Enter into the Mautic container and execute the update commands

```auto
$ docker exec -it mautic bash #going into the mautic container
# php bin/console mautic:update:find #checking for updates
# php bin/console mautic:update:apply #executing updates
yes
# php bin/console mautic:update:apply --finish #finishing updates

```

1. In my case I got an error

> An error occurred while updating the database. Check log for more details.

but I just executed again

```auto
# php bin/console mautic:update:apply --finish

```

and we get the following message

> “Success! You are now running version 4.4.9 of Mautic.”

You can now exit the container by typing `exit`

However, going to the mautic webpage, we see error 500…

1. Let’s fix it by restarting our containers:

```auto
$ docker-compose down
$ docker-compose up -d

```

and now **“Success! You are now running version 4.4.9 of Mautic.”** (this time for real)  
  
You can verify the version you are running by going into the dashboard bottom right corner

---

<div class="post-metadata">

**Author:** ![Warren](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/warren/32/4292_2.png) [@Warren](https://forum.mautic.org/u/Warren)\
**Post date:** [December 30, 2023, 8:32am UTC](https://forum.mautic.org/t/update-mautic-docker-from-v3-to-v4/28590/2 "2023-12-30T08:32:13Z")

</div>

Thank you very much for this! Is all still going smooth with running Mautic inside Docker?

Would this same methodology apply to all v4 upgrades (and even v5) within Docker? I suppose with v5 it’d probably be best to export all databases from v4 and such and import into a new v5 Docker image?

---

<div class="post-metadata">

**Author:** ![mchojrin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mchojrin/32/10159_2.png) [@mchojrin](https://forum.mautic.org/u/mchojrin)\
**Post date:** [February 4, 2024, 2:18pm UTC](https://forum.mautic.org/t/update-mautic-docker-from-v3-to-v4/28590/3 "2024-02-04T14:18:19Z")

</div>

Hey @Warren , I was wondering if you got the chance to do the upgrade v4 to v5. I also run on Docker and I’d like to anticipate any potential hiccups when moving to v5.

Thanks!

---

<div class="post-metadata">

**Author:** ![luk4s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/luk4s/32/11620_2.png) [@luk4s](https://forum.mautic.org/u/luk4s)\
**Post date:** [March 17, 2024, 10:57am UTC](https://forum.mautic.org/t/update-mautic-docker-from-v3-to-v4/28590/4 "2024-03-17T10:57:32Z")

</div>

I mentioned upgrade to v5 via docker in standalone topic here: [Upgrade Mautic from v2.16.3 to v5.0.3 via docker](https://forum.mautic.org/t/upgrade-mautic-from-v2-16-3-to-v5-0-3-via-docker/31313)
