DEV Community

Cover image for How I sync my Obsidian vault across devices
Carmen
Carmen

Posted on

How I sync my Obsidian vault across devices

In the last few days, I’ve trying to improve my productivity and with it my note-taking system. Over the last couple of years, I've tried different tools, from Notion, Evernote, Google Docs, Google Keep, etc. In the end and after many hesitations, research and testing, I have concluded that the best software for me is Obsidian.md. Obsidian is a handy little program that uses links to connect notes. It is based on Markdown, which is a lightweight language used for writing and formatting plain text documents.

One advantage that Obsidian offers over many other applications is that it is completely free but within certain nuances. That is, for personal use it is 100% free, you don't need to register, and it offers access to many plugins and community support. Thanks to this, the fact that the possibility of syncing your notes through Obsidian is a paid feature was not a drawback. This is because I have decided to use git, software for tracking changes in any set files, and GitHub as the cloud-based git repository hosting service.

In this way, I only had to install and set up git on my different devices and clone the repository. In case anyone is wondering, my devices are a desktop pc, an iPad, and a phone (Android). I built my system as follows:

First of all, I created the repo on GitHub. Afterward, on my pc I installed Obsidian and with Gitkraken, a graphical interface for git, I cloned the repo to my local machine. For anyone who wants to build a similar system, there is no need to use Gitkraken, you may directly use git from the command line as well as other graphical interfaces such as GitHub Desktop or Sourcetree. Then, the only thing left to do was to use my repository as the base folder for the Obsidian vault.

On the other hand, as for the iPad, the tools I use are Working Copy and the Obsidian app. I must admit that the setup on my iPad took me a bit longer since I didn't know how to do it at first, but I don't have any regrets since I have found the way that best suits my needs. You may pull repos with the free version of Working Copy, but I think you need the pro version to push to a repo (You may access all Pro features while you are a student through the GitHub Student Developer Pack). To start with the setup, you need to download the Obsidian app from the App Store and create a new vault. On the creation screen, you need to make sure that Store in iCloud isn’t selected.

Next, after downloading Working Copy will have to configure the credentials for the git host (GitHub, Bitbucket, GitLab…) where you have the repo. Once you are done, clone the repo. Subsequently, from Working Copy, open the repo, select the “share menu” and click on the Setup Folder Sync option. Under the On My iPad section there should be an Obsidian folder that contains the Obsidian vault folder which you need to select. This step is crucial because it’s the way to sync the repo with the vault.

Finally, the configuration that I honestly find the most time-consuming and complicated. The first thing to do is to install Termux, an android terminal application, and a Linux environment. There are two ways to download the latest version of Termux: F-droid and GitHub. Once we have successfully installed Termux we must run a series of commands:

  1. apt update && upgrade. With this command, we will update all the packages in Termux.
  2. termux-setup-storage . Allow Termux to access your existing directories.
  3. pkg install git . Install git.
  4. pkg install gh . Not needed, but recommended. It’s a command-line tool by GitHub.
  5. gh auth login . Login into your GitHub account.
  6. git config --global user.name “your name” . Global git username associated with commits on all repositories in your system.
  7. git config --global user.email “youremail@yourdomain.com” . Global git email address associated with commits on all repositories in your system.
  8. git clone “your repo link” . Clone the repo to your local environment.
  9. mv “your repo name”/ storage/shared/ . Move the repo to the shared folder so you may access it from any Android app.

When using obsidian on your different devices, always remember to pull down the latest repo changes and commit and push any changes you make afterward!!

Thanks for reading this far!! I will be leaving links to resources below, in case it helps!! I’m open to constructive criticism, feedback and suggestions 😊

Resources & Useful links:

Top comments (0)