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.
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.
| Situation | What Happens | Notes |
|---|---|---|
| All devices on same WiFi | Syncthing syncs instantly over LAN; MEGA uploads to cloud | Full speed |
| Laptop off, editing on phone | Changes stay on phone; sync when laptop boots | No data loss |
| Laptop on, editing on phone away from home | Syncthing relay syncs when internet allows; MEGA uploads from Linux | May have delay |
| All devices lost | Download vault from mega.nz in any browser | Recoverable |
| Accidental file deletion | Recover from Syncthing trash (30-day versioning) or git history | Two safety nets |
| Multiple devices editing same file simultaneously | Syncthing 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
| Situation | What Happens | Notes |
|---|---|---|
| All devices on same WiFi | Syncthing syncs instantly over LAN; MEGA uploads to cloud | Full speed |
| Laptop off, editing on phone | Changes stay on phone; sync when laptop boots | No data loss |
| Laptop on, editing on phone away from home | Syncthing relay syncs when internet allows; MEGA uploads from Linux | May have delay |
| All devices lost | Download vault from mega.nz in any browser | Recoverable |
| Accidental file deletion | Recover from Syncthing trash (30-day versioning) or git history | Two safety nets |
| Multiple devices editing same file simultaneously | Syncthing creates conflict copies (e.g. file.conflict.2026-06-13) | Keep edits sequential |
Key Rules
| Rule | Reason |
|---|---|
| Do not open the vault on multiple devices at the exact same time | Prevents save conflicts |
Add .obsidian to Syncthing ignore patterns on all devices | Keeps plugins/themes/hotkeys independent per device |
| Let MEGAsync finish its initial full sync before pairing Syncthing | Avoids race condition during first sync |
Test with a dummy .txt file before moving real notes | Catches configuration issues early |
| MEGA is backup, not sync between Android devices | Android changes reach MEGA only through Linux |
Prerequisites
| Item | Required |
|---|---|
| MEGA account (free tier: 20 GB) | Yes |
| GitHub account (for optional git backup) | Optional |
| F-Droid store or browser access on Android | Yes (to download Syncthing-Fork) |
| Obsidian installed on all devices | Yes |
Install Obsidian
Linux — Flatpak (Recommended)
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.Obsidianand try again, or use the.debfallback 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
- Launch MEGAsync from the application menu.
- Sign in to your MEGA account.
- Choose sync direction: Two-way sync.
- Local folder: Select your Obsidian vault directory inside
/media/mohsin/mmh/MEGA/(e.g./media/mohsin/mmh/MEGA/Obsidian Vault). - Remote folder:
MEGA Cloud Drive/Obsidian Vault/. - 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
- In the Web UI, click Add Folder.
- Folder Label:
Obsidian Vault - Folder ID:
obsidian-vault - Folder Path: Point to your Obsidian vault directory inside the MEGA folder, e.g.
/media/mohsin/mmh/MEGA/Obsidian Vault. - File Versioning tab → Trash can file versioning → keep for
30days. - Ignore Patterns tab → add:
.obsidian - Click Save.
Step 3 — Install Syncthing-Fork on Android (Phone & Tablet)
The official Syncthing Android app is unmaintained. Use Syncthing-Fork.
Download
| Source | Link |
|---|---|
| F-Droid (recommended) | https://f-droid.org/packages/com.github.catfriend1.syncthingandroid/ |
| GitHub Releases | https://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:
- Open Syncthing-Fork.
- Grant Files and media permission when prompted.
- Settings → Run on boot → Enable.
- Settings → Battery optimization → Exclude Syncthing-Fork.
Repeat for the other Android device (tablet).
Step 4 — Pair Devices
On Linux (Syncthing Web UI)
- Click Actions (top-right) → Show ID.
- A QR code and device ID string appear. Leave this window open.
On Android (Syncthing-Fork)
For each Android device:
- Tap the + button → Add Device.
- Tap the QR icon in the top bar.
- Scan the QR code from the Linux Web UI.
- 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
- In the Syncthing Web UI, click your
Obsidian Vaultfolder → Edit. - Sharing tab → tick both Android devices.
- Click Save.
On Each Android Device
- In Syncthing-Fork, tap the notification that says a folder has been shared with you.
- Choose a local folder path for the vault. This must be a location Obsidian can open.
- Tap the folder → Edit → Ignore Patterns → add:
.obsidian - Tap the checkmark to confirm.
Note: The
.obsidianignore 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
- Create a new note on Linux (e.g.
test-sync.md). - Wait a few seconds. Check Phone → the note appears.
- Edit the note on Phone → save.
- Check Linux and Tablet → the edit appears on both.
- 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
| Task | Command / Action |
|---|---|
| Start Syncthing on Linux | systemctl --user start syncthing |
| Open Syncthing Web UI | xdg-open http://127.0.0.1:8384 |
| Check Syncthing status | systemctl --user status syncthing |
| Check sync status | Web UI or Syncthing-Fork dashboard |
| Open MEGAsync GUI | Application menu → MEGAsync |
| Check MEGA cloud files | https://mega.nz in browser |
| Init git in vault | cd /media/mohsin/mmh/MEGA/Obsidian\ Vault && git init && git add . && git commit -m "init" |
| Weekly git backup | 0 6 * * 1 cd /media/mohsin/mmh/MEGA/Obsidian\ Vault && git add . && git commit -m "backup $(date)" && git push |
Ignore .obsidian in sync | Add .obsidian to Syncthing ignore patterns on all devices |
Final Notes
This setup gives you three layers of protection:
| Layer | Tool | What It Protects Against |
|---|---|---|
| 1 — Real-time sync | Syncthing | Notes accessible on all devices immediately |
| 2 — Cloud backup | MEGAsync (Linux only) | Device loss, theft, hardware failure |
| 3 — Version history | Git (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