The Remote Deployment mode is the primary production path for Vault Cortex, enabling secure access to an Obsidian vault from any device (mobile, web, or remote desktop). Unlike the local deployment which uses bind-mounts, the remote deployment utilizes the vault-cortex:remote image, which bundles Obsidian Sync to maintain a bidirectional, headless synchronization between the official Obsidian cloud and the Vault Cortex server Dockerfile5-7
This deployment architecture removes the requirement for a local Obsidian desktop instance or a persistent VPN connection, making the vault accessible via a standard MCP interface over HTTPS deploy/remote/docker-compose.yml3-5
The remote deployment is powered by a single OCI image supervised by s6-overlay. It manages two distinct processes: the obsidian-headless CLI for synchronization and the Vault Cortex MCP server docker-compose.yml3-5
The following diagram illustrates the relationship between the external Obsidian Sync service, the internal supervised processes, and the shared volumes.
Remote Deployment Component Graph
Sources: Dockerfile5-7 docker-compose.yml17-65 deploy/remote/docker-compose.yml18-65
The container uses s6-overlay to manage the lifecycle and dependencies of the sync and MCP processes. The remote target in the Dockerfile installs s6-overlay and the obsidian-headless CLI (ob) Dockerfile90-131
Before services start, the container executes an initialization chain defined in the rootfs/ directory:
init-check-auth script ensures OBSIDIAN_AUTH_TOKEN is present, failing early with instructions if it is missing rootfs/etc/s6-overlay/scripts/init-check-auth1-18init-obsidian-login handles the authentication state by running ob login as the obsidian user rootfs/etc/s6-overlay/scripts/init-obsidian-login1-15OBSIDIAN_AUTH_TOKEN by running the container with the get-sync-token entrypoint, which provides an interactive login prompt rootfs/usr/local/bin/get-sync-token1-47ob sync. It uses DEVICE_NAME to identify itself to the Obsidian cloud docker-compose.yml23-31healthcheck validates this service by querying the /healthz endpoint docker-compose.yml70-81Sources: Dockerfile90-131 docker-compose.yml23-81 rootfs/etc/s6-overlay/scripts/init-check-auth1-18 rootfs/etc/s6-overlay/scripts/init-obsidian-login1-15
To ensure both the sync process and the Node.js server can read and write to the same files, the deployment aligns permissions:
PUID and PGID environment variables (default 1000) map the internal obsidian user to the host user docker-compose.yml27-28vault_data: The actual markdown vault files, mounted at /vault docker-compose.yml62mcp_index_data: The SQLite search index, vector embeddings, and logs, mounted at /data docker-compose.yml63obsidian_config: Stores the headless Obsidian login state and sync configuration, mounted at /home/obsidian/.config docker-compose.yml64Remote deployment requires HTTPS for secure communication and OAuth 2.1 compliance.
MCP_AUTH_TOKEN as defense-in-depth docker-compose.yml9-12Sources: docker-compose.yml9-65 docker-compose.yml86-93 deploy/remote/docker-compose.yml62-65
The following table describes the primary environment variables used in the remote deployment mode.
| Variable | Default | Description |
|---|---|---|
OBSIDIAN_AUTH_TOKEN | Required | Token for Obsidian Sync cloud access docker-compose.yml24 |
VAULT_NAME | Required | The exact name of the vault to sync (case-sensitive) docker-compose.yml25 |
MCP_AUTH_TOKEN | Required | Bearer token for in-process MCP authentication docker-compose.yml38 |
PUBLIC_URL | Required | The public-facing HTTPS URL for OAuth metadata docker-compose.yml39 |
DEVICE_NAME | vault-cortex-lightsail | The name shown in Obsidian Sync settings docker-compose.yml29 |
CONFLICT_STRATEGY | merge | How to handle sync conflicts docker-compose.yml30 |
SYNC_MODE | bidirectional | Sync directionality docker-compose.yml31 |
Sources: docker-compose.yml22-61 deploy/remote/docker-compose.yml24-61
Code-to-Entity Mapping: Startup and Sync
Sources: docker-compose.yml67-81 rootfs/etc/s6-overlay/scripts/init-check-auth1-18 rootfs/etc/s6-overlay/scripts/init-obsidian-login1-15 Dockerfile90-131
docker run --rm -it --entrypoint get-sync-token ghcr.io/aliasunder/vault-cortex:remote to get your sync token rootfs/usr/local/bin/get-sync-token1-10.env.example to .env and provide the required keys deploy/remote/docker-compose.yml7-8docker compose up -d. The server will be healthy once the sync process completes its initial pull and the Node server responds to /healthz docker-compose.yml67-81npx vault-cortex@latest init --mode remote deploy/remote/README.md29-31Sources: docker-compose.yml1-94 deploy/remote/docker-compose.yml1-90 rootfs/usr/local/bin/get-sync-token1-47
Refresh this wiki
This wiki was recently refreshed. Please wait 6 days to refresh again.