# Restart docker containers

**URL:** <https://hub.mender.io/t/restart-docker-containers/7509>\
**Category:** General Discussions\
**Tags:** docker, mender-artifact\
**Created:** [February 3, 2025, 2:01pm UTC](https://hub.mender.io/t/restart-docker-containers/7509 "2025-02-03T14:01:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vimoxshah](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/vimoxshah/32/2406_2.png) [@vimoxshah](https://hub.mender.io/u/vimoxshah)\
**Post date:** [February 3, 2025, 2:01pm UTC](https://hub.mender.io/t/restart-docker-containers/7509/1 "2025-02-03T14:01:47Z")

</div>

I am using the `docker-compose` module to create an artifact and deploy my application. I need to automatically restart my Docker containers whenever there are changes in the configuration file (`/var/lib/mender-configure/device-config.json`).

JFI, uses Ubuntu OS which is installed manually and installed mender client and other necessary packages.

One approach is to use a shell script, package it as an artifact, and deploy it. However, this works only once—subsequent deployments of the same artifact will be considered “already installed,” preventing re-execution.

What would be a better approach to achieve this use case? Any suggestions would be appreciated!

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [February 4, 2025, 10:34am UTC](https://hub.mender.io/t/restart-docker-containers/7509/2 "2025-02-04T10:34:05Z")

</div>

Hi @vimoxshah,

Thanks for reaching out. I think the easiest approach is to version your configuration, so not recreate the artifact with the exact same name and version when you have a change, but give it a version or timestamp. Then the “already installed” will not apply. You can find more information here: [Software versioning | Mender documentation](https://docs.mender.io/artifact-creation/software-versioning#application-updates-update-modules)

Side note, there is a “Force installation” flag you can set during deployment creation which can make the device reinstall an artifact regardless of its current state, but I think it is not available on all plans.

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![vimoxshah](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/vimoxshah/32/2406_2.png) [@vimoxshah](https://hub.mender.io/u/vimoxshah)\
**Post date:** [February 4, 2025, 11:35am UTC](https://hub.mender.io/t/restart-docker-containers/7509/3 "2025-02-04T11:35:15Z")

</div>

Hey @TheYoctoJester Is there any way where I can restart the docker containers on deploying the mender config using APIs?
