{"id":13550493,"url":"https://github.com/apache/couchdb-docker","last_synced_at":"2025-04-08T08:11:57.027Z","repository":{"id":43541361,"uuid":"39759972","full_name":"apache/couchdb-docker","owner":"apache","description":"Semi-official Apache CouchDB Docker images","archived":false,"fork":false,"pushed_at":"2025-03-21T23:22:57.000Z","size":300,"stargazers_count":272,"open_issues_count":23,"forks_count":140,"subscribers_count":29,"default_branch":"main","last_synced_at":"2025-04-01T05:33:48.040Z","etag":null,"topics":["apache","big-data","cloud","couchdb","cplusplus","database","erlang","http","javascript","network-client","network-server"],"latest_commit_sha":null,"homepage":"https://github.com/apache/couchdb-docker","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-27T07:00:05.000Z","updated_at":"2025-03-21T23:22:59.000Z","dependencies_parsed_at":"2025-04-04T12:45:58.250Z","dependency_job_id":null,"html_url":"https://github.com/apache/couchdb-docker","commit_stats":{"total_commits":241,"total_committers":49,"mean_commits":4.918367346938775,"dds":0.7344398340248963,"last_synced_commit":"58910ed097489dc588b2a87592406f8faa1bdadf"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcouchdb-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcouchdb-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcouchdb-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcouchdb-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/couchdb-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247714631,"owners_count":20983914,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache","big-data","cloud","couchdb","cplusplus","database","erlang","http","javascript","network-client","network-server"],"created_at":"2024-08-01T12:01:33.956Z","updated_at":"2025-04-08T08:11:56.995Z","avatar_url":"https://github.com/apache.png","language":"Shell","readme":"# Semi-official Apache CouchDB Docker images\n\n## Available tags\n\nThere may be more tags available, but these tags should always exist:\n\n- `latest`: Always the latest version\n- `3`: The very latest CouchDB 3.x single node release (capable of running in a cluster)\n- `2`: The very latest CouchDB 2.x single node release (capable of running in a cluster)\n\nAs of this writing, the latest numbered tags available are:\n- `3.4.3`\n- `3.4.2`\n- `3.4.1`\n- `3.3.3`\n- `3.3.2`\n- `3.3.1`\n- `3.3.0`\n- `3.2.3`\n- `3.2.2`\n- `3.2.1`\n- `3.2.0`\n- `3.1.2`\n- `2.3.1`\n\n# How to use this image\n\nThe most up-to-date instructions on using this image are always available at https://github.com/apache/couchdb-docker/blob/main/README.md .\n\n## Start a CouchDB instance\n\nStarting a CouchDB instance is simple:\n\n```console\n$ docker run -d --name my-couchdb -e COUCHDB_USER=admin -e COUCHDB_PASSWORD=password %%IMAGE%%:tag\n```\n\nwhere `my-couchdb` is the name you want to assign to your container, and `tag` is the tag specifying the CouchDB version you want. See the list above for relevant tags.\n\n**As of CouchDB 3.0, an admin user and password is required for CouchDB startup.** Specify these on the command line as shown, or overlay your own ini file with a pre-defined admin user (see below).\n\n## Connect to CouchDB from an application in another Docker container\n\nThis image exposes the standard CouchDB port `5984`, so standard container linking will make it automatically available to the linked containers. Start your application container like this in order to link it to the CouchDB container:\n\n```console\n$ docker run --name my-couchdb-app --link my-%%REPO%%:%%REPO%% -d app-that-uses-couchdb\n```\n\n## Exposing CouchDB to the outside world\n\nIf you want to expose the port to the outside world, run\n\n```console\n$ docker run -p 5984:5984 -d %%IMAGE%%\n```\n\nIf you intend to network this CouchDB instance with others in a cluster, you will need to map additional ports; see the [official CouchDB documentation](http://docs.couchdb.org/en/stable/setup/cluster.html) for details.\n\n## Make a cluster\n\nStart your multiple CouchDB instances, then follow the Setup Wizard in the [official CouchDB documentation](http://docs.couchdb.org/en/stable/setup/cluster.html) to complete the process.\n\nFor a CouchDB cluster you need to provide the `NODENAME` setting as well as the\nErlang distribution cookie. The current version of this image allows the Erlang\ncookie to be set directly using the `COUCHDB_ERLANG_COOKIE` environment\nvariable. The contents of that environment variable will be written to\n`/opt/couchdb/.erlang.cookie` with the proper permissions. Previously one would\nneed to provide the `-setcookie` flag in the environment variable `ERL_FLAGS`,\ne.g. `ERL_FLAGS=-setcookie \"brumbrum\"`.\n\nBy default, this image exposes the `epmd` port `4369` and the Erlang cluster communication port `9100` (i.e. `inet_dist_listen_min` and `inet_dist_listen_max` are both 9100).\nFurther information can be found [here](http://docs.couchdb.org/en/stable/cluster/setup.html).\n\nThere is also a [Kubernetes helm chart](https://github.com/helm/charts/tree/master/incubator/couchdb) available.\n\n## Container shell access, `remsh`, and viewing logs\n\nThe `docker exec` command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your `%%REPO%%` container:\n\n```console\n$ docker exec -it my-%%REPO%% bash\n```\n\nIf you need direct access to the Erlang runtime:\n\n```console\n$ docker exec -it my-%%REPO%% /opt/couchdb/bin/remsh\n```\n\nThe CouchDB log is available through Docker's container log:\n\n```console\n$ docker logs my-%%REPO%%\n```\n\n## Configuring CouchDB\n\nThe best way to provide configuration to the `%%REPO%%` image is to provide a custom `ini` file to CouchDB, preferably stored in the `/opt/couchdb/etc/local.d/` directory. There are many ways to provide this file to the container (via short `Dockerfile` with `FROM` + `COPY`, via [Docker Configs](https://docs.docker.com/engine/swarm/configs/), via runtime bind-mount, etc), the details of which are left as an exercise for the reader.\n\nKeep in mind that run-time reconfiguration of CouchDB will overwrite the [last file in the configuration chain](http://docs.couchdb.org/en/stable/config/intro.html#configuration-files), and that this Docker container creates the `/opt/couchdb/etc/local.d/docker.ini` file at startup.\n\nCouchDB also uses `/opt/couchdb/etc/vm.args` to store Erlang runtime-specific changes. Changing these values is less common. If you need to change the epmd port, for instance, you will want to bind mount this file as well. (Note: files cannot be bind-mounted on Windows hosts.)\n\nIn addition, a few environment variables are provided to set very common parameters:\n\n* `COUCHDB_USER` and `COUCHDB_PASSWORD` will create an ini-file based local admin user with the given username and password in the file `/opt/couchdb/etc/local.d/docker.ini`.\n* `COUCHDB_SECRET` will set the CouchDB shared cluster secret value, in the file `/opt/couchdb/etc/local.d/docker.ini`.\n* `NODENAME` will set the name of the CouchDB node inside the container to `couchdb@${NODENAME}`, in the file `/opt/couchdb/etc/vm.args`. This is used for clustering purposes and can be ignored for single-node setups.\n* Erlang Environment Variables like `ERL_FLAGS` will be used by Erlang itself. For a complete list have a look [here](http://erlang.org/doc/man/erl.html#environment-variables)\n\n## Configure CouchDB Nouveau\n\nUsing the `couchdb:3.4-nouveau` image with `couchdb:3.4` container, there are additional configurations required to set the communication between the containers. CouchDB by default communicates with Nouveau at `http://localhost:5987`, which would now be running in a different container. To enable the communication, the CouchDB container should know the location of Nouveau location and enable the configuration. This can be done by puting following configuration file at `/opt/couchdb/etc/local.d/nouveau.ini` in the CouchDB container.\n\n```ini\n[nouveau]\nenable = true\nurl = http://couchdb-nouveau:5987\n```\n\n**Note:** Replace the location in the URL.\n\n# Caveats\n\n## Where to Store Data\n\nImportant note: There are several ways to store data used by applications that run in Docker containers. We encourage users of the `%%REPO%%` images to familiarize themselves with the options available, including:\n\n-\tLet Docker manage the storage of your database data [by writing the database files to disk on the host system using its own internal volume management](https://docs.docker.com/engine/tutorials/dockervolumes/#adding-a-data-volume). This is the default and is easy and fairly transparent to the user. The downside is that the files may be hard to locate for tools and applications that run directly on the host system, i.e. outside containers.\n-\tCreate a data directory on the host system (outside the container) and [mount this to a directory visible from inside the container](https://docs.docker.com/engine/tutorials/dockervolumes/#mount-a-host-directory-as-a-data-volume). This places the database files in a known location on the host system, and makes it easy for tools and applications on the host system to access the files. The downside is that the user needs to make sure that the directory exists, and that e.g. directory permissions and other security mechanisms on the host system are set up correctly.\n\nThe Docker documentation is a good starting point for understanding the different storage options and variations, and there are multiple blogs and forum postings that discuss and give advice in this area. We will simply show the basic procedure here for the latter option above:\n\n1. Create a data directory on a suitable volume on your host system, e.g. `/home/couchdb/data`.\n2. Start your `%%REPO%%` container like this:\n\n```bash\n$ docker run --name some-%%REPO%% -v /home/couchdb/data:/opt/couchdb/data -d %%IMAGE%%:tag\n```\n\nThe `-v /home/couchdb/data:/opt/couchdb/data` part of the command mounts the `/home/couchdb/data` directory from the underlying host system as `/opt/couchdb/data` inside the container, where CouchDB by default will write its data files.\n\n## No system databases until the installation is finalized\n\nPlease note that CouchDB no longer autocreates system databases for you, as it is not known at startup time if this is a single-node or clustered CouchDB installation. In a cluster, the databases must only be created once all nodes have been joined together.\n\nIf you use the [Cluster Setup Wizard](http://docs.couchdb.org/en/stable/setup/cluster.html#the-cluster-setup-wizard) or the [Cluster Setup API](http://docs.couchdb.org/en/stable/setup/cluster.html#the-cluster-setup-api), these databases will be created for you when you complete the process.\n\nIf you choose not to use the Cluster Setup wizard or API, you will have to create `_global_changes`, `_replicator` and `_users` manually.\n\n## Administrator user\n\n**CouchDB 3.0+ requires an admin user to start!**\n\nYou can use the two environment variables `COUCHDB_USER` and `COUCHDB_PASSWORD` to set up an admin user:\n\n```console\n$ docker run -e COUCHDB_USER=admin -e COUCHDB_PASSWORD=password -d %%IMAGE%%\n```\n\nNote that if you are setting up a clustered CouchDB, you will want to pre-hash this password and use the identical hashed text across all nodes to ensure sessions work correctly when a load balancer is placed in front of the cluster. Hashing can be accomplished by running the container with the `/opt/couchdb/etc/local.d` directory mounted as a volume, allowing CouchDB to hash the password you set, then copying out the hashed version and using this value in the future.\n\n## Using a persistent CouchDB configuration file\n\nThe CouchDB configuration is specified in `.ini` files in `/opt/couchdb/etc`. Take a look at the [CouchDB configuration documentation](http://docs.couchdb.org/en/stable/config/index.html) to learn more about CouchDB's configuration structure.\n\nIf you want to use a customized CouchDB configuration, you can create your configuration file in a directory on the host machine and then mount that directory as `/opt/couchdb/etc/local.d` inside the `%%REPO%%` container.\n\n```console\n$ docker run --name my-couchdb -v /home/couchdb/etc:/opt/couchdb/etc/local.d -d %%IMAGE%%\n```\n\nThe `-v /home/couchdb/etc:/opt/couchdb/etc/local.d` part of the command mounts the `/home/couchdb/etc` directory from the underlying host system as `/opt/couchdb/etc/local.d` inside the container, where CouchDB by default will write its dynamic configuration files.\n\nYou can also use `couchdb` as the base image for your own couchdb instance and provide your own version of the `local.ini` config file:\n\nExample Dockerfile:\n\n```dockerfile\nFROM %%IMAGE%%\n\nCOPY local.ini /opt/couchdb/etc/\n```\n\nand then build and run\n\n```console\n$ docker build -t you/awesome-couchdb .\n$ docker run -d -p 5984:5984 you/awesome-couchdb\n```\n\nRemember that, with this approach, any newly written changes will still appear in the `/opt/couchdb/etc/local.d` directory, so it is still recommended to map this to a host path for persistence.\n\n## Logging\n\nBy default containers run from this image only log to `stdout`. You can enable logging to file in the [configuration](http://docs.couchdb.org/en/2.1.0/config/logging.html).\n\nFor example in `local.ini`:\n\n```ini\n[log]\nwriter = file\nfile = /opt/couchdb/log/couch.log\n```\n\nIt is recommended to then mount this path to a directory on the host, as CouchDB logging can be quite voluminous.\n\n## Running under a custom UID\n\nBy default, CouchDB will run as the `couchdb` user with UID 5984. Running under a different UID is supported, so long as any volume mounts have appropriate read/write permissions. For example, assuming user `myuser` has write access to `/home/couchdb/data`, the following command will run CouchDB as that user:\n\n```\ndocker run --name my-couchdb --user myuser -v /home/couchdb/data:/opt/couchdb/data %%IMAGE%%:tag\n```\n\n\n-----\n\n# Development images\n\nThis repository provides definitions to run the very latest (`main` branch)\nCouchDB code:\n\n* `dev` runs a single node off of the `main` branch, similar to the other\n  officially released images.\n* `dev-cluster` demonstrates the CouchDB clustering features by creating a\n  local cluster of a default three nodes inside the container, with a proxy in\n  front.  This is great for testing clustering in your local environment.\n\nYou will need to build Docker images from the `dev` directory in this\nrepository; [Apache Software Foundation policy][4] prevents us from publishing\nnon-release builds for wide distribution.\n\nWhen launching the `dev-cluster` container, here is what you will see:\n\n```bash\n# expose the cluster to the world\n$ docker run -it -p 5984:5984 \u003cimage-hash\u003e\n\n[ * ] Setup environment ... ok\n[ * ] Ensure CouchDB is built ... ok\n[ * ] Prepare configuration files ... ok\n[ * ] Start node node1 ... ok\n[ * ] Start node node2 ... ok\n[ * ] Start node node3 ... ok\n[ * ] Check node at http://127.0.0.1:15984/ ... ok\n[ * ] Check node at http://127.0.0.1:25984/ ... ok\n[ * ] Check node at http://127.0.0.1:35984/ ... ok\n[ * ] Running cluster setup ... ok\n[ * ] Developers cluster is set up at http://127.0.0.1:15984.\nAdmin username: root\nPassword: 37l7YDQJ\nTime to hack! ...\n```\n**Note:** By default the cluster will be exposed on port `5984`, because it uses haproxy (passes `--with-haproxy` to `dev/run`) internally.\n\nYou can pass arguments to the binary:\n\n```bash\ndocker run -it \u003cimage-hash\u003e --admin=foo:bar\n```\n\n**Note:** This will overwrite the default `--with-haproxy` flag. The cluster **won't** be exposed on port `5984` anymore. The individual nodes listen on `15984`, `25984`, ...`x5984`. If you wish to expose the cluster on `5984`, pass `--with-haproxy` explicitly.\n\nMore examples for the `dev` image only:\n```bash\n# display the available options of the couchdb startup script\ndocker run --rm \u003cimage-hash\u003e --help\n\n# Start two nodes (without proxy) exposed on port 15984 and 25984\ndocker run -it -p 15984:15984 -p 25984:25984 \u003cimage-hash\u003e -n 2\n```\n\n# Image building for CouchDB release managers\n\nCheck out the `build.sh` script in the apache/couchdb-docker GitHub repository,\nwhich can build images for any version, even in a cross-platform way.\n\nAlso, read the next section to ensure you push all of the tags necessary.\n\n# Image uploading for CouchDB release managers\n\nTaking a hypothetical example of CouchDB 3.3.1 with 3.3.1 as the latest release:\n\n```bash\n./build.sh buildx 3.3.1\n./build.sh buildx 3.3.1 as 3.3\n./build.sh buildx 3.3.1 as 3\n./build.sh buildx 3.3.1 as latest\n\n./build.sh buildx 3.2.2\n./build.sh buildx 3.2.2 as 3.2\n```\n\nObviously don't create/push the `latest` or `2` tags if this is a maintenance\nbranch superceded by a newer one.\n\nTo see full build logs, export `PROGRESS_NO_TRUNC=1` and use `--progress\nplain` as an option to `docker build`.\n\nTo rebuild all Dockerfile steps without caching (so you can inspect the\nbuild log e.g.), use the `--no-cache` option of `docker build`.\n\n## Feedback, Issues, Contributing\n\nGeneral feedback is welcome at our [user][1] or [developer][2] mailing lists.\n\nApache CouchDB has a [CONTRIBUTING][3] file with details on how to get started\nwith issue reporting or contributing to the upkeep of this project. In short,\nuse GitHub Issues, do not report anything on Docker's website.\n\n## Non-Apache CouchDB Development Team Contributors\n\n- [@klaemo](https://github.com/klaemo)\n- [@joeybaker](https://github.com/joeybaker)\n- [@tianon](https://github.com/tianon)\n\n[1]: http://mail-archives.apache.org/mod_mbox/couchdb-user/\n[2]: http://mail-archives.apache.org/mod_mbox/couchdb-dev/\n[3]: https://github.com/apache/couchdb/blob/main/CONTRIBUTING.md\n[4]: http://www.apache.org/dev/release-distribution.html#unreleased\n","funding_links":[],"categories":["Dockerfile","database"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fcouchdb-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fcouchdb-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fcouchdb-docker/lists"}