In this tutorial, you will learn how to install Couchbase Server on Debian 11/Debian 10. According to the documentation, Couchbase Server is an open source, distributed, JSON document database. It exposes a scale-out, key-value store with managed cache for sub-millisecond data operations, purpose-built indexers for efficient queries, and a powerful query engine for executing SQL-like queries.
Install Couchbase Server on Debian 11/Debian 10
Couchbase is available in different editions; Enterprise, Community and Couchbase Capella.
This guide is about how to install the community edition couch base server.
System Requirements
Before you can proceed to install Couchbase Server on Debian, there are some few requirements needed;
- check the minimum system resource requirements.
- Disable Transparent hugepages. This can easily be done by creating a system service.
cat > /etc/systemd/system/disable_thp.service << 'EOL'
[Unit]
Description=Disable Kernel Support for Transparent Huge Pages (THP)
[Service]
Type=simple
ExecStart=/bin/sh -c "echo 'never' > /sys/kernel/mm/transparent_hugepage/enabled && echo 'never' > /sys/kernel/mm/transparent_hugepage/defrag"
[Install]
WantedBy=multi-user.target
EOL
systemctl daemon-reload
systemctl enable --now disable_thp
- Disable Swapiness
echo 'vm.swappiness=0' > /etc/sysctl.conf
sysctl -p
Next, proceed to install Couchbase Server.
There are different ways in which you can install Couchbase server;
Install Couchbase Server on Debian using APT via Couchbase repositories
On Debian 10 Buster;
- To install Install Couchbase Server on Debian via APT, you first need to install Couchbase repositories;
wget https://packages.couchbase.com/releases/couchbase-release/couchbase-release-1.0-amd64.deb
apt install ./couchbase-release-1.0-amd64.deb
- Next, run system package cache update;
apt update
- Install Couchbase server on Debian 10
apt install couchbase-server-community
On Debian 11;
- Currently, Debian 11 is not supported, as of this writing. Thus, we will use Debian 10 Repos instead!
- Therefore, install Debian 10 Couchbase repos on Debian 11;
echo 'deb [ arch=amd64 ] http://packages.couchbase.com/releases/couchbase-server/community/deb/ buster buster/main' \
> /etc/apt/sources.list.d/couchbase.list
- Install repository signing key;
wget -qO- http://packages.couchbase.com/ubuntu/couchbase.key | gpg --dearmor > /etc/apt/trusted.gpg.d/couchbase.gpg
- Run system update;
apt update
- Install Couchbase on Debian 11
apt install couchbase-server-community
Sample installation output;
Preparing to unpack .../couchbase-server-community_7.0.2-6703-1_amd64.deb ...
Minimum RAM required : 4 GB
System RAM configured : 1.95 GB
Minimum number of processors required : 4 cores
Number of processors on the system : 2 cores
Unpacking couchbase-server-community (7.0.2-6703-1) ...
Setting up couchbase-server-community (7.0.2-6703-1) ...
You have successfully installed Couchbase Server.
Please browse to http://debian:8091/ to configure your server.
Refer to https://docs.couchbase.com for additional resources.
Please note that you have to update your firewall configuration to
allow external connections to a number of network ports for full
operation. Refer to the documentation for the current list:
https://docs.couchbase.com/server/7.0/install/install-ports.html
By using this software you agree to the End User License Agreement.
See /opt/couchbase/LICENSE.txt.
Created symlink /etc/systemd/system/multi-user.target.wants/couchbase-server.service → /lib/systemd/system/couchbase-server.service.
Install using DEB Binary Package
To install Couchbase Server on Debian via DEB binary package, navigate to the Couchbase downloads page and select the appropriate package of Couchbase Server to install and grab the link for the DEB binary package.
For example, the command below downloads version 7.0.2 of Couchbase server for Debian 10;
wget https://packages.couchbase.com/releases/7.0.2/couchbase-server-community_7.0.2-debian10_amd64.deb
Next, run the command to install Couchbase server on Debian 10/Debian 11. Note that currently, as of this writing, there is no binary for Debian 11, but the binary for Debian 10 should still work.
apt install ./couchbase-server-community_7.0.2-debian10_amd64.deb
Running Couchbase Server Service
When installed, Couchbase server service is started and enabled to run on system boot;
Check the status;
systemctl status couchbase-server
Sample output;
● couchbase-server.service - Couchbase Server
Loaded: loaded (/lib/systemd/system/couchbase-server.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/couchbase-server.service.d
└─override.conf
Active: active (running) since Sat 2022-03-26 13:46:09 EDT; 5min ago
Docs: https://docs.couchbase.com
Main PID: 1812 (beam.smp)
Tasks: 169 (limit: 2359)
Memory: 187.0M
CGroup: /system.slice/couchbase-server.service
├─1812 /opt/couchbase/lib/erlang/erts-10.7.2.7/bin/beam.smp -A 16 -sbwt none -- -root /opt/couchbase/lib/erlang -progname erl -- -home /opt/couchbase -- -smp ena
├─1828 /opt/couchbase/lib/erlang/erts-10.7.2.7/bin/epmd -daemon
├─1877 erl_child_setup 200000
├─1894 /opt/couchbase/lib/erlang/erts-10.7.2.7/bin/beam.smp -A 16 -sbt u -P 327680 -K true -swt low -sbwt none -MMmcs 30 -e102400 -- -root /opt/couchbase/lib/erl
├─1916 erl_child_setup 200000
├─1935 sh -s disksup
├─1936 /opt/couchbase/lib/erlang/lib/os_mon-2.5.1.1/priv/bin/memsup
├─1938 /opt/couchbase/lib/erlang/lib/os_mon-2.5.1.1/priv/bin/cpu_sup
├─1941 /opt/couchbase/lib/erlang/erts-10.7.2.7/bin/beam.smp -P 327680 -K true -- -root /opt/couchbase/lib/erlang -progname erl -- -home /opt/couchbase -- -pa /op
├─1948 erl_child_setup 200000
├─1967 sh -s disksup
├─1968 /opt/couchbase/lib/erlang/lib/os_mon-2.5.1.1/priv/bin/memsup
├─1970 /opt/couchbase/lib/erlang/lib/os_mon-2.5.1.1/priv/bin/cpu_sup
├─1973 inet_gethost 4
├─1974 inet_gethost 4
├─1975 /opt/couchbase/bin/priv/godu
├─1979 sh -s ns_disksup
├─1980 /opt/couchbase/bin/priv/godu
├─1985 /opt/couchbase/bin/goport -graceful-shutdown=false -window-size=524288
├─1989 /opt/couchbase/bin/prometheus --config.file /opt/couchbase/var/lib/couchbase/config/prometheus.yml --web.enable-admin-api --web.enable-lifecycle --storage
├─1997 inet_gethost 4
├─1998 inet_gethost 4
├─2002 /opt/couchbase/bin/saslauthd-port
├─2008 portsigar for [email protected] 1812
├─2009 /opt/couchbase/bin/goport -graceful-shutdown=false -window-size=524288
├─2013 /opt/couchbase/bin/goxdcr -sourceKVAdminPort=8091 -xdcrRestPort=9998 -isEnterprise=false -ipv4=required -ipv6=optional
└─2021 /opt/couchbase/bin/memcached -C /opt/couchbase/var/lib/couchbase/config/memcached.json
Mar 26 13:46:09 debian systemd[1]: Started Couchbase Server.
Open Couchbase Ports on Firewall
Couchbase server uses various TCP ports for network communication. If you are running a system level or edge firewall, be sure to open these ports where necessary.
ufw allow to any port 369,8091:8094,9100:9105,9998,9999,11209:11211,11214,11215,18091:18093,21100:21299 proto tcp comment "Couchbase TCP ports"
You can as well use iptables if you want.
Access the Couchbase Web Console
You can now access your Couchbase web console via the url http://server-IP-or-domain-name:8091
.
Upon accessing the url, you will be promted to either join an existing Couchbase cluster or create a new cluster.
In my setup, I don’t have an existing cluster. Hence, I will create a new one. Hence, enter the name of the cluster, admin username and password.
Next, accept the EULA and choose whether to setup disk, ram and services or finish with defaults. We choose finish with defaults in this setup.
Dashboard with sample buckets loaded;
Sample Couchbase server dashboard;
And there you go. You have learnt how to install Couchbase Server.
Further Reading
Next Couchbase Cluster Setup Steps