I back them up and version them using Git and GitHub
Note: My system uses systemd (which is usually the default on most systems). If you’re using something else you’ll need to adapt the relevant parts.
1. Obsidian
Obsidian is a Markdown-based note-taking app with a strong community and a big plugin ecosystem. It’s free (not open source), and all your notes are plain .md files stored locally — no forced cloud syncs.
1.1. Install Obsidian (Arch Linux)
Terminal
sudopacman-Sobsidian
If you’re new to Obsidian, the help docs are pretty useful to get started.
2. Syncthing
To keep notes synced between devices (like your phone and laptop), I use Syncthing. It works over LAN, and you control everything.
If you’re not using UFW, a quick Google search will help you figure it out 🤗.
3. Git & GitHub Backup
Syncthing handles syncing, but it doesn’t track changes. That’s where Git comes in. With Git, you get version history and we will use GitHub to host the git repo to be able to access it from anywhere.
3.1. Install Git
Terminal
sudopacman-Sgit
3.2. Create a GitHub Repo
If you don’t already have a GitHub account, now’s the time. Create a private repo for your notes and clone it locally.
Then create a new folder inside the GitHub repo we just cloned.
In Obsidian, set that folder (not the root of the repo itself) as your vault.
4. Automating Git Commits
You could manually git commit and git push your changes every day… but that can be labour intensive. Let’s automate it.
4.1. Write a Commit Script
Create this script at ~/.local/bin/git_auto_commit.sh:
Create this file: /etc/systemd/system/git_auto_commit.timer
e.g. with neovim sudo nvim /etc/systemd/system/git_auto_commit.timer
1
[Unit]
2
Description=Run git_auto_commit.service every 2 hours
3
4
[Timer]
5
OnBootSec=10min
6
OnUnitActiveSec=2h
7
8
[Install]
9
WantedBy=timers.target
5.3. Enable the Timer
Reload systemd and start the timer:
Terminal
sudosystemctldaemon-reload
sudosystemctlenable--nowgit_auto_commit.timer
You can check the timer’s status with:
Terminal
systemctlstatusgit_auto_commit.timer
And see logs with:
Terminal
journalctl-ugit_auto_commit.service
To test it manually:
Terminal
sudosystemctlstartgit_auto_commit.service
6. Final Thoughts
That’s it! With this setup you get:
Local-first note-taking
Syncing across all your devices
Automatic version control
With this setup no one will be able to hold your notes hostage. If you have ideas to improve this setup, or if something doesn’t work as expected, feel free to reach out.