Install and Use CouchDB on Ubuntu 24.04

By Raman Kumar

Updated on Jul 15, 2025

Learn how to install CouchDB on Ubuntu 24.04 and start using it as a powerful NoSQL database. Our step-by-step guide covers installation, configuration.

What is CouchDB?

CouchDB is an open-source NoSQL database designed to store and manage large amounts of data using a document-oriented approach. Unlike traditional relational databases, CouchDB stores data as JSON documents, making it highly flexible and scalable. One of the standout features of CouchDB is its support for multi-master replication, allowing distributed systems to synchronize seamlessly across different environments or servers.

CouchDB is well-suited for modern web applications, mobile backends, and any project where data needs to be highly available and easy to scale. Its RESTful HTTP API makes it easy for developers to interact with the database using standard web requests, and its built-in web interface (Fauxton) provides an accessible way to manage and visualize data.

Prerequisites

Before we begin, let’s ensure our environment meets the following requirements:

  • A Ubuntu 24.04 installed dedicated server or KVM VPS.
  • A non-root user with sudo privileges.
  • Basic knowledge of using the terminal.

How to Install and Use CouchDB on Ubuntu 24.04 – Step-by-Step NoSQL Database Guide

Step 1: Update System Packages

We always start by ensuring our system packages are up-to-date. This helps avoid conflicts and ensures we get the latest versions.

sudo apt update
sudo apt upgrade -y

Step 2: Install CouchDB

CouchDB is available in the official Ubuntu repositories, but for the most up-to-date version, we can use the official Apache CouchDB repository.

sudo apt update && sudo apt install -y curl apt-transport-https gnupg

2.1. Import the Apache GPG Key

curl https://couchdb.apache.org/repo/keys.asc | gpg --dearmor | sudo tee /usr/share/keyrings/couchdb-archive-keyring.gpg >/dev/null 2>&1 
source /etc/os-release

2.2. Add the CouchDB Repository

echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ ${VERSION_CODENAME} main" | sudo tee /etc/apt/sources.list.d/couchdb.list >/dev/null

2.3. Install CouchDB

sudo apt update
sudo apt install couchdb -y

Step 3: Configure CouchDB

During installation, CouchDB will prompt us to choose the type of setup:

  • Standalone (single-server)
  • Clustered (multiple nodes)

For most personal and small business uses, Standalone is perfect.

We also need to set the bind address. By default, it is 127.0.0.1 (localhost), which is secure. If we want CouchDB to be accessible from other machines, we can change this to 0.0.0.0 and set up a firewall for safety.

Step 4: Start and Enable CouchDB Service

To make sure CouchDB starts automatically on boot:

sudo systemctl enable couchdb
sudo systemctl start couchdb

We can check the status with:

sudo systemctl status couchdb

Step 5: Access CouchDB Web Interface (Fauxton)

CouchDB comes with a built-in web-based dashboard called Fauxton.

We can access it by visiting:

http://127.0.0.1:5984/_utils/

Login with the admin username and password set during installation.

Step 6: Basic CouchDB Usage

Now that CouchDB is up and running, let’s cover some essential operations.

6.1. Create a Database

We can create a new database using Fauxton or with a simple curl command:

curl -X PUT http://admin:password@127.0.0.1:5984/mydatabase

Replace admin:password with the actual credentials.

6.2. Insert a Document

To insert data (a document):

curl -X POST http://admin:password@127.0.0.1:5984/mydatabase \
  -H "Content-Type: application/json" \
  -d '{"name":"John Doe", "email":"john@example.com"}'

6.3. Fetch a Document

To fetch all documents:

curl http://admin:password@127.0.0.1:5984/mydatabase/_all_docs?include_docs=true

6.4. Update a Document

First, get the document’s _id and _rev. Then use:

curl -X PUT http://admin:password@127.0.0.1:5984/mydatabase/<document_id> \
  -H "Content-Type: application/json" \
  -d '{"_id": "<document_id>", "_rev": "<rev>", "name": "Jane Doe", "email": "jane@example.com"}'

6.5. Delete a Document

curl -X DELETE http://admin:password@127.0.0.1:5984/mydatabase/<document_id>?rev=<rev>

Step 7: Security Best Practices

  • Always use strong admin passwords.
  • Keep the bind address as 127.0.0.1 unless remote access is required.
  • Set up a firewall (ufw) to restrict external access.
  • Regularly back up CouchDB data using built-in replication or scheduled backups.

Step 8: Common Use Cases for CouchDB

  • Modern web and mobile apps: Offline-first data sync.
  • IoT data storage: Flexible JSON storage for sensor data.
  • Content management systems: Easy to scale and replicate.
  • Analytics and reporting: Powerful map/reduce queries.

Why Choose CouchDB?

We recommend CouchDB when we need a reliable NoSQL solution that can:

  • Handle dynamic, schema-less data.
  • Sync easily across devices and locations.
  • Scale horizontally without complex setup.
  • Support both local and cloud-based deployments.

Conclusion

CouchDB is a powerful and flexible NoSQL database solution for modern applications. With this guide, we can quickly install CouchDB on Ubuntu 24.04, set it up securely, and start working with data using both the Fauxton web interface and REST API. By leveraging CouchDB, we are building for scalability, reliability, and modern web development trends.

For more advanced features, we can explore CouchDB’s clustering, real-time change feeds, and integrations with frontend frameworks. As our needs grow, CouchDB grows with us.