Flatpak on Ubuntu CLI install is broken

I’m using Obsidian 1.12.7 installed as a system flatpak with Insider-Builds enabled in setttings.

Installing the CLI from the global settings puts a binary into $HOME/.local/bin/obsidian that subsequently fails with the error message of

`The CLI is unable to find Obsidian. Please make sure Obsidian is running and try again.`

The method described in the docs (`ln -s /var/lib/flatpak/exports/bin/md.obsidian.Obsidian ~/.local/bin/obsidian`) works for me, so I’m assuming this is a system/ecosystem detection going wrong. Happy to provide other debug info if I can.

2 Likes

Sorry, forgot to mention: This is on Ubuntu (running Plasma as DE) questing quokka (25.10) x64.

So it looks like the flatpak sandboxes the socket, meaning the cli tool can’t find it. The below is my current work around which has to be run each time before obsidian starts up. Maybe the devs can see this and implement a more durable solution for their flatpak builds.

`alias obsidian=‘ln -sf /run/user/$(id -u)/.flatpak/md.obsidian.Obsidian/xdg-run/.obsidian-cli.sock /run/user/$(id
-u)/.obsidian-cli.sock 2>/dev/null; command obsidian’ `

1 Like

We don’t directly make the flatpak. It’s a community maintained package. There are also some changes that we made in how the CLI works.

I suggest you to review the docs

And visit the flatpak GitHub repo
GitHub - flathub/md.obsidian.Obsidian · GitHub

1 Like

Thank you! That was really helpfull. However, i use zsh so the single quotes broke the command. For other folks using obsidian and zsh, that’s the workaround that worked for me:

Edit your ~/.zshrc and add the following:

unalias obsidian 2>/dev/null # clear any existing alias that may break
obsidian() {
ln -sf /run/user/$(id -u)/.flatpak/md.obsidian.Obsidian/xdg-run/.obsidian-cli.sock
/run/user/$(id -u)/.obsidian-cli.sock 2>/dev/null
command obsidian “$@”

Thanks very much, this solved the problem for me.

I renamed .local/bin/obsidian to obsidian-exe, then added this wrapper script for .local/bin/obsidian:

#! /usr/bin/env nu
# vim: set filetype=nu :

def main [...cmd: string] {
  ln -sf /run/user/1000/.flatpak/md.obsidian.Obsidian/xdg-run/.obsidian-cli.sock /run/user/1000/.obsidian-cli.sock;
  obsidian-exe ...$cmd
}