apps.header.allAppsCount
couchdb
apps.detail.officialapps.detail.types.app from junkerderprovinz's Repository
apps.detail.sections.overview
Readme
View on GitHub
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.
Table of Contents
- What is this?
- Why not the old CouchDB template?
- Quick Start on Unraid
- First-run setup (single node)
- CORS for Obsidian LiveSync
- Configuration
- Backup & restore
- Reverse proxy & HTTPS
- Updating
- Troubleshooting
- 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:
- Your databases live in an anonymous Docker volume. Because
/opt/couchdb/datais 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. - CORS keeps disabling itself. The image regenerates
local.d/docker.inifrom the admin environment variables on every start. A restart keeps the file, but a recreate wipes any CORS you set in Fauxton. Sincelocal.dis 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
- Apps tab -> search CouchDB (by junkerderprovinz) -> Install.
- Set an Admin User and a strong Admin Password (CouchDB 3.x will not start without an admin; "admin party" is disabled).
- Apply, wait for the pull, then open Fauxton at
http://SERVER_IP:5984/_utils/. - Do the first-run single-node setup (one command) so the system databases exist.
- 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, including10-cors.iniand the admindocker.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.detail.sections.requirements
apps.detail.sections.categories
apps.downloadStats.title
apps.downloadStats.chart.totalOverTime
apps.detail.sections.related
apps.detail.related.exploreCategories
apps.detail.related.exploreAllapps.detail.sections.links
apps.detail.sections.details
couchdb:latestapps.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
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
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
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
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
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
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