---
title: Deploy Apache CouchDB with AI on Blossom
url: "/deploy/apache-couchdb/"
canonical_url: https://blossom88.com/deploy/apache-couchdb/
markdown_url: https://blossom88.com/deploy/apache-couchdb.md
summary: Replicate JSON documents between two private databases with scoped access.
categories:
- deployment
- databases
stack:
- CouchDB
- Erlang
- JSON
---

# Deploy Apache CouchDB with AI on Blossom

[Apache CouchDB](https://couchdb.apache.org/) stores JSON documents and
can synchronize their revisions between databases. This recipe replicates
a checklist between two databases on one private CouchDB Service.

## Ask Your Agent

> **Ask your AI agent:** Deploy Apache CouchDB on Blossom and help me replicate a sample checklist.
>
> Follow this guide: https://blossom88.com/deploy/apache-couchdb/

[Install the Blossom CLI and skill](https://docs.blossom88.com/learn/getting-started/install/) on your agent's machine and [choose a Location in your cloud account](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#connect-your-provider).

## How It Runs

| Part | Role | Where |
|---|---|---|
| CouchDB | Store the source and replica databases | Private Persistent Service |
| HTTP client | Run the sample document replication | Blossom Job |

## Deploy Apache CouchDB

Use the [official image](https://docs.couchdb.org/en/stable/install/docker.html)
and configure it as a private single node. Create a stable administrator
password and use a [Persistent Service Volume](/docs/apps/persistent-services/).
CouchDB is distributed under the [Apache 2.0 license](https://github.com/apache/couchdb/blob/main/LICENSE).

<details class="optional-reading" markdown="1">
<summary>Notes for your agent</summary>

Set `single_node = true` and use a single replica for the sample databases.
Mount the Volume at `/opt/couchdb/data`. Run the HTTP client on the private
network and connect on port `5984`.

    blossom environment:deploy --id environment-100 --follow

</details>

## Replicate the Checklist

Create a source and replica database. Add one user as a member of
both using their [database security settings](https://docs.couchdb.org/en/stable/api/database/security.html).
Sign in as that user to write two checklist documents and start
replication through the [replication API](https://docs.couchdb.org/en/stable/replication/intro.html).

> **Ask your AI agent:** Help me replicate two checklist documents with a scoped CouchDB user and check that another account cannot read them.

> Follow this guide: https://blossom88.com/deploy/apache-couchdb/



![Replicate the first two checklist documents.](/deploy/assets/images/apache-couchdb/initial-document-replication.webp)

## Replicate a Change After an Update

Replace the database Container. Reopen both copies of the checklist,
mark one item done in the source, and replicate the new revision.

> **Ask your AI agent:** Check my two checklist documents after replacement, then mark one done and replicate that change.

> Follow this guide: https://blossom88.com/deploy/apache-couchdb/



![Replicate one changed revision after replacement.](/deploy/assets/images/apache-couchdb/replicate-a-change.webp)

## What You Get

A private document database with a working example of scoped access
and incremental replication.

## What You Get

- A private Apache CouchDB Service
- Two databases with access scoped to one user
- A checklist that can replicate a new revision after an update

Tested on Blossom: A scoped user replicated two documents, reopened them after replacement, and replicated one new revision.
