Couchbase is a distributed NoSQL database combining key-value and document-store functionality with a memory-first architecture for fast reads. This guide deploys a multi-node Couchbase cluster on Ubuntu 22.04 over a private network, fronts it with an Nginx reverse proxy, loads a sample dataset, runs N1QL queries, and sets up monitoring.
Prerequisites: a main Couchbase server (4GB RAM min) plus at least 2 additional nodes (4GB RAM min each), all attached to the same private network, a domain A record pointing at the main server (e.g.
couchbase.example.com).
Install Couchbase
Run on the main server first, then repeat on each node.
$ ssh linuxuser@SERVER-IP
$ curl -O https://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-noarch.deb
$ sudo dpkg -i ./couchbase-release-1.0-noarch.deb
$ sudo apt-get update
$ sudo apt-get install couchbase-server-community
$ service couchbase-server status
Identify the private network interface and allow traffic on it:
$ ip a
Note the interface carrying your private-network IP (e.g. enp8s0), then:
$ sudo ufw allow in on enp8s0
Repeat the full install on every node before continuing.
Configure Nginx as a Reverse Proxy
Couchbase nodes talk to each other over private addresses; Nginx on the main server proxies external access without exposing backend ports directly.
$ sudo apt install nginx -y
$ sudo rm /etc/sites-enabled/default
$ sudo nano /etc/nginx/conf.d/couchbase.conf
server {
listen 80;
server_name couchbase.example.com;
location / {
proxy_pass http://127.0.0.1:8091;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Couchbase Node 1
location /node1 {
proxy_pass http://10.50.96.3:8091;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Couchbase Node 2
location /node2 {
proxy_pass http://10.50.96.5:8091;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Replace the node IPs with your actual private addresses. / proxies to the main server; /node1, /node2 proxy to each additional node.
$ sudo nginx -t
$ sudo systemctl restart nginx
$ sudo ufw allow 80/tcp
$ sudo ufw reload
Create the Cluster
Visit http://couchbase.example.com:
- Setup New Cluster — cluster name, admin username, strong password.
- Next: Accept Terms.
- Check the terms checkbox, Finish with Defaults.
Add Nodes to the Cluster
For each node, via its Nginx proxy path (e.g. http://couchbase.example.com/node1):
- Join Existing Cluster.
- Enter the main server's private IP as Cluster Host Name/IP Address, plus the admin username/password.
- Join Cluster.
- Back on the main server: Servers → Rebalance, wait for
Rebalance Completed Successfully.
Repeat for every node.
Load a Sample Dataset
Couchbase ships 3 sample datasets.
-
Buckets → sample bucket (in the
ADD BUCKETnotification). - Check travel-sample, Load Sample Data.
Inspect the Data
-
Buckets → Documents next to
travel-sampleto browse records. -
Buckets →
travel-sample→ Scopes & Collections to see theinventoryscope and its collections, with per-collection document counts and memory/disk usage.
Run a Query
Couchbase uses N1QL (SQL-like) for querying documents.
- Query, paste:
SELECT name FROM `travel-sample`.inventory.hotel WHERE type = "hotel" AND city = "Paris" AND free_parking = true LIMIT 5;
- Execute — results return as JSON, 5 matching hotel names.
Monitoring
- Dashboard — Cluster Overview for active process stats, Node Resources for CPU/request-rate/memory per node.
- Build a custom dashboard: Choose Dashboard → new dashboard, name it, Save.
-
Add a Chart → combine node data + multiple stats per chart → pick stats (e.g.
Available RAM,Swap Usedunder one tab,Query Execution TimeandQueries > 500msunder Query) → Save Chart.
Next Steps
Couchbase is running as a multi-node cluster over your private network, proxied through Nginx, with sample data loaded and query access confirmed. From here:
- Set up XDCR (cross-datacenter replication) for multi-region durability
- Configure bucket-level replica counts for higher availability
- Explore the Couchbase SDKs to connect application code instead of the web console
For the full guide, visit the original article on Vultr Docs.
Top comments (0)