# Change config directory docker compose error

**URL:** https://forum.syncthing.net/t/change-config-directory-docker-compose-error/21859
**Category:** Support
**Created:** [March 29, 2024, 11:14pm UTC](https://forum.syncthing.net/t/change-config-directory-docker-compose-error/21859 "2024-03-29T23:14:19Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![damned-me](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@damned-me](https://forum.syncthing.net/u/damned-me)
#### Post date: [March 29, 2024, 11:14pm UTC](https://forum.syncthing.net/t/change-config-directory-docker-compose-error/21859/1 "2024-03-29T23:14:19Z")

</div>

I’ve successfully installed and configured ST with the `docker-compose.yml` file from [README-Docker.md](https://github.com/syncthing/syncthing/blob/bdfd0f0548d2f6fc4b5500690dbd383baa3b0561/README-Docker.md?plain=1#L35-L51) and wanted to change the `config` directory path in order to mount a separate volume for it on another folder of my host (don’t like that the config directory resides where I sync and work with files).

[This post](https://forum.syncthing.net/t/change-config-files-location/16773) is very similar to mine and so I tried to add the following to my configuration: `command: --config /etc/config --data /var/syncthing`.

This, when rebuilding the container (`docker container up --build`), generates the following error:

```plaintext
...
Attaching to syncthing
syncthing | 2024/03/29 22:19:08 WARNING: Command line options: --home must not be used together with --config and --data
syncthing exited with code 0

```

This apparently prevents the container from starting; if the `command` directive is removed the container starts just fine. This happens also when trying to override the startup command with ` entrypoint: /bin/entrypoint.sh /bin/syncthing`

I think it’s a bug but I thought it would be better to ask here before opening an issue on GH.

Any workaround to override the config and data directories path when running on docker compose?

---

<div class="post-metadata">

### Author: ![er-pa](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/e/90db22/32.png) [@er-pa](https://forum.syncthing.net/u/er-pa)
#### Post date: [March 30, 2024, 9:41am UTC](https://forum.syncthing.net/t/change-config-directory-docker-compose-error/21859/2 "2024-03-30T09:41:53Z")

</div>

It’s probably being set in the `DockerFile` via

`ENV STHOMEDIR=/var/syncthing/config`

You can try to overwrite the environment variable `STHOMEDIR ` with an empty string. But you prob need to tweak more to get this working properly:).

---

<div class="post-metadata">

### Author: ![damned-me](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/d/87869e/32.png) [@damned-me](https://forum.syncthing.net/u/damned-me)
#### Post date: [March 30, 2024, 1:50pm UTC](https://forum.syncthing.net/t/change-config-directory-docker-compose-error/21859/3 "2024-03-30T13:50:24Z")

</div>

Setting `STHOMEDIR=` actually works, thanks!

Just needed to take care of folders permissions on the host, apparently docker creates the `config` folder at the new custom location with root privileges so I had to `chown <user>:docker` to get ST working, otherwise it fails trying to set its permissions on the internal directory.

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [April 29, 2024, 1:51pm UTC](https://forum.syncthing.net/t/change-config-directory-docker-compose-error/21859/4 "2024-04-29T13:51:16Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
