obsidian-livesync
is an Obsidian plugin, which allows you to Synchronize your Obsidian vault between devices, using a CouchDB database.
Synology NAS devices offer Docker support, which is a convenient way to host your CouchDB.
- Create a directory for your Docker data (e.g.
/volume1/docker/obsidian-couchdb
) - Create a user with permissions to that directory - put them in the
users
group - Get the UID and GID for the user. See: https://mariushosting.com/synology-find-uid-userid-and-gid-groupid-in-5-seconds/
- Upload your local.ini (example below)
Although it is not required, I would highly recommend fronting your CouchDB with a reverse proxy and SSL.
mariushosting
has a tutorial, so I will not create another one.
https://mariushosting.com/how-to-install-nginx-proxy-manager-on-your-synology-nas/
The below docker
command can be executed via a task, as mariushosting
usually does.
- Open the Control Panel
- Open Task Scheduler from the Control Panel
- Click the "Create" button
- Choose Scheduled Task ➡️ User-defined script
- General tab
- Task: Install CouchDB
- User: root
- Schedule
- Run on the following date
- leave as today's date
- Do not repeat
- Time
- leave everything default
- Task settings
- Run command - put the command below in
- Click "Ok"
- Run on the following date
- If the task is checked, un-check it
- Highlight the task
- Click the "Run" button
- General tab
docker run -d \
-e COUCHDB_USER=XXXXXXX \
-e COUCHDB_PASSWORD=XXXXXX \
-e PUID=XXXX \
-e PGID=XXX \
-v /volume1/docker/obsidian-couchdb/local.ini:/opt/couchdb/etc/local.ini \
-v /volume1/docker/obsidian-couchdb/data:/opt/couchdb/data \
-p 5984:5984 \
--restart always \
couchdb
[couchdb]
single_node=true
max_document_size = 50000000
[chttpd]
require_valid_user = true
max_http_request_size = 4294967296
[chttpd_auth]
require_valid_user = true
authentication_redirect = /_utils/session.html
[httpd]
WWW-Authenticate = Basic realm="couchdb"
enable_cors = true
[cors]
origins = app://obsidian.md,capacitor://localhost,http://localhost
credentials = true
headers = accept, authorization, content-type, origin, referer
methods = GET, PUT, POST, HEAD, DELETE
max_age = 3600
- Input the URL for your CouchDB
- Use the credentials you put into the Docker configuration
- Choose an arbitrary name for your database
https://github.com/vrtmrz/obsidian-livesync/blob/main/docs/setup_own_server.md
Has anyone successfully gotten this to work with HTTPS? I've configured my CouchDB to work with both HTTP (port 5984) and HTTPS (port 6984), and testing by going to the URI in a web browser works and gives me the same JSON payload back, but Livesync can't connect on HTTPS when I try https://host:6984.