# ANKI\_BASE environment variable not working

**URL:** <https://forums.ankiweb.net/t/anki-base-environment-variable-not-working/31304>\
**Category:** Help\
**Created:** [June 17, 2023, 9:44am UTC](https://forums.ankiweb.net/t/anki-base-environment-variable-not-working/31304 "2023-06-17T09:44:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kalamar](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@Kalamar](https://forums.ankiweb.net/u/Kalamar)\
**Post date:** [June 17, 2023, 9:44am UTC](https://forums.ankiweb.net/t/anki-base-environment-variable-not-working/31304/1 "2023-06-17T09:44:25Z")

</div>

Hello! I’ve been trying to change the default database location in Mac OS 12.6 following the documentation by exporting the environment variable ANKI\_BASE. I’ve confirmed that it is set on every startup. However, Anki still defaults to ~/Library/Application Support/Anki2 every time.

Is there anything else I’m missing? Thank you in advance!

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [June 19, 2023, 8:19am UTC](https://forums.ankiweb.net/t/anki-base-environment-variable-not-working/31304/2 "2023-06-19T08:19:56Z")

</div>

My guess is that the env var is not set for apps you start from the GUI. If it’s correctly defined, Anki should honor it.

---

<div class="post-metadata">

**Author:** ![Kalamar](https://avatars.discourse-cdn.com/v4/letter/k/aeb1de/32.png) [@Kalamar](https://forums.ankiweb.net/u/Kalamar)\
**Post date:** [June 19, 2023, 10:57am UTC](https://forums.ankiweb.net/t/anki-base-environment-variable-not-working/31304/3 "2023-06-19T10:57:57Z")

</div>

Thanks for your response. Honestly, I’m not sure if that is case.

However, I’ve decided to implement a shell script that launches Anki with a custom folder every time. I can also use Syncthing perfectly with this solution.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [June 20, 2023, 10:57am UTC](https://forums.ankiweb.net/t/anki-base-environment-variable-not-working/31304/4 "2023-06-20T10:57:21Z")

</div>

For what it’s worth, I tested ANKI\_BASE on 2.1.65 and it worked for me.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [July 20, 2023, 10:57am UTC](https://forums.ankiweb.net/t/anki-base-environment-variable-not-working/31304/5 "2023-07-20T10:57:42Z")

</div>

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