# How to upgrade Database in Docker

**URL:** https://community.baserow.io/t/how-to-upgrade-database-in-docker/5993
**Category:** Technical Help
**Created:** [August 30, 2024, 12:00pm UTC](https://community.baserow.io/t/how-to-upgrade-database-in-docker/5993 "2024-08-30T12:00:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![taubers](https://community.baserow.io/letter_avatar_proxy/v4/letter/t/919ad9/32.png) [@taubers](https://community.baserow.io/u/taubers)
#### Post date: [August 30, 2024, 12:00pm UTC](https://community.baserow.io/t/how-to-upgrade-database-in-docker/5993/1 "2024-08-30T12:00:36Z")

</div>

Hey, Baserowers!

Currently, I’m successfully updating Baserow by just changing the versions of the Baserow backend/frontend and other services from here [baserow/docker-compose.yml at master · bram2w/baserow · GitHub](https://github.com/bram2w/baserow/blob/master/docker-compose.yml) into the docker-compose.yml on the machine, where also the volumes are added and other parameters are set manually.

After the `docker compose up --build` all runs smoothly.

But how do I safely upgrade the version of the Baserow database in Docker while having my other manual setting in the docker-compose.yml remaining?

Thanks for your help!

---

<div class="post-metadata">

### Author: ![cezary](https://community.baserow.io/user_avatar/community.baserow.io/cezary/32/2510_2.png) [@cezary](https://community.baserow.io/u/cezary)
#### Post date: [August 30, 2024, 1:50pm UTC](https://community.baserow.io/t/how-to-upgrade-database-in-docker/5993/2 "2024-08-30T13:50:31Z")

</div>

Hi!

If you want to upgrade PostgreSQL container you should run a upgrade container mentioned in our documentation: [Install with Docker](https://baserow.io/docs/installation%2Finstall-with-docker#upgrading-postgresql-database-from-a-previous-version).

The upgrade operation should be performed in a few steps:

- do a database backup: [Install with Docker](https://baserow.io/docs/installation%2Finstall-with-docker#backing-up-and-restoring-baserow)
- stop the Baserow cluster: `docker compose stop`
- edit `docker-compose.yml` file and comment current `image: postgres:XXX` line and uncomment `image: pgautoupgrade/pgautoupgrade:YYY` line below (mind the version - it should match your target PostgreSQL version)
- run just the database container only: `docker compose start db`
- wait until it finishes, observe console’s output
- if there’s a success message, edit `docker-compose.yml` file again, replace `db`’s service `image` entry again to target `image:postgres:YYY`. Keep `pgautoupgrade` container image line commented.
- restart the cluster with a new PostgreSQL version.
