DEV Community

Dassa
Dassa

Posted on

Setting Up Obsidian on Ubuntu and Syncing with Git & Android (Step-by-Step)

In this guide, I’ll walk you through:

  • Installing Obsidian on Ubuntu
  • Syncing your vault with GitHub (private repo)
  • Making it work seamlessly on Android, even though mobile Git does not support SSH

This setup is stable, version-controlled, and works offline.


Why Obsidian + Git?

  • Markdown-based, future-proof notes
  • Full version history (unlike cloud sync tools)
  • Private repositories = full control over data
  • Works across Linux, Windows, and Android

Step 1: Install Obsidian on Ubuntu

Download the .deb package from the official site:

https://obsidian.md/download

Install using gdebi

First, install gdebi if it’s not already installed:

sudo apt-get update
sudo apt-get install gdebi
Enter fullscreen mode Exit fullscreen mode

Then open the downloaded .deb file with GDebi Package Installer and install Obsidian.

Why gdebi?
It automatically resolves dependencies, unlike dpkg.


Step 2: Create a Private GitHub Repository

  1. Go to GitHub
  2. Create a new repository
  3. Set it to Private
  4. Do not initialize with README (Obsidian will populate it)

Step 3: Clone the Repository Using SSH (Desktop)

On Ubuntu, navigate to where you want your vault:

cd ~/Documents
Enter fullscreen mode Exit fullscreen mode

Clone the repository:

git clone git@github.com:DasDNS/Obsidian_Notes.git
Enter fullscreen mode Exit fullscreen mode

You should see output similar to:

Cloning into 'Obsidian_Notes'...
Receiving objects: 100% (4/4), done.
Enter fullscreen mode Exit fullscreen mode

Verify the remote:

cd Obsidian_Notes
git remote -v
Enter fullscreen mode Exit fullscreen mode

Output:

origin  git@github.com:DasDNS/Obsidian_Notes.git (fetch)
origin  git@github.com:DasDNS/Obsidian_Notes.git (push)
Enter fullscreen mode Exit fullscreen mode

Step 4: Open the Vault in Obsidian (Ubuntu)

  1. Open Obsidian
  2. Click Open folder as vault
  3. Select Obsidian_Notes
  4. Start creating notes

Step 5: Install & Configure Obsidian Git Plugin (Desktop)

  1. Go to Settings → Community Plugins
  2. Disable Safe Mode
  3. Install Obsidian Git
  4. Enable the plugin

Recommended settings:

  • Auto commit on interval
  • Auto pull on startup
  • Commit message template (optional)

Now your notes automatically commit and sync.


Step 6: Why Android Needs HTTPS (Important)

Obsidian Git on Android:

  • ❌ Does NOT support SSH
  • ✅ Supports HTTPS + Personal Access Token (PAT)

So we keep SSH on desktop, but create an HTTPS copy of the vault for Android.


Step 7: Create an HTTPS-Compatible Copy (Desktop)

Duplicate your vault:

cp -r ~/Documents/Obsidian_Notes ~/Documents/Obsidian_Notes_HTTPS
cd ~/Documents/Obsidian_Notes_HTTPS
Enter fullscreen mode Exit fullscreen mode

Change the remote from SSH → HTTPS:

git remote set-url origin https://github.com/DasDNS/Obsidian_Notes.git
Enter fullscreen mode Exit fullscreen mode

Verify:

git remote -v
Enter fullscreen mode Exit fullscreen mode

Output:

origin  https://github.com/DasDNS/Obsidian_Notes.git (fetch)
origin  https://github.com/DasDNS/Obsidian_Notes.git (push)
Enter fullscreen mode Exit fullscreen mode

✅ This repo is now Android-compatible.


Step 8: Copy the Vault to Android

  1. Connect phone via USB
  2. Enable File Transfer (MTP)
  3. Copy the entire folder:
  • .git/
  • .obsidian/
  • All markdown files

Recommended location:

Internal Storage / Obsidian
Enter fullscreen mode Exit fullscreen mode

⚠️ Copy the folder itself, not just its contents.


Step 9: Install Obsidian on Android

  • Install Obsidian from the Play Store
  • Open the app
  • Select Open existing folder
  • Choose the copied Obsidian folder

Step 10: Git Sync on Android (Access Token Required)

  1. Go to Settings → Community Plugins
  2. Enable Obsidian Git
  3. Open the Command Palette
  4. Run Obsidian Git: Pull

You’ll be prompted for:

  • Username → GitHub username
  • PasswordPersonal Access Token (PAT)

⚠️ This token is mandatory. SSH keys do NOT work on Android.

Once entered, Obsidian Git will:

  • Pull updates
  • Commit changes
  • Push back to GitHub

Final Result

✔ Ubuntu → SSH Git (secure & fast)
✔ Android → HTTPS Git (token-based)
✔ Same private repository
✔ Full version history
✔ Offline-first notes


Final Thoughts

This setup gives you:

  • Full control over your data
  • No paid sync service
  • A workflow that scales from student notes to research archives

If you’re serious about long-term note-taking, Obsidian + Git is worth the setup.


References

I used several community resources when refining this workflow:

🔗 Obsidian + GitLab Setup (Andrew Wegner)
A detailed walkthrough of connecting Obsidian to a Git repository, which helped inform the desktop Git steps in this guide:
https://andrewwegner.com/obsidian-gitlab-setup.html

🔗 Obsidian Android Syncing via GitHub (Reddit)
A community discussion about syncing Obsidian on Android using GitHub and personal access tokens:
https://www.reddit.com/r/ObsidianMD/comments/17odzjb/obsidian_android_syncing_via_github_in_2023/

Top comments (0)