Skip to content

How to Deploy Couchbase

Introduction

Couchbase is an open-source NoSQL database. Deploying Couchbase on Klutch.sh provides scalable, secure infrastructure for your data, with support for persistent storage and automated CI/CD.


Prerequisites

  • A Klutch.sh account (sign up here)
  • A GitHub repository for your Couchbase deployment
  • Basic knowledge of Docker and NoSQL database concepts

1. Prepare your Couchbase repository

  • Fork or clone the Couchbase repository, or create a wrapper repo for your customizations.
  • Store database and configuration files outside the Git repo; use persistent volumes or object storage and mount or fetch them at runtime.

Refer to the Klutch.sh Quick Start Guide for repository setup and GitHub integration.


2. Deploy without a Dockerfile

  • Connect your GitHub repo to Klutch.sh and select the Couchbase service.
  • Configure build settings and environment variables for your deployment.
  • Set up persistent volumes for database and configuration.

3. Deploy with a Dockerfile

Sample Dockerfile:

FROM couchbase/server:latest
COPY . /app/
  • Map persistent volumes for database and configuration:
    • /app/data
    • /app/config

4. Persistent Storage

  • Use Klutch.sh volumes for database and configuration files.
  • Example volume mapping:
    • /app/data:/data/data
    • /app/config:/data/config

5. Environment Variables

  • Configure Couchbase settings via environment variables:
    • DB_HOST
    • DB_DATABASE
    • DB_USERNAME
    • DB_PASSWORD

6. Scaling and Production

  • Scale deployment by increasing replica count in Klutch.sh.
  • Monitor logs and resource usage.
  • Use persistent storage for database and configuration.

Resources