Use sync from a headless server

This is an electron app. Such things want a GUI.

I want the sync capability running on a Linux server. Can this be done? I don’t need the editor running on that machine, just the synchronization mechanism.

I got past the missing DISPLAY error using virtual frame buffer, but that won further errors. Is there a sensible alternative strategy?

Alternative plan is give up on the built in sync in favour of syncthing but I’d rather stay within obsidian if possible.



Obsidian Sync requires Obsidian to be running, and Obsidian isn’t designed to run without graphics. If it were me I’d use a different sync method.

It’s probably possible to use xvfb. It’s definitely possible to give obsidian its own virtual machine instance. I posted this after the x64 box that was running a copy of obsidian decided to log out the user, despite many power settings to discourage that.

I’m hoping someone with the source code seems utility in building a version of the tool that doesn’t do the GUI part - all it needs to understand is opening a vault and running the sync daemon, hopefully the code for doing that is already decoupled from the GUI. That opens the path to using obsidian as a user interface over some automation.

But yes, otherwise syncthing or something more DIY will work. Or there are probably other text editors I’d like on android.

The FileSystem-LiveSync is the one that you can use if you have the skills required to build the Self-hosted LiveSync plugin environment. (But the author is busy right now and doesn’t have time to answer questions, so it must be someone with the necessary skills.)

from Possibility for headless syncing with a CLI:stuck_out_tongue_winking_eye:

Ah yes, the feature request from June 22 is indeed the same thing as this. Possibility for headless syncing with a CLI - #34 by jamesbvaughan

Interesting that there is enough access for a plugin to reimplement something loosely equivalent to the built in sync. I don’t think I want to start down that rabbit hole.

It looks like I’ll stand up a virtual machine dedicated to running a single obsidian program. Minimises time cost. Thanks guys

Alternative workaround put in place goes thus:

  1. raspberry pi or similar, default (64 bit) desktop image
  2. install fuse
  3. copy aarch64 appimage of obsidian under ~/bin or similar
  4. write ~/.config/autostart/obsidian.desktop containing
[Desktop Entry]
  1. forget about it, hopefully. There’s probably some power saving that needs to be disabled.

It’s not running headless in the sense of no GUI, though it is headless in the sense that it’s out of sight and out of mind, and doesn’t have a monitor or keyboard attached.

1 Like

I’ve not found a good solution to this, but I’m looking high and low. My goal is to be able to make edits in my vault (from any device) and have a relatively fresh copy of the vault reflected in a headless, Linux environment.

The most promising approach to this I’ve found is to use obsidian-git, and just have the changes automatically pulled on the server side. I’ve not been able to get it working reliably yet, as the mobile support is iffy.

I would also value the ability to have non-gui, always on sync with the paid service. I know this is probably a better fit for finding a DIY solution for sync, but I like paying for the best sync and would prefer to keep it first-party.

Copying from an obsidian instance using distributed source control works well. Cron runs fossil addremove in the vault directory and other machines that don’t have obsidian running pick up the contents from that. Side effect is the repo becomes a backup - one can retrieve any version of any file in the vault.

I’m sure a virtual machine instance containing obsidian would work for this. The pi I set up ages ago has been robust. It should be possible to use a virtual X environment but I gave up on that after an hour or so, electron was not keen.