carteakey.dev

Sync Obsidian notes between iOS and PC.

Note-taking Obsidian Markdown iOS

Obsidian is a great note-taking application. It acts as your second brain, where notes are connected through links, much like the human brain works.

Moreover, it uses a local folder to store the notes in plain-text Markdown format, making it future-proof and giving total control over your knowledge base.

Since the files are stored locally, you can use your methods of syncing these notes over your devices or use the excellent (but paid) Obsidian Sync subscription.

This article is a guide for people who have a Linux / Windows desktop and want to sync their notes with their iPads & iPhones, to get access to all your notes on the go!

macOS / Android users can take a look at this article instead > Sync your notes across devices {: .notice}

Windows + iOS

The easiest way to set up sync, in this case, would be to use iCloud Drive.

The free version offers 5GB storage, which should be more than enough to store all your notes, provided you do not use it already for images or have a paid storage plan. {: .notice--info}

Vault is nothing but a folder where all your notes and preferences will be stored. You can create multiple vaults to store different categories of notes, think of them as different notebooks. {: .notice}

If you do not want to use iCloud Drive, take a look at the guide below (It is for Linux, but the steps are pretty much the same).

Linux + iOS

Here's where things get more interesting, as there is no simple way to sync iCloud Drive on Linux. Fortunately, we can use Git instead!

git clone https://github.com/<your_username>/<your_repo_name>

Using iSH

mkdir <your_vault_name>
mount -t ios-unsafe . <your_vault_name>/

Quick Note (optional): If your fingers are tired from typing these commands on your possibly tiny touch input device, use ssh to login into your iSH terminal and easily run these commands from your desktop instead. Here's a quick step step-by-step step guide for running an ssh server. {: .notice--info}

#install the ssh tools and the ssh server.
apk add openssh
#create the host keys
ssh-keygen -A
#Set a password for root to protect your iOS device
passwd
#Allow SSH to log in as Root
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
#Start the SSh
/usr/sbin/sshd

You should now be able to ssh to your device with username root and the password you typed. {: .notice--info}

#install git
apk add git
#config username and email
git config --global user.name "<your_name>"
git config --global user.email "<your_email>"
#mark directory as safe
git config --global --add safe.directory /root/<your_vault_name>
#store passwords to avoid entering on every push
git config --global credential.helper store
#remove the obsidian config directory to allow cloning
rm -rf <your_vault_name>/.obsidian
#clone our repository
git clone https://github.com/<your_username>/<your_repo_name>
git pull
git add .
git push

Note: iSH is known to sometimes freeze when running on a large git repository. A known workaround is to config git to run single-threaded. Also, look at git gc --aggressive and Remove Commit History to make your notes repo lightweight. {: .notice--warning}

git config --global pack.threads "1"

Pros

Cons

Using Working Copy

Working Copy is a powerful Git client for iOS. It lets you clone the repository, and commit changes, but pushing and other features are paid. The free version is a good way to avoid the hassle of maintaining git on your iOS device and store a "read-only" copy of all your notes.

Credits to rsteele.

Pros

Cons

But we have a way around that too :)

Using Working Copy + iSH

Both Obsidian Sync and Working Copy are well worth their money. This option is just an excellent free alternative! {: .notice--danger}

Armed with this knowledge, we can set up a workflow to use Working Copy as the main application for syncing, and use iSH to just perform the git push(ergo, the paid feature) once any changes are made. This allows for a completely free and operational sync solution. (Albeit you will have 3 applications for your note-taking, with how good obsidian is, it might just be worth it!)

Optionally, set up Shortcuts to pull, add and commit. {: .notice--info}

Use any of these methods to sync and take your notes everywhere (and never open them xD).