Obsidian Sync with MEGA Backup + Syncthing

Sync your Obsidian vault between Linux and multiple Android devices using Syncthing (real-time, P2P), with MEGA as a cloud backup on Linux only.

Intermediate Verified Working Updated 6 min read Tested on Linux Mint 22.3 Cinnamon (Ubuntu 24.04 Noble base); Android 14 Hardware Lenovo ThinkPad L14 Gen 2 (Intel i5-1135G7, 16GB RAM, Intel Iris Xe, 1366x768)

Overview

This setup syncs an Obsidian vault in real time between a Linux laptop and multiple Android devices using Syncthing (peer-to-peer, instant over LAN), while MEGAsync on the Linux side keeps a continuous cloud backup. No MEGA app runs on the phones — they only talk to the laptop — which saves battery and keeps one authoritative copy in the cloud. An optional weekly git export adds version history on top.

SituationWhat HappensNotes
All devices on same WiFiSyncthing syncs instantly over LAN; MEGA uploads to cloudFull speed
Laptop off, editing on phoneChanges stay on phone; sync when laptop bootsNo data loss
Laptop on, editing on phone away from homeSyncthing relay syncs when internet allows; MEGA uploads from LinuxMay have delay
All devices lostDownload vault from mega.nz in any browserRecoverable
Accidental file deletionRecover from Syncthing trash (30-day versioning) or git historyTwo safety nets
Multiple devices editing same file simultaneouslySyncthing creates conflict copies (e.g. file.sync-conflict-20260613-140412.md)Keep edits sequential

Architecture Overview

                        ┌───────────────────────┐
                        │     MEGA Cloud        │
                        │  (backup only)        │
                        └───────────┬───────────┘
                                    │ MEGAsync (real-time)
                                    ▼
 ┌──────────────────────────────────────────────────────────┐
 │                    Linux Laptop                          │
 │                                                          │
 │  ┌──────────────┐    ┌──────────────────────────────┐    │
 │  │  Obsidian     │    │  MEGAsync syncs vault to    │    │
 │  │  Vault Folder │◄──►│  cloud automatically        │    │
 │  │               │    └──────────────────────────────┘    │
 │  │               │                                        │
 │  │               │──► Syncthing (systemd service)         │
 │  │               │    (headless, runs at boot)            │
 │  └───────────────┘                                        │
 │                                                          │
 │  Optional: weekly git backup via cron                    │
 └────────────────────────┬─────────────────────────────────┘
                          │ Syncthing (P2P, encrypted)
          ┌───────────────┼────────────────┐
          ▼               ▼                 ▼
 ┌──────────────┐ ┌──────────────┐
 │  Phone       │ │  Tablet      │
 │  (Syncthing- │ │  (Syncthing- │
 │   Fork)      │ │   Fork)      │
 │              │ │              │
 │ No MEGA app  │ │ No MEGA app  │
 │ = less       │ │ = less       │
 │   battery    │ │   battery    │
 │   drain      │ │   drain      │
 └──────────────┘ └──────────────┘

How It Handles Real Scenarios

SituationWhat HappensNotes
All devices on same WiFiSyncthing syncs instantly over LAN; MEGA uploads to cloudFull speed
Laptop off, editing on phoneChanges stay on phone; sync when laptop bootsNo data loss
Laptop on, editing on phone away from homeSyncthing relay syncs when internet allows; MEGA uploads from LinuxMay have delay
All devices lostDownload vault from mega.nz in any browserRecoverable
Accidental file deletionRecover from Syncthing trash (30-day versioning) or git historyTwo safety nets
Multiple devices editing same file simultaneouslySyncthing creates conflict copies (e.g. file.conflict.2026-06-13)Keep edits sequential

Key Rules

RuleReason
Do not open the vault on multiple devices at the exact same timePrevents save conflicts
Add .obsidian to Syncthing ignore patterns on all devicesKeeps plugins/themes/hotkeys independent per device
Let MEGAsync finish its initial full sync before pairing SyncthingAvoids race condition during first sync
Test with a dummy .txt file before moving real notesCatches configuration issues early
MEGA is backup, not sync between Android devicesAndroid changes reach MEGA only through Linux

Prerequisites

ItemRequired
MEGA account (free tier: 20 GB)Yes
GitHub account (for optional git backup)Optional
F-Droid store or browser access on AndroidYes (to download Syncthing-Fork)
Obsidian installed on all devicesYes

Install Obsidian

Obsidian is not in the default Ubuntu/Mint repositories. Install via Flatpak from Flathub:

flatpak install flathub md.obsidian.Obsidian

If Flatpak is not set up yet:

sudo apt install flatpak
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

Then run Obsidian:

flatpak run md.obsidian.Obsidian

Or search Obsidian in your application menu after installation.

Note: Flathub downloads can occasionally time out (Error 28). If the install fails, run flatpak repair && flatpak install flathub md.obsidian.Obsidian and try again, or use the .deb fallback below.

Linux — .deb Fallback (If Flatpak Times Out)

Download the latest .deb from the official GitHub releases and install:

wget https://github.com/obsidianmd/obsidian-releases/releases/download/v1.8.9/obsidian_1.8.9_amd64.deb -O /tmp/obsidian.deb
sudo dpkg -i /tmp/obsidian.deb
sudo apt install -f

Check the latest version at https://github.com/obsidianmd/obsidian-releases/releases and update the URL if a newer release is available.

Android

Download from the official site or Google Play:

  • https://obsidian.md/download → Android APK
  • Google Play: search Obsidian by Dynalist Inc.

Step 1 — Install and Configure MEGAsync on Linux

Download

The easiest method is the official .deb package:

wget https://mega.nz/linux/repo/xUbuntu_24.04/amd64/megasync-xUbuntu_24.04_amd64.deb -O /tmp/megasync.deb

Note: If your base is not Ubuntu 24.04, find your distro at mega.nz/linux. Linux Mint 22.3 (Noble-based) uses the xUbuntu_24.04 repo.

Install

sudo dpkg -i /tmp/megasync.deb
sudo apt install -f   # Fix any missing dependencies

Login and Configure

  1. Launch MEGAsync from the application menu.
  2. Sign in to your MEGA account.
  3. Choose sync direction: Two-way sync.
  4. Local folder: Select your Obsidian vault directory inside /media/mohsin/mmh/MEGA/ (e.g. /media/mohsin/mmh/MEGA/Obsidian Vault).
  5. Remote folder: MEGA Cloud Drive/Obsidian Vault/.
  6. Click Sync and let it complete the initial upload.

Verify

Open https://mega.nz in a browser, log in, and confirm the Obsidian Vault folder is populated.

Tip: MEGAsync runs as a tray icon. It auto-starts with the session. No further configuration needed.


Step 2 — Install and Configure Syncthing on Linux

Install

sudo apt install syncthing

Enable as a User Service

systemctl --user enable --now syncthing
loginctl enable-linger $USER

enable-linger keeps the service running after logout so your Android devices can still reach this device.

Open the Web UI

xdg-open http://127.0.0.1:8384

On first launch, Syncthing generates a device ID. No account or sign-up required.

Add Your Vault Folder

  1. In the Web UI, click Add Folder.
  2. Folder Label: Obsidian Vault
  3. Folder ID: obsidian-vault
  4. Folder Path: Point to your Obsidian vault directory inside the MEGA folder, e.g. /media/mohsin/mmh/MEGA/Obsidian Vault.
  5. File Versioning tab → Trash can file versioning → keep for 30 days.
  6. Ignore Patterns tab → add:
    .obsidian
  7. Click Save.

Step 3 — Install Syncthing-Fork on Android (Phone & Tablet)

The official Syncthing Android app is unmaintained. Use Syncthing-Fork.

Download

SourceLink
F-Droid (recommended)https://f-droid.org/packages/com.github.catfriend1.syncthingandroid/
GitHub Releaseshttps://github.com/Catfriend1/syncthing-android/releases

Open F-Droid on your Android device, search “Syncthing-Fork”, and install. Or download the APK from GitHub Releases and side-load it.

Grant Permissions

After installing on each device:

  1. Open Syncthing-Fork.
  2. Grant Files and media permission when prompted.
  3. Settings → Run on boot → Enable.
  4. Settings → Battery optimization → Exclude Syncthing-Fork.

Repeat for the other Android device (tablet).


Step 4 — Pair Devices

On Linux (Syncthing Web UI)

  1. Click Actions (top-right) → Show ID.
  2. A QR code and device ID string appear. Leave this window open.

On Android (Syncthing-Fork)

For each Android device:

  1. Tap the + button → Add Device.
  2. Tap the QR icon in the top bar.
  3. Scan the QR code from the Linux Web UI.
  4. Accept the pairing request.

On the Linux Web UI, accept each incoming pairing request. Both devices are now paired.


Step 5 — Share Vault Folder with Android Devices

On Linux

  1. In the Syncthing Web UI, click your Obsidian Vault folder → Edit.
  2. Sharing tab → tick both Android devices.
  3. Click Save.

On Each Android Device

  1. In Syncthing-Fork, tap the notification that says a folder has been shared with you.
  2. Choose a local folder path for the vault. This must be a location Obsidian can open.
  3. Tap the folder → Edit → Ignore Patterns → add:
    .obsidian
  4. Tap the checkmark to confirm.

Note: The .obsidian ignore pattern must be set on every device. Otherwise Syncthing will sync your Obsidian app settings, which differ between Linux and Android.


Step 6 — Open Vault in Obsidian

On Linux

Obsidian → Open folder as vault → Select /media/mohsin/mmh/MEGA/Obsidian Vault

On Android (Phone & Tablet)

Obsidian → Open folder as vault → Navigate to the folder you chose in Syncthing-Fork

Test the Full Loop

  1. Create a new note on Linux (e.g. test-sync.md).
  2. Wait a few seconds. Check Phone → the note appears.
  3. Edit the note on Phone → save.
  4. Check Linux and Tablet → the edit appears on both.
  5. Repeat from Tablet → verify it reaches Linux and Phone.

Step 7 — (Optional) Weekly Git Backup on Linux

Syncthing is not backup — it mirrors deletions. A git repository gives you version history.

Initialize Git

cd /media/mohsin/mmh/MEGA/Obsidian\ Vault
git init
git add .
git commit -m "Initial vault backup"

Create a Private GitHub Repository

Using GitHub CLI:

gh repo create obsidian-vault --private --source=. --remote=origin --push

Or manually on GitHub.com, then:

git remote add origin https://github.com/YOUR_USER/obsidian-vault.git
git push -u origin main

Set Up Weekly Cron Job

crontab -e

Add:

0 6 * * 1 cd /media/mohsin/mmh/MEGA/Obsidian\ Vault && git add . && git commit -m "Weekly backup $(date)" && git push

Runs every Monday at 06:00. If there is nothing new to commit, git does nothing — no duplicates or errors.


Troubleshooting

Syncthing Shows “Unchanged” But Files Are Not Appearing

The Folder ID must match between devices. If you mistyped it, Syncthing treats them as separate folders. On Linux Web UI, check the Folder ID in folder settings. On Android, compare in folder edit view.

MEGAsync Creates .conflict Files in the Vault

This happens when a file is edited on two devices before sync completes. To reduce frequency:

  • Avoid having the vault open on multiple devices simultaneously.
  • Let MEGAsync finish uploading before making new edits on Android.

If conflict files appear, delete the .conflict versions (they are duplicates).

Syncthing Only Shows relay:// (Not tcp://) Between Devices

This means LAN discovery is failing. On the same network, both devices should show a direct tcp:// connection. Check:

  • Firewall settings (allow port 22000 on Linux).
  • Both devices on the same subnet.
  • Router not blocking multicast.

Obsidian on Android Says “Folder Does Not Exist”

Syncthing-Fork may not have synced the folder yet. Open Syncthing-Fork, check the folder status (should show a progress bar for the initial sync). Wait for the sync to complete, then reopen Obsidian.

Syncthing-Fork Keeps Crashing

  • Download from F-Droid, not the official unmaintained app.
  • Clear app data and re-pair if crashes persist.
  • Ensure you excluded the app from battery optimization.

Battery Drain on Android

Syncthing-Fork is efficient but uses some battery for background sync. If needed:

  • Increase Rescan Interval in Syncthing-Fork settings (default: 60s → change to 300s).
  • Disable Run on boot and start it manually when needed.

Quick Reference

TaskCommand / Action
Start Syncthing on Linuxsystemctl --user start syncthing
Open Syncthing Web UIxdg-open http://127.0.0.1:8384
Check Syncthing statussystemctl --user status syncthing
Check sync statusWeb UI or Syncthing-Fork dashboard
Open MEGAsync GUIApplication menu → MEGAsync
Check MEGA cloud fileshttps://mega.nz in browser
Init git in vaultcd /media/mohsin/mmh/MEGA/Obsidian\ Vault && git init && git add . && git commit -m "init"
Weekly git backup0 6 * * 1 cd /media/mohsin/mmh/MEGA/Obsidian\ Vault && git add . && git commit -m "backup $(date)" && git push
Ignore .obsidian in syncAdd .obsidian to Syncthing ignore patterns on all devices

Final Notes

This setup gives you three layers of protection:

LayerToolWhat It Protects Against
1 — Real-time syncSyncthingNotes accessible on all devices immediately
2 — Cloud backupMEGAsync (Linux only)Device loss, theft, hardware failure
3 — Version historyGit (optional)Accidental deletion, unwanted edits

No cloud app runs on your Android devices — only Syncthing-Fork, which is lightweight and P2P encrypted. The MEGA backup layer is handled entirely by the Linux laptop, keeping your phone and tablet battery-friendly.

For most users, layers 1 and 2 are sufficient. Add layer 3 (git) if you often edit notes and later want to revert changes.

Discussion