Website Vidya
Linux & ServersStep-by-Step Guide

How to Install CouchDB on Ubuntu 24.04

Learn how to install couchdb on ubuntu 24.04 with official Apache repositories, standalone setup, Fauxton web dashboard, and REST API testing.

RR
Rajesh RayLead Systems Educator
Published:
5 min read
PDF Cheat Sheet
How to Install CouchDB on Ubuntu 24.04
AI Executive SummaryWebsiteVidya AI

5 min read

Learn how to install couchdb on ubuntu 24.04 with official Apache repositories, standalone setup, Fauxton web dashboard, and REST API testing.

Key Highlights
  • Prerequisites and Supported Releases
  • Step 1: Installing Dependencies and Importing the Apache CouchDB GPG Key
  • Step 2: Adding the Apache CouchDB Repository
Grounded in full engineering runbookWebsiteVidya AI Engine

Apache CouchDB is an open-source, document-oriented NoSQL database system renowned for its seamless multi-master sync capabilities, schema-free JSON document storage, and RESTful HTTP API.

Unlike traditional relational databases that use SQL, CouchDB communicates entirely over HTTP using standard JSON payloads, making it an ideal choice for offline-first web and mobile applications (using PouchDB), distributed microservices, and edge computing.

Ubuntu 24.04 LTS (Noble Numbat) provides an ideal enterprise hosting environment for CouchDB when paired with official upstream repositories provided by the Apache Software Foundation.

In this guide, we walk through how to install couchdb on ubuntu 24.04, choose between standalone and clustered deployment modes, configure administrative credentials, and interact with the database through both the Fauxton web interface and terminal REST calls.

Advertisement

Prerequisites and Supported Releases

This guide is thoroughly verified on Ubuntu 24.04 LTS (Noble Numbat) & Ubuntu 22.04 LTS. The instructions apply cleanly to cloud instances (AWS EC2, Google Compute Engine, DigitalOcean, Hetzner), bare-metal servers, and local virtual machines.

Before proceeding, ensure you have the following requirements satisfied:

  • A server running Ubuntu 24.04 LTS or Ubuntu 22.04 LTS.
  • A non-root user account with sudo administrative privileges.
  • UFW firewall installed.
  • Basic familiarity with JSON and RESTful HTTP requests.

Step 1: Installing Dependencies and Importing the Apache CouchDB GPG Key

To ensure you deploy the latest stable release of Apache CouchDB with upstream security patches, configure the official Apache CouchDB APT repository.

Advertisement

First, install prerequisite packages for repository management and cryptographic key verification:

Import the official Apache CouchDB GPG key into your system's trusted keyrings directory:

# Update package index and install prerequisites:
sudo apt update
sudo apt install -y curl apt-transport-https gnupg lsb-release

# Import official CouchDB repository signing key:
curl -fsSL https://couchdb.apache.org/repo/keys.asc | sudo gpg --dearmor -o /usr/share/keyrings/couchdb-archive-keyring.gpg

Step 2: Adding the Apache CouchDB Repository

With the cryptographic signing key safely in place, add the official repository definition file to /etc/apt/sources.list.d/couchdb.list.

Reference your active Ubuntu release codename (such as noble for 24.04 or jammy for 22.04):

Advertisement

Update your local package lists to incorporate CouchDB packages:

# Add CouchDB repository definition:
echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/couchdb.list

# Refresh APT cache:
sudo apt update

Step 3: Installing CouchDB via APT with Debconf Prompts

Install the couchdb package using apt.

During installation, the Debian package configuration wizard (debconf) presents several interactive configuration prompts:

Follow these guidelines to configure your installation:

# Launch CouchDB package installation:
sudo apt install -y couchdb

# Follow the on-screen terminal configuration prompts.

# Verify CouchDB service status:
sudo systemctl status couchdb
# Expected output confirms:
# Active: active (running)
Debconf PromptRecommended ValueTechnical Explanation
General type of CouchDB configurationstandaloneSelect standalone for single-node servers; select clustered for multi-node deployments
CouchDB interface bind address127.0.0.1 (or 0.0.0.0)Use 127.0.0.1 for local reverse proxy setups; use 0.0.0.0 to allow external network access
Set CouchDB admin passwordYourStrongPasswordSets administrative password for the 'admin' user account

Step 4: Verifying Installation via the REST API

CouchDB listens by default on port 5984.

Because CouchDB is fundamentally an HTTP server, verify its operation by executing a GET request against the root endpoint using curl:

Review the JSON greeting returned by the database engine:

# Query CouchDB root API endpoint:
curl http://127.0.0.1:5984/

# Expected JSON response:
# {
#   "couchdb": "Welcome",
#   "version": "3.3.3",
#   "git_sha": "...",
#   "uuid": "...",
#   "features": [
#     "access-ready",
#     "partitioned",
#     "pluggable-storage-engines",
#     "reshard",
#     "scheduler"
#   ],
#   "vendor": {
#     "name": "The Apache Software Foundation"
#   }
# }

Step 5: Accessing the Fauxton Web Dashboard

CouchDB includes a built-in web-based management dashboard called Fauxton.

Fauxton allows administrators to create databases, manage documents, write MapReduce views, and monitor system metrics visually.

If CouchDB is bound to 127.0.0.1 on a remote server, establish an SSH port-forwarding tunnel from your local computer:

Open your browser and navigate to the Fauxton URL:

# Establish SSH port forward from your local terminal:
ssh -L 5984:127.0.0.1:5984 username@YOUR_SERVER_IP

# Open your local web browser and visit:
# http://127.0.0.1:5984/_utils/

# Log in using the administrator credentials created in Step 3:
# Username: admin
# Password: YourStrongPassword

Step 6: Creating Your First Database and Storing Documents

You can manage CouchDB entirely from the command line using standard HTTP methods (PUT, POST, GET, DELETE).

Create a new database named app_users with administrative authentication:

Insert a sample JSON document and retrieve it using curl:

# Create a database named 'app_users':
curl -X PUT http://admin:[email protected]:5984/app_users
# Response: {"ok":true}

# Insert a JSON document:
curl -X POST http://admin:[email protected]:5984/app_users \
  -H "Content-Type: application/json" \
  -d '{"name": "John Doe", "role": "developer", "active": true}'
# Response: {"ok":true,"id":"a1b2c3d4...","rev":"1-e5f6..."}

# List all databases on the server:
curl -X GET http://admin:[email protected]:5984/_all_dbs
# Response: ["_users","_replicator","app_users"]

Troubleshooting and Common Errors

When configuring Ubuntu servers, unexpected permission errors, network timeouts, or lock contention can occur. Review these common issues and verified resolutions:

curl: (7) Failed to connect to 127.0.0.1 port 5984: Connection refused

Cause: CouchDB service is stopped or failed to bind to the network socket.

Resolution: Check service health with sudo systemctl status couchdb and inspect /var/log/couchdb/couch.log.

sudo journalctl -u couchdb --no-pager -n 50

HTTP 401 Unauthorized: You are not authorized to access this db

Cause: Attempting to perform administrative actions without providing valid basic authentication credentials.

Resolution: Include admin:password@ in the URL: curl http://admin:[email protected]:5984/_all_dbs.

curl -u admin http://127.0.0.1:5984/_all_dbs

Cannot access Fauxton web interface from remote browser

Cause: CouchDB is bound exclusively to 127.0.0.1 and port 5984 is blocked by UFW.

Resolution: Use an SSH tunnel (ssh -L 5984:127.0.0.1:5984 user@server) or configure an Nginx reverse proxy with SSL.

sudo ss -tulpn | grep 5984

Security Best Practices and Hardening

Never leave CouchDB in 'Admin Party' mode (without an administrator password); always enforce authentication on port 5984.

Do not expose port 5984 directly to the public internet; terminate SSL through Nginx or Caddy and proxy traffic to localhost.

Store encrypted CouchDB backups of the data directory located at /var/lib/couchdb/ on an offsite storage volume.

Deepen your Linux system administration skills with our related production-tested guides:

Authoritative References and Official Documentation

Frequently Asked Questions

Quick answers to common questions and configurations

4 FAQs
CouchDB uses Multi-Version Concurrency Control (MVCC). Every time a document is updated, CouchDB assigns a new revision ID (_rev). Updates must include the previous revision ID to prevent conflicting concurrent writes.
Both store JSON-like documents, but CouchDB uses standard HTTP/REST for all operations, making it uniquely suited for web-direct access. CouchDB also excels at bi-directional multi-master replication with mobile devices via PouchDB, whereas MongoDB relies on a binary protocol and replica sets with single primary nodes.
Yes. CouchDB has built-in clustering capabilities (based on Dynamo principles) that shard databases across multiple nodes and automatically replicate data for fault tolerance and high availability.
CouchDB stores its database files, views, and index data inside /var/lib/couchdb/, owned by the couchdb:couchdb system user.
RR
Written byVerified Author

Rajesh Ray

I’m Rajesh Rai, a full-stack developer, Linux administrator, and technology enthusiast passionate about making complex technology easier to understand and use.

SPAM-FREE MODERATED DISCOURSE

Join the Conversation & Perspective

Have thoughts, counterpoints, or reflections on this story? Engage directly with fellow readers and editorial contributors.

AT
MP
JV
+2

No comments on this guide yet. Be the first to share your thoughts or ask a question!

Recommended Reading10 Guides

Related Technical Guides

Tested runbooks, server administration walkthroughs, and troubleshooting guides

Featured Infrastructure PartnerUp to 75% OFF + 3 Months Free

Supercharge Your Linux & Cloud Workloads with Hostinger

Deploy high-speed NVMe KVM VPS, Docker containers, and LiteSpeed-accelerated WordPress servers in under 60 seconds with full root access, dedicated IPv4, and 24/7 technical support.

Pure NVMe SSD StorageFull Root Access & SSHFree Domain & Unlimited SSL99.9% Uptime SLA
Plans from$2.99/mo
Claim Hostinger DealAffiliate link • Special discount applied at checkout