The location of the configuration file

Karabiner-Elements stores the user configuration as a json file located at ~/.config/karabiner/karabiner.json

However, there may be cases where you want to place the configuration file elsewhere, such as to automatically sync across multiple machines or to manage it under version control.

In such cases, You can move the karabiner.json configuration file to a different directory by using a symbolic link.

The following command allows you to move the karabiner.json file to ~/Dropbox/private. The same process is applies for any other directory.

mv ~/.config/karabiner ~/Dropbox/private
ln -s ~/Dropbox/private/karabiner ~/.config

After changing the actual location of karabiner.json, you need to restart karabiner_console_user_server using the following command. Otherwise, it will not be able to automatically detect updates to karabiner.json.

launchctl kickstart -k gui/`id -u`/org.pqrs.karabiner.karabiner_console_user_server