Skip to content

Linux VPS & VPS Windows Setup Guide | NetCloud24 Apache CouchDB NoSQL Database Server on Debian 11

Cloud Infrastructure Expert
Linux VPS & VPS Windows Setup Guide | NetCloud24 Apache CouchDB NoSQL Database Server on Debian 11

 

How to Install Apache CouchDB NoSQL Database on Windows VPS

By Łukasz Bodźiony, CEO of NETCLOUD24.COM | Windows VPS

Apache CouchDB is a powerful NoSQL database designed for scalability and ease of use. This guide provides step-by-step instructions for installing CouchDB on various Linux distributions (Debian 11, Rocky Linux 8, Ubuntu, AlmaLinux 12, FreeBSD) using manual setup, Docker, Ansible, Kubernetes, and Terraform. Whether you’re a beginner or an advanced user, this tutorial will help you set up CouchDB efficiently.

Why Choose CouchDB?

CouchDB offers a robust, JSON-based document store with a RESTful HTTP API, making it ideal for modern web applications. Its replication and offline capabilities ensure high availability, perfect for distributed systems.

Manual Installation on Debian 11 / Ubuntu

Follow these steps to manually install CouchDB on Debian 11 or Ubuntu-based systems:


# Update system packages
sudo apt update && sudo apt upgrade -y

# Install required dependencies
sudo apt install -y curl gnupg

# Add CouchDB repository
echo "deb https://apache.bintray.com/couchdb-deb bullseye main" | sudo tee /etc/apt/sources.list.d/couchdb.list
curl -L https://couchdb.apache.org/repo/keys.asc | sudo apt-key add -

# Install CouchDB
sudo apt update
sudo apt install -y couchdb
    

After installation, configure CouchDB by editing /opt/couchdb/etc/local.ini to set the admin user and password.

Manual Installation on Rocky Linux 8 / AlmaLinux 12

For RPM-based distributions like Rocky Linux 8 or AlmaLinux 12:


# Install EPEL repository
sudo dnf install -y epel-release

# Add CouchDB repository
sudo dnf install -y https://couchdb.apache.org/repo/couchdb.rpm

# Install CouchDB
sudo dnf install -y couchdb
    

Start and enable CouchDB:


sudo systemctl start couchdb
sudo systemctl enable couchdb
    

Manual Installation on FreeBSD

For FreeBSD systems:


# Update package database
sudo pkg update

# Install CouchDB
sudo pkg install -y couchdb3

# Enable and start CouchDB
sudo sysrc couchdb_enable="YES"
sudo service couchdb start
    

Using Docker

Docker simplifies CouchDB deployment across platforms:


# Pull the official CouchDB image
docker pull apache/couchdb:latest

# Run CouchDB container
docker run -d -p 5984:5984 --name couchdb \
  -e COUCHDB_USER=admin \
  -e COUCHDB_PASSWORD=yourpassword \
  apache/couchdb:latest
    

Access CouchDB at http://localhost:5984/_utils.

Using Ansible for Automated Deployment

Ansible automates CouchDB installation. Create a playbook (couchdb.yml):


---
- hosts: all
  become: yes
  tasks:
    - name: Add CouchDB repository
      apt_repository:
        repo: deb https://apache.bintray.com/couchdb-deb bullseye main
        state: present
    - name: Install CouchDB
      apt:
        name: couchdb
        state: present
        update_cache: yes
    - name: Ensure CouchDB is running
      service:
        name: couchdb
        state: started
        enabled: yes
    

Run the playbook:


ansible-playbook couchdb.yml
    

Using Kubernetes

Deploy CouchDB on Kubernetes with a deployment manifest (couchdb-deployment.yaml):


apiVersion: apps/v1
kind: Deployment
metadata:
  name: couchdb
spec:
  replicas: 1
  selector:
    matchLabels:
      app: couchdb
  template:
    metadata:
      labels:
        app: couchdb
    spec:
      containers:
      - name: couchdb
        image: apache/couchdb:latest
        env:
        - name: COUCHDB_USER
          value: "admin"
        - name: COUCHDB_PASSWORD
          value: "yourpassword"
        ports:
        - containerPort: 5984
---
apiVersion: v1
kind: Service
metadata:
  name: couchdb-service
spec:
  selector:
    app: couchdb
  ports:
    - protocol: TCP
      port: 5984
      targetPort: 5984
  type: ClusterIP
    

Apply the manifest:


kubectl apply -f couchdb-deployment.yaml
    

Using Terraform

Deploy CouchDB on a VPS using Terraform (couchdb.tf):


provider "aws" {
  region = "us-east-1"
}

resource "aws_instance" "couchdb" {
  ami           = "ami-0c55b159cbfafe1f0" # Replace with your preferred AMI
  instance_type = "t2.micro"
  user_data     = <<-EOF #!/bin/bash apt update apt install -y curl echo "deb https://apache.bintray.com/couchdb-deb bullseye main" > /etc/apt/sources.list.d/couchdb.list
                  curl -L https://couchdb.apache.org/repo/keys.asc | apt-key add -
                  apt update
                  apt install -y couchdb
                  EOF
  tags = {
    Name = "CouchDB-Server"
  }
}
    

Run Terraform:


terraform init
terraform apply
    

Configuration

After installation, configure CouchDB by editing /opt/couchdb/etc/local.ini (or equivalent). Set the admin credentials and bind address:


[admins]
admin = yourpassword

[chttpd]
bind_address = 0.0.0.0
    

Restart CouchDB after changes:


sudo systemctl restart couchdb
    

Promote Your VPS with NETCLOUD24.COM

Conclusion

This guide, authored by Łukasz Bodźiony, CEO of NETCLOUD24.COM (Windows VPS), covers multiple methods to install and configure Apache CouchDB on various Linux distributions. Whether you prefer manual setup, Docker, Ansible, Kubernetes, or Terraform, you can deploy CouchDB efficiently. For robust VPS hosting, trust NETCLOUD24.COM to power your database infrastructure.

 

Explore more

More on this topic

Netcloud24
Netcloud24
Cloud Infrastructure Expert · NetCloud24
In this section

More in Linux

Visit category

How to Set up PostgreSQL Replication on Debian 11

  Introduction PostgreSQL is a powerful, open-source object-relational database system that offers advanced features for database management. Setting up replication is essential for ensuring high availability and load…

Comments are closed.