# Slicer ini file locations

**URL:** <https://discourse.slicer.org/t/slicer-ini-file-locations/22766>\
**Category:** Support\
**Created:** [March 30, 2022, 3:49pm UTC](https://discourse.slicer.org/t/slicer-ini-file-locations/22766 "2022-03-30T15:49:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 30, 2022, 3:49pm UTC](https://discourse.slicer.org/t/slicer-ini-file-locations/22766/1 "2022-03-30T15:49:25Z")

</div>

As I understand Slicer has two ini files.  
**Slicer.ini,** which is sort of global and is read by all Slicer versions installed and then there is **Slicer-XXXXX.ini** which is version specific.

For our docker instance we bake the Slicer application and Slicer.ini into the container, but we need to have Slicer-XXXX.ini on a persistent storage so that last loaded files, additional modules and user specific customizations are saved and retained in between sessions.

Is there an option that I set in global Slicer.ini to look for a specific folder for version specific Slicer-XXXXX.ini? I can of course do a volume mapping between host and docker for Slicer-XXXXX.ini file, but that means it needs to be modified everytime Slicer version is changed.

I am also open to other suggestions as well.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [March 30, 2022, 3:57pm UTC](https://discourse.slicer.org/t/slicer-ini-file-locations/22766/2 "2022-03-30T15:57:32Z")

</div>

I don’t think we have anything like that now, but it might be a place where an environment variable could be added to handle this use case. Like a `SLICER_VERSIONED_INI_PATH` or similar.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 30, 2022, 7:10pm UTC](https://discourse.slicer.org/t/slicer-ini-file-locations/22766/3 "2022-03-30T19:10:53Z")

</div>

> [@pieper](#):
>
> environment variable could be added to handle this use case.

So should I add this as a feature request to GH issues?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [March 30, 2022, 10:37pm UTC](https://discourse.slicer.org/t/slicer-ini-file-locations/22766/4 "2022-03-30T22:37:15Z")

</div>

> [@muratmaga](#):
>
> So should I add this as a feature request to GH issues?

Yes, sure. Then if anyone has other ideas we can discuss it there.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 30, 2022, 11:35pm UTC](https://discourse.slicer.org/t/slicer-ini-file-locations/22766/5 "2022-03-30T23:35:32Z")

</div>

The global `Slicer.ini` is only used if you haven’t created a Slicer.ini file in the `<application home>/<organization>` directory (next to your `Slicer-NNN.ini` file). See details [here](https://slicer.readthedocs.io/en/latest/user_guide/settings.html?highlight=slicer.ini#settings-file-location).

I see two options:

- If you do not let users install new extensions: keep Slicer.ini in the default user profile folder location and preserve the content of that folder.
- If you let users install new extensions: Create a `Slicer.ini` file in your `<application home>/<organization>` directory and make the entire `<application home>` folder persistent. If you want to minimize storage requirements then it will be a bit more complicated, as you need to persist a couple of folders, such as:
  - `<application home>/<organization>` (settings and extensions)
  - `<application home>/lib/Python/Lib/site-packages` (Python packages installed by extensions)
  - `<application home>/lib/Python/Scripts` (script for Python packages installed by extensions)
  - `<application home>/DICOMDatabase` (whereever you configure it, but it is more consistent if you keep all files at one location)
  - you may consider persisting the cache folder, too

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [March 31, 2022, 3:29am UTC](https://discourse.slicer.org/t/slicer-ini-file-locations/22766/6 "2022-03-31T03:29:15Z")

</div>

Thanks Andras.

I may consider going back to putting whole Slicer folder in a persistent volume, which we used to do. It will definitely simplify the number of exported volumes. I think that might be the easiest and most flexible option.
