# config.json fallback

**URL:** <https://forums.balena.io/t/config-json-fallback/343835>\
**Category:** balenaOS\
**Created:** [August 9, 2021, 10:39am UTC](https://forums.balena.io/t/config-json-fallback/343835 "2021-08-09T10:39:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mamoen](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mamoen/32/3641_2.png) [@mamoen](https://forums.balena.io/u/mamoen)\
**Post date:** [August 9, 2021, 10:39am UTC](https://forums.balena.io/t/config-json-fallback/343835/1 "2021-08-09T10:39:33Z")

</div>

I’m curious if there is a way to have a fallback `config.json` that is used if the main `config.json` has been misconfigured.  
I’m nervous about making changes to this file on deployed devices and would like for a way to ensure I never lose connection to the device.

---

<div class="post-metadata">

**Author:** ![markcorbinuk](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/markcorbinuk/32/4771_2.png) [@markcorbinuk](https://forums.balena.io/u/markcorbinuk)\
**Post date:** [August 9, 2021, 3:02pm UTC](https://forums.balena.io/t/config-json-fallback/343835/2 "2021-08-09T15:02:42Z")

</div>

Hello @mamoen

Welcome to the balena Forums.

We would normally recommend that you avoid making changes directly to `config.json` unless absolutely necessary. Please could you describe the configuration changes that you wish to make so that we can advise you of any alternative methods.

Regards - Mark

---

<div class="post-metadata">

**Author:** ![mamoen](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mamoen/32/3641_2.png) [@mamoen](https://forums.balena.io/u/mamoen)\
**Post date:** [August 10, 2021, 9:44am UTC](https://forums.balena.io/t/config-json-fallback/343835/4 "2021-08-10T09:44:41Z")

</div>

Hi @markcorbinuk

I wanted to have a way to add more SSH keys, the easiest way was to mount the boot partition as a volume in a container and then have a service I could send new keys to, this would then change the `config.json` using `jq` and then reboot the device.  
However I’m concerned if something happens during this write I will end up with a broken `config.json` file or the service.

---

<div class="post-metadata">

**Author:** ![mtoman](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mtoman/32/3599_2.png) [@mtoman](https://forums.balena.io/u/mtoman)\
**Post date:** [August 12, 2021, 12:23pm UTC](https://forums.balena.io/t/config-json-fallback/343835/5 "2021-08-12T12:23:25Z")

</div>

Hi,

your concern is indeed correct, unfortunately we have no backup `config.json` because the file is not intended to be written very often.  
If you really need to perform `config.json` updates, which I understand for the SSH keys, I would suggest the configizer project, which is intended for doing this remotely as safely as possible: [GitHub - balena-os/configizer: Safe(r) balenaOS config.json updates remotely](https://github.com/balena-os/configizer)

---

<div class="post-metadata">

**Author:** ![mamoen](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mamoen/32/3641_2.png) [@mamoen](https://forums.balena.io/u/mamoen)\
**Post date:** [August 12, 2021, 3:48pm UTC](https://forums.balena.io/t/config-json-fallback/343835/7 "2021-08-12T15:48:29Z")

</div>

Amazing, thanks for the link @mtoman

I’m curious if its on the roadmap to make some kind of “last known good state” for the `config.json` file?  
That upon boot it checks it’s VPN connection and if stable it considers the new json file safe (obviously this is a very simple check, but would at least avoid the potential for completely losing connection to a in the field device), and if it’s can’t connect it rolls back to the previous known good state of the `config.json` file

---

<div class="post-metadata">

**Author:** ![alexgg](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@alexgg](https://forums.balena.io/u/alexgg)\
**Post date:** [August 27, 2021, 3:51pm UTC](https://forums.balena.io/t/config-json-fallback/343835/10 "2021-08-27T15:51:44Z")

</div>

Hi, thanks for the feedback. Manual modifications to `config.json` are discouraged, and we are working towards exposing all of its configuration to the dashboard. Even before that, modifications should only happen via safe mechanisms as the balena CLI or the configizer tool.  
So the roadmap for `config.json` is really to make all configuration supervisor managed and not rely on `config.json`

---

<div class="post-metadata">

**Author:** ![AndreMaz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/andremaz/32/9407_2.png) [@AndreMaz](https://forums.balena.io/u/AndreMaz)\
**Post date:** [October 27, 2023, 10:49am UTC](https://forums.balena.io/t/config-json-fallback/343835/12 "2023-10-27T10:49:58Z")

</div>

@alexgg can you give an update on this?

---

<div class="post-metadata">

**Author:** ![alexgg](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@alexgg](https://forums.balena.io/u/alexgg)\
**Post date:** [October 30, 2023, 10:41am UTC](https://forums.balena.io/t/config-json-fallback/343835/13 "2023-10-30T10:41:27Z")

</div>

Hi Andre, what’s the use case you are looking for an update on exactly? This thread started by a concern that modifying `config.json` in the field might have unexpected consequences. The replies were along the lines of please don’t do this, use the supervisor API or the configizer tool to configure your device. I also pointed out that the intention is to deprecate the `configizer` tool as the supervisor gains functionality.  
What’s your particular concern about?
