Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Postgres Sync

lanjaklanjak96 downloads

Syncs this vault to a self-hosted Postgres database (via PostgREST) instead of Sync or CouchDB - every note is embedded for semantic search from agent tooling too.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates3

Sync your Obsidian vault across devices using a self-hosted Postgres database instead of Obsidian Sync, iCloud, or a CouchDB setup. Every note also gets embedded, so the same table doubles as a semantic search index you can query from outside Obsidian.

What you need

  • A Postgres instance (with the pgvector extension available) reachable from every device you want to sync, fronted by PostgREST - Obsidian mobile can't open a raw database connection, so PostgREST is what actually speaks HTTP to the plugin.
  • An embedding server that speaks the llama.cpp /embedding endpoint, also reachable from every device. Point it at any embedding model you like; 768-dim models are the default assumption in sql/schema.sql, but you can change the embedding column's dimension to match whatever you run (do this before first use - see the comment in that file).
  • The schema in sql/schema.sql applied to your Postgres database, with a real API key set in app_settings.bearer_token, and PostgREST configured to use it (see below).

Obsidian Sync, CouchDB, Syncthing - none of that is needed. This plugin talks to PostgREST directly from inside Obsidian, so it works on desktop and mobile. Use HTTPS when either service is reachable outside a trusted private network. HTTP exposes note content and API keys in transit.

Setting up the backend

  1. Create a Postgres database and run sql/schema.sql against it:

    psql "postgres://user:pass@your-host:5432/your-db" -f sql/schema.sql
    
  2. Set a real API key (the seeded default is change-me, don't leave it) and a login password for the authenticator role:

    update app_settings set bearer_token = 'a long random key of your choosing';
    alter role authenticator with login password 'a real password';
    
  3. Run PostgREST pointed at the same database, connecting as authenticator, with:

    • db-anon-role = web_anon
    • db-pre-request = public.check_bearer_token

    The plugin sends its key as an X-Api-Key header, not Authorization - PostgREST reserves Authorization for its own JWT handling, so a custom header is what check_bearer_token() actually checks.

    Don't set PostgREST's max-rows below 100, or the plugin's pull (which pages in batches of 100) will silently stop early.

Upgrade an existing backend to 0.1.1

Version 0.1.1 needs the server revision column in sql/migrations/0.1.1-sync-revision.sql. Apply this migration before you install the 0.1.1 plugin on any device.

Stop PostgREST and schedule a short maintenance window. The migration backfills existing rows and builds an index, so it can block reads and writes while it runs. Apply it as the Postgres owner, then start PostgREST again:

psql -v ON_ERROR_STOP=1 "$DATABASE_URL" -f sql/migrations/0.1.1-sync-revision.sql

Install the plugin

Manually:

  1. Download main.js and manifest.json from the latest release.
  2. Drop them into <your vault>/.obsidian/plugins/postgres-sync/.
  3. Enable community plugins in Obsidian, then enable "Postgres Sync".

Setup

Open the plugin settings and fill in:

  • PostgREST URL - your PostgREST instance's address.
  • API key - the key you set in app_settings.bearer_token.
  • Embedding server URL - your llama.cpp embedding server's address.
  • Embed API key - optional, only needed if your embedding server requires auth.

Do this on every device you want synced, pointing at the same PostgREST instance. The plugin pulls remote notes and reconciles existing local notes when it starts. You can also run the "Pull changes from Postgres now" command.

How sync works, briefly

Last-write-wins by modification time. No conflict resolution beyond that, so if you edit the same note offline on two devices at once, whichever save lands later wins. Fine for a single person across a few devices; not built for real-time collaborative editing.

Uploads run one at a time to protect mobile devices and local embedding servers. New edits take priority over background recovery. Failed uploads retry with capped backoff, and Obsidian shows one aggregate failure notice instead of one notice per file. Embedding input is bounded for common local-model context limits, but Postgres always stores the complete note.

Android and iOS normally use case-insensitive storage. If the database contains paths that differ only by letter case, such as TODO.md and Todo.md, mobile keeps the existing path, reports the conflict once, and continues syncing other notes.

License

MIT

HealthExcellent
ReviewPassed
About
Sync your Obsidian vault across devices through a self-hosted Postgres database accessed via PostgREST. Embed each note into a vector column so the same table doubles as a semantic search index you can query outside Obsidian. Work on desktop and mobile over HTTP(S).
SyncingIntegrations
Details
Current version
0.1.2
Last updated
3 weeks ago
Created
2 months ago
Updates
3 releases
Downloads
96
Compatible with
Obsidian 1.13.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
lanjaklanjak
GitHublanjak
  1. Community
  2. Plugins
  3. Syncing
  4. Postgres Sync

Related plugins

Self-hosted LiveSync

Sync vaults securely to self-hosted servers or WEBRTC.

Fast Note Sync

Real-time sync of your vaults across server, mobile, and web; shareable with anyone; supports REST and MCP integrations to build your personal AI knowledge base.

Google Drive Sync

Syncs a vault into Google Drive for cross-platform use (works for iOS).

Sync Engine

The extensible vault synchronization engine: Fast · Free · Reliable. Supports WebDAV, S3, and Google Drive.

Nutstore Sync

Sync your vault with Nutstore (坚果云) using WebDAV protocol.

OneDrive Sync

Sync your Obsidian vault with OneDrive Personal/Consumer

Remotely Save

Sync notes between local and cloud with smart conflict: S3, Dropbox, webdav, OneDrive, Google Drive, Box, pCloud, Yandex Disk, Koofr, Azure Blob Storage.

Nextcloud Sync

Bidirectional sync between Obsidian and Nextcloud using hash-based change detection.

Air Sync

Keep your vault in sync across devices without managing sync—sync only what changed, preserve conflicting edits, and use your own Google Drive, OneDrive, or Dropbox.

GitHub

Git Sync

Sync your vault across all devices using your own GitHub account. Free forever.