couchdb

couchdb

apps.detail.official

apps.detail.types.app from junkerderprovinz's Repository

apps.detail.sections.overview

Apache CouchDB is a document database that speaks HTTP and stores JSON. It is the sync backend behind Obsidian LiveSync and many offline-first apps. This is a plug-and-play Unraid Community Applications template that wraps the official couchdb image (3.x), fixed so your data and settings actually survive a container recreate or update. WHY THIS TEMPLATE EXISTS: the old community CouchDB template maps the 1.x data path (/usr/local/var/lib/couchdb). On the current 3.x image the real data lives in /opt/couchdb/data and the config in /opt/couchdb/etc/local.d - if those are not mapped, your databases sit in an anonymous Docker volume and CORS resets on every recreate. This template maps both to appdata, so nothing is lost. FIRST-RUN SETUP (two quick steps, see the README): 1. Set an Admin User + Admin Password below (CouchDB 3.x will not start without an admin). 2. After it starts, finish the single-node setup so the system databases are created - run once on the Unraid console (replace IP / user / pass): curl -X POST -u admin:PASS http://SERVER_IP:5984/_cluster_setup -H "Content-Type: application/json" -d '{"action":"enable_single_node","bind_address":"0.0.0.0","username":"admin","password":"PASS","port":5984,"singlenode":true}' OBSIDIAN LIVESYNC / BROWSER APPS need CORS. The image regenerates docker.ini from the admin env on every start, so CORS set in Fauxton is wiped on recreate. Instead drop a persistent file at appdata/couchdb/local.d/10-cors.ini (full contents in the README) - it is preserved forever. Then browse to http://SERVER_IP:5984/_utils/ (Fauxton). Detailed README (setup, CORS file, backup, reverse proxy): https://github.com/junkerderprovinz/Unraid-apps/blob/main/couchdb/README.md
CouchDB for Unraid

Validate  Upstream Apache CouchDB  Image  Obsidian LiveSync ready  Unraid  License

A plug-and-play Unraid Community Applications template for Apache CouchDB (3.x) - the HTTP/JSON document database behind Obsidian LiveSync and many offline-first apps. Wraps the official couchdb image, fixed so your data and config actually survive a container recreate or update, with CORS documented for LiveSync.


Buy me a coffee


Table of Contents

  1. What is this?
  2. Why not the old CouchDB template?
  3. Quick Start on Unraid
  4. First-run setup (single node)
  5. CORS for Obsidian LiveSync
  6. Configuration
  7. Backup & restore
  8. Reverse proxy & HTTPS
  9. Updating
  10. Troubleshooting
  11. License

1. What is this?

An Unraid Community Applications template for Apache CouchDB. It deploys the official couchdb image (currently 3.x) with the two volume mounts the modern image actually needs, so your databases and settings persist. CouchDB is a document database that speaks plain HTTP and stores JSON, and it is the standard sync backend for Obsidian LiveSync.


2. Why not the old CouchDB template?

The long-standing community CouchDB template was written for CouchDB 1.x and maps /usr/local/var/lib/couchdb. The official image has been 3.x for years, and 3.x stores things in different places:

What CouchDB 3.x path Old 1.x template
Databases /opt/couchdb/data /usr/local/var/lib/couchdb (wrong)
Config drop-ins /opt/couchdb/etc/local.d not mapped

Two things go wrong with the old template:

  1. Your databases live in an anonymous Docker volume. Because /opt/couchdb/data is not mapped, the real data sits in an unnamed volume - not in appdata, not in your backups, and gone the moment you recreate or update the container.
  2. CORS keeps disabling itself. The image regenerates local.d/docker.ini from the admin environment variables on every start. A restart keeps the file, but a recreate wipes any CORS you set in Fauxton. Since local.d is not mapped, there is nowhere for a persistent CORS file to live.

This template maps both paths to appdata, so nothing is lost and CORS stays put.


3. Quick Start on Unraid

  1. Apps tab -> search CouchDB (by junkerderprovinz) -> Install.
  2. Set an Admin User and a strong Admin Password (CouchDB 3.x will not start without an admin; "admin party" is disabled).
  3. Apply, wait for the pull, then open Fauxton at http://SERVER_IP:5984/_utils/.
  4. Do the first-run single-node setup (one command) so the system databases exist.
  5. Using Obsidian LiveSync or another browser client? Add the CORS file.

4. First-run setup (single node)

A fresh CouchDB 3.x node needs its system databases (_users, _replicator, _global_changes) created once. The cleanest way is the single-node setup call - run it on the Unraid console after the container is up (replace SERVER_IP and PASSWORD):

curl -X POST -u admin:PASSWORD \
  http://SERVER_IP:5984/_cluster_setup \
  -H "Content-Type: application/json" \
  -d '{"action":"enable_single_node","bind_address":"0.0.0.0","username":"admin","password":"PASSWORD","port":5984,"singlenode":true}'

Verify it worked:

curl http://SERVER_IP:5984/_up
curl -u admin:PASSWORD http://SERVER_IP:5984/_all_dbs

_up should return {"status":"ok"} and _all_dbs should list _replicator and _users. The "_users database does not exist" warning in the log is gone once this is done.


5. CORS for Obsidian LiveSync

Browser clients (Obsidian LiveSync, the Obsidian mobile app, any web app) need CORS enabled on CouchDB. Do not set it in Fauxton - that writes to docker.ini, which the image regenerates on the next recreate. Instead add a separate drop-in file that the image never touches.

Create local.d/10-cors.ini in the config folder you mapped (/mnt/user/appdata/couchdb/local.d/10-cors.ini) with exactly this content:

[chttpd]
enable_cors = true

[cors]
origins = *
credentials = true
headers = accept, authorization, content-type, origin, referer
methods = GET, PUT, POST, HEAD, DELETE

Then restart the container. CORS now survives restarts and recreates, because it lives in its own file that the entrypoint leaves alone.

Tighter origins. origins = * is the simplest and works. To lock it down to Obsidian only, replace that line with: origins = app://obsidian.md,capacitor://localhost,http://localhost

In LiveSync, point the URI at http://SERVER_IP:5984 (or your HTTPS domain), enter the admin user and password, and set a database name (LiveSync creates it on first sync). For the mobile app you generally need HTTPS - see Reverse proxy & HTTPS.


6. Configuration

Every field is shown in the template. Fields you rarely touch (the cookie secret) are under Show more settings.

Field Variable / path Default Notes
WebUI / API Port 5984 5984 HTTP API + Fauxton (/_utils/)
Data (databases) /opt/couchdb/data /mnt/user/appdata/couchdb/data the .couch files - must be mapped
Config (local.d) /opt/couchdb/etc/local.d /mnt/user/appdata/couchdb/local.d drop-in .ini (CORS) - must be mapped
Admin User COUCHDB_USER admin first start only; change later in Fauxton
Admin Password COUCHDB_PASSWORD - masked; use a strong one
Cookie Secret COUCHDB_SECRET - advanced, optional; set for proxy auth / clustering

Need another CouchDB setting? Either add a variable with Unraid's Add another Path, Port, Variable..., or drop another .ini into the mapped local.d folder (e.g. 20-tuning.ini).


7. Backup & restore

Everything that matters is in the two mapped folders under /mnt/user/appdata/couchdb:

  • data/ - all your databases.
  • local.d/ - your config, including 10-cors.ini and the admin docker.ini.

Back up that whole couchdb appdata folder (the Unraid CA Backup plugin or any file backup does the job). To restore, drop the folders back and recreate the container. For a logical, version-independent backup you can also replicate databases out with CouchDB's own _replicate, or dump a database over HTTP.


8. Reverse proxy & HTTPS

CouchDB serves plain HTTP on 5984. The Obsidian mobile app (and good hygiene generally) wants HTTPS, so put it behind a reverse proxy (SWAG / Nginx Proxy Manager / Traefik):

  • Proxy https://couchdb.mydomain.tld -> http://SERVER_IP:5984.
  • Point LiveSync's URI at the https:// domain.
  • Keep CouchDB itself on the LAN; let the proxy terminate TLS.

CouchDB is a database with a full HTTP API - never expose port 5984 straight to the internet. Always front it with a proxy and a strong admin password.


9. Updating

CouchDB updates by image: hit Force Update in the Unraid Docker tab (or change the :latest tag on the Repository field to pin a specific version). Your data and config live in appdata, so they survive updates. CouchDB 3.x is backward compatible across minor releases; read the upstream release notes before a major jump.


10. Troubleshooting

CORS "keeps turning off" after a recreate

You set CORS in Fauxton, which writes docker.ini - the file the image rewrites on every start. Use a separate local.d/10-cors.ini instead (see CORS). It is never regenerated.

Log says "the _users database does not exist"

The node has not been finalised. Run the single-node setup once.

Container won't start / "you must set the admin"

CouchDB 3.x refuses to run without an admin. Set Admin User and Admin Password in the template and Apply.

My databases disappeared after an update

You were on a template that did not map /opt/couchdb/data, so the data was in an anonymous volume. If the container still exists you can recover it: docker volume ls, find the volume, copy its _data into /mnt/user/appdata/couchdb/data, then recreate on this template. This is exactly the failure mode this template prevents.

LiveSync can't connect

Check, in order: CORS file present and container restarted; the URI is reachable (curl http://SERVER_IP:5984/_up); admin user/password correct; on mobile, you are using HTTPS through a reverse proxy.


11. License

This template is MIT-licensed (see LICENSE). Apache CouchDB itself is a project of the Apache Software Foundation, distributed under the Apache License 2.0; this repo only packages it for Unraid.

apps.marketingCta.appInstallTitle

apps.marketingCta.appInstallDescription

apps.installHelp.stepOpen apps.installHelp.stepSearchApp apps.installHelp.stepReview apps.installHelp.stepInstall

apps.detail.sections.requirements

Set an Admin User and Admin Password below (CouchDB 3.x will not start without one). After first start, run the single-node setup so the _users / _replicator / _global_changes system databases are created - see the README. For Obsidian LiveSync or any browser client, add appdata/couchdb/local.d/10-cors.ini (contents in the README) to enable CORS persistently.

apps.detail.sections.categories

apps.downloadStats.title

202,988,553
apps.downloadStats.metrics.totalDownloads
899,918
apps.downloadStats.metrics.thisMonth
719,470
apps.downloadStats.metrics.avgPerMonth

apps.downloadStats.chart.totalOverTime

apps.downloadStats.chart.loading

apps.detail.sections.related

apps.detail.sections.details

apps.detail.details.repository
couchdb:latest
apps.detail.details.registry
apps.detail.details.lastUpdated2026-07-14
apps.detail.details.firstSeen2017-01-04

apps.detail.sections.runtime

apps.detail.details.webui
http://[IP]:[PORT:5984]/_utils/
apps.detail.details.network
bridge
apps.detail.details.shell
bash
apps.detail.details.privileged
false

apps.detail.sections.configuration

WebUI / API PortPorttcp

CouchDB HTTP API and the Fauxton web UI (reachable at /_utils/). This is the only port a single-node instance needs.

apps.detail.config.target
5984
apps.detail.config.default
5984
apps.detail.config.value
5984
Data (databases)Pathrw

Where CouchDB 3.x stores every database (the .couch files). This MUST be mapped - if it is not, your databases live in an anonymous Docker volume and are lost on the next recreate or image update.

apps.detail.config.target
/opt/couchdb/data
apps.detail.config.default
/mnt/user/appdata/couchdb/data
apps.detail.config.value
/mnt/user/appdata/couchdb/data
Config (local.d)Pathrw

Persistent config drop-in directory. The image regenerates docker.ini here from the admin user/password on every start, but any OTHER .ini you add - e.g. 10-cors.ini for Obsidian LiveSync - is preserved across restarts AND recreates. Map this or config changes are lost.

apps.detail.config.target
/opt/couchdb/etc/local.d
apps.detail.config.default
/mnt/user/appdata/couchdb/local.d
apps.detail.config.value
/mnt/user/appdata/couchdb/local.d
Admin UserVariable

Server admin username, created on first start. CouchDB 3.x refuses to run without an admin ('admin party' is disabled). Only used on the very first start - change it later in Fauxton, not here.

apps.detail.config.target
COUCHDB_USER
apps.detail.config.default
admin
apps.detail.config.value
admin
Admin PasswordVariable

Password for the admin user. Use a strong one - CouchDB is a database, keep it on your LAN or behind a reverse proxy, never exposed raw to the internet.

apps.detail.config.target
COUCHDB_PASSWORD
Cookie Secret (COUCHDB_SECRET)Variable

Optional. A fixed secret for signing session/proxy-auth cookies. Leave empty for a single node (one is generated). Set a stable value (openssl rand -hex 32) if you use proxy auth or plan to cluster. Masked.

apps.detail.config.target
COUCHDB_SECRET