Supported tags and respective
For more information about this image and its history, please see the relevant manifest file (
library/couchdb). This image is updated via pull requests to the
docker-library/official-images GitHub repo.
What is Apache CouchDB?
CouchDB comes with a suite of features, such as on-the-fly document transformation and real-time change notifications, that makes web app development a breeze. It even comes with an easy to use web administration console. You guessed it, served up directly out of CouchDB! We care a lot about distributed scaling. CouchDB is highly available and partition tolerant, but is also eventually consistent. And we care a lot about your data. CouchDB has a fault-tolerant storage engine that puts the safety of your data first.
How to use this image
Start a CouchDB instance
$ docker run -d --name my-couchdb couchdb
This image includes
EXPOSE 5984 (the CouchDB port), so standard container linking will make it automatically available to the linked containers.
Using the instance
In order to use the running instance from an application, link the container
$ docker run --name my-couchdb-app --link my-couchdb:couch couchdb
See the official docs for infomation on using and configuring CouchDB.
Exposing the port to the outside world
If you want to expose the port to the outside world, run
$ docker run -p 5984:5984 -d couchdb
CouchDB listens on port 5984 for requests and the image includes
EXPOSE 5984. The flag
-p 5984:5984 exposes this port on the host.
There are several ways to store data used by applications that run in Docker containers. We encourage users of the
couchdb images to familiarize themselves with the options available, including:
- Let 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. 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.
- Create a data directory on the host system (outside the container) and mount this to a directory visible from inside the container. 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.
/usr/local/var/lib/couchdb to store its data. This directory is marked as a docker volume.
Using host directories
You can map the container's volumes to a directory on the host, so that the data is kept between runs of the container. This example uses your current directory, but that is in general not the correct place to store your persistent data!
$ docker run -d -v $(pwd):/usr/local/var/lib/couchdb --name my-couchdb couchdb
Using your own CouchDB configuration file
The CouchDB configuration is specified in
.ini files in
/usr/local/etc/couchdb. Take a look at the CouchDB configuration documentation to learn more about CouchDBs configuration structure.
If 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
/usr/local/etc/couchdb/local.d inside the
$ docker run --name my-couchdb -v /my/custom-config-dir:/usr/local/etc/couchdb/local.d -d couchdb
You can also use
couchdb as the base image for your own couchdb instance and provie your own version of the
local.ini config file:
FROM couchdb:latest COPY local.ini /usr/local/etc/couchdb/
and then build and run
$ docker build -t you/awesome-couchdb . $ docker run -d -p 5984:5984 you/awesome-couchdb
By default containers run from this image only log to
stdout. This means that the
/_log endpoint is not available. You can enable logging to file in the configuration.
For example in
[log] file = /usr/local/var/log/couchdb/couch.log
Apache CouchDB is licensed under the Apache License.
Supported Docker versions
This image is officially supported on Docker version 1.10.2.
Support for older versions (down to 1.6) is provided on a best-effort basis.
Please see the Docker installation documentation for details on how to upgrade your Docker daemon.
Docker, Inc is the company behind the open source Docker platform and the growing Docker ecosystem of contributors, partners and adopters revolutionizing the way distributed applications are built, shipped, and run.
Copyright (c) 2014-2015 Docker, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.