- Create a private, empty repository on Codeberg. Codeberg’s FAQ allows up to 100 MB of private content, so keep the vault small.
- Generate an access token under Settings → Applications. Forgejo’s repository read and write scopes cover Git access.
- Push the vault from your computer over HTTPS: your username, and the token as the password.
- Clone it on each phone with GitSync.md, open the folder in Obsidian, then pull, commit and push.
Prefer another host? See the guides for GitHub, GitLab and Bitbucket. Get GitSync.md for iPhone and iPad → · Get it on Google Play →
Is Codeberg a good home for a private vault?
Read the policy first. Codeberg’s FAQ says: “Codeberg’s mission is to promote free/libre software.” For contributors, it says “we allow up to 100 MB of private content for your convenience,” and suggests using it “for your personal notes, your side project or any other you want to keep private.” The FAQ is the source of truth, so read the exact wording there before you rely on it for a vault.
On size, the same FAQ says there is “no quota for valid use-cases,” that Codeberg will “review larger projects and reserve the right to deny service,” and that if you intend to use more than 750 MiB for Git storage or 1.5 GiB of packages, LFS and attachments, you should request those resources first.
A text vault is usually far below 100 MB. If yours is large, has many attachments, or you don’t contribute to free software, pick another host or run your own: the FAQ describes Forgejo, the software Codeberg runs, as free software that is relatively easy to self-host. See self-hosted Git with SSH on iPhone and iPad. For other comparisons, see Obsidian sync alternatives.
Step 1: Create the repository on Codeberg
Create a new repository and set it to private. If you’ll push an existing vault, leave it empty: no README, no license, no .gitignore from the form. That avoids a first push that’s rejected because the histories differ.
Step 2: Add a .gitignore
Obsidian rewrites .obsidian/workspace*.json as you move around, which would create a commit every session. Add a .gitignore before the first push. The Obsidian .gitignore generator builds one, and the .gitignore guide explains each line.
Step 3: Create an access token
These steps follow Codeberg’s access token page:
- Click your profile picture in the top right and choose Settings.
- Open the Applications tab.
- Under Manage Access Tokens, enter a name in Token Name (for example
obsidian-vault) and generate the token. - Copy it and store it securely. Per Codeberg’s 2FA page, the token “will not be shown again.”
Scopes: Codeberg runs Forgejo, and Forgejo’s token scope page lists read:repository and write:repository. Reading and cloning needs read; pushing needs write. If the form on your server offers scopes, give a synced vault both. Codeberg’s page itself doesn’t name scopes, so if your form differs, follow what it shows.
That page also says tokens “grant full access to your account,” so treat them like a password, create one per app, and never paste one into a note: it would be committed with the vault.
To revoke a token, return to Settings → Applications, click the red Delete button next to it and confirm. Any app using it loses access.
Which username and password?
With 2FA on, Codeberg says to use your username and the token as the password for HTTPS. The username is your Codeberg username.
Step 4: Push the vault from desktop
From the vault folder (the one containing .obsidian):
git init
git add .
git commit -m "Initial vault"
git branch -M main
git remote add origin https://codeberg.org/<user>/<repo>.git
git push -u origin main
When Git asks for credentials, enter your Codeberg username and paste the token as the password. Don’t put the token in the remote URL: it would be stored in plain text in .git/config. To keep syncing on desktop, you can use the Obsidian Git plugin: see the plugin guide.
Step 5: SSH instead of HTTPS
- Add your public key in Codeberg under Settings → SSH / GPG Keys → Add key, per Codeberg’s SSH key page. Never upload the private key.
- Use the remote
git@codeberg.org:<user>/<repo>.git. - On first connect, compare the host key fingerprint with the ones on Codeberg’s fingerprint page before you trust it.
GitSync.md’s in-app key and host-key steps are in the self-hosted SSH guide.
Step 6: iPhone and iPad with GitSync.md
Add the repository by URL
Tap Add Repository, then Enter URL Manually, and paste https://codeberg.org/<user>/<repo>.git. Under Authentication, choose HTTPS Token/Password, with your Codeberg username and the token as the password. Or choose SSH Private Key and use the SSH URL. Set your author name and email. Credentials are stored in the iOS Keychain.
Choose the vault folder
Set the save location to On My iPhone → Obsidian (on iPad, On My iPad → Obsidian), so Obsidian can open the cloned folder as a vault.
Clone, then pull, edit, commit and push
Start the clone and open the folder as a vault in Obsidian. Pull before editing, then commit and push from GitSync.md. See the iOS setup guide and background sync on iPhone.
Step 7: Android
On the first screen, choose SSH, token or another host to open Any Git host, paste the repository URL, choose Token (or SSH key), and enter your Codeberg username and the token. Then use Test & clone. The Android guide covers folder and storage steps. GitSync.md is on Google Play.
Attachments and size
Keep PDFs and images small: every version stays in Git history, and it all counts toward the 100 MB guidance above. Per the FAQ, LFS counts toward the 1.5 GiB threshold for packages, LFS and attachments. See Git LFS on iPhone.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| 401 / authentication failed | Your account password used with 2FA on, a wrong username, or a token without write access | Use your Codeberg username and the token as the password. If you can clone but not push, make a token that includes write:repository |
| Host key prompt or mismatch (SSH) | First connection, or the server’s key changed | Compare with Codeberg’s fingerprints. Trust it only if it matches |
| Push rejected (non-fast-forward) | The remote has commits you don’t have | Pull first, resolve any conflict, push again. See merge conflicts on iPhone |
| Repository too large | Over the size guidance | Remove big attachments, request more resources as the FAQ describes, or move to a self-hosted Forgejo |
FAQ
Is Codeberg free?
Codeberg’s FAQ says it is “both free-as-in-beer and free-as-in-freedom, as long as you follow our Terms Of Use.” The private-repository guidance above still applies.
Can I use Gitea or a self-hosted Forgejo instead?
Yes. GitSync.md treats any Git server as an ordinary HTTPS or SSH remote. Use your own host name instead of codeberg.org. Token menus and scope names depend on the server version, so check your server’s docs. The self-hosted guide covers host keys.
Does it work without the Obsidian Git plugin on mobile?
Yes. GitSync.md clones the repository into a folder Obsidian can open as a vault, and you pull, commit and push from the app instead of from a plugin.
Do Codeberg tokens expire?
Codeberg’s access token page doesn’t say, so this guide makes no claim. If a token you made stops working, check whether it was deleted, then make a new one.
Recap
Private repo, a small vault, an access token as your HTTPS password, and GitSync.md to clone it on your phone.
Clone your Codeberg vault on iPhone, iPad or Android with GitSync.md → · Android on Google Play → Free to download, $9.99 once to unlock.
