How to use Joplin desktop app on FreeBSD

This is a quick note on how I build and use the latest Joplin desktop app on FreeBSD.

For my initial exploration of Joplin on FreeBSD, please refer to the previous post.

Target Version

The current target version of this article is Joplin Electron release v1.0.233 (Aug 2020).
I confirmed that the app could be built using my fork at the tag freebsd-20200802. Joplin Version

NOTE (2020-09-07)
The latest Android app on Google Play cannot be used with the above Electron release (v1.0.233) due to the incompatibility of their database versions.
For a workaround, I have installed an older Joplin app using the APK at the following URL and disabled the automatic update for the app.

NOTE (2020-12-03)
I found it’s hard to build the recent Electron releases (v1.4.8 or later) on FreeBSD. Even if it’s somehow built, I can no longer make it run correctly.
So for now, the last Electron release which runs on my FreeBSD host is the one tagged freebsd-v1.4.7-electron8-20201125. Note it requires an unofficial electron8 package instead of the FreeBSD-official electron7 package.
Based on those facts, I think the best bet for FreeBSD users is the Electron v1.0.233, though the later release up to v1.4.7 can also be used.

Building Joplin

I take the following steps to build Joplin desktop on my FreeBSD 12.1-RELEASE system (with XFCE4 desktop).

  1. Install dependencies such as Electron and Nodejs.
    Now all dependencies can be installed from the FreeBSD’s official packages.

    sudo pkg install electron7 node12 npm-node12 python vips git rsync gnome-keyring

    To use the latest versions, you might want to switch the package repository from ‘quarterly’ to ‘latest’.
    Please refer to the relevant section of the FreeBSD Handbook for the steps.

  2. Clone my forked version of Joplin and switch to electron_freebsd branch, which includes some modifications for FreeBSD.

    cd ~/tmp/or/somewhere
    git clone
    cd joplin
    git checkout electron_freebsd

    If the head of the branch cannot be built (it occurs from time to time), please try the tagged version which I confirmed to be built.
    As of 2 Aug 2020, the latest confirmed tag is freebsd-20200802 and it can be checked out as follows:

    git checkout freebsd-20200624
  3. Build the applications by mostly following the original build instruction.

    npm install
    cd ElectronClient
    npm run build

    I use npm run build instead of npm run start because it looks like the latter doesn’t expect I’m using the globally installed electron.

  4. Now you can run the desktop (Electron) app by running the following command

    electron .

    or by running a script included in my fork


    When you encounter one of the following errors, please make sure that gnome-keyring’s secret service is available on your system.

    Error: The name org.freedesktop.secrets was not provided by any .service files
    Error: Unknown or unsupported transport 'disabled' for address 'disabled:

    You would be able to enable the service on your desktop environment’s automatic startup settings. For example, on XFCE4 it can be enabled by checking “Launch GNOME services on startup” on “Settings” > “Session and Startup” > “Advanced” tab.

    Or if you try to run Joplin on a headless system like jail with the help of SSH X11 forwarding (as I do for testing), the easiest way seems to be running it with dbus-run-session(1) like:

    dbus-run-session -- electron7 .
    dbus-run-session -- ./joplin-desktop

Workaround for LSEP showing up in CJK input methods

NOTE: This is not FreeBSD-specific. But anyway, I wrote it down here for future reference.
NOTE: (2020-09-12) The problem seems to have been resolved on Joplin v1.1.x with the editor component changed from Ace Editor to CodeMirror. You can try v1.1.1 with the tagged commit freebsd-v1.1.1-20200912 on my fork, which is a pre-release and I haven’t fully tested yet.

This issue was reported several times as below.

As pointed out in the issue #1500, it looks like unfixable as it might be an Ace Editor issue.
But for users who have to use some “input method” for entering text, it is really annoying.

Joplin LSEP

Fortunately, this issue can be worked around by using a special font which has only a single zero-width glyph for the weird character (U+2028 Line Separator).


Revision History

  1. Before the Joplin-wide stylesheet was implemented in v1.0.176, I had been using a small patch to make “Editor font family” accept multiple fonts separated by comma, just for this purpose. ↩︎

  2. The menu creates and edits ~/.config/joplin-desktop/userchrome.css. ↩︎

  3. As NoLSEP font is used only for this specific purpose, I didn’t want to install it in the system-wide directory such as /usr/local/share/fonts/TTF. So I put it under my home directory and defined @font-face rule to use it. ↩︎