couchdb · opensuse

Installing CouchDB in openSuse Tumbleweed

Installing CouchDB in openSuse is not trivial as may seem.

If You google it you’ll find 2 most popular solutions:

(1) Official installation documentation (https://docs.couchdb.org/en/latest/install/unix.html#installation-using-the-apache-couchdb-convenience-binary-packages)

CouchDB installation instructions

(2) Install using Snap (https://snapcraft.io/install/couchdb/opensuse)

Install CouchDB using Snap

(*) and maybe you’ll simply go with Docker


But what if?

But what if I don’t want to switch to Centos, RHEL, Fedora, Debian, Ubuntu?

What if I don’t want to pollute my workspace with SnapCraft and want to keep clean my OS instance only installing stuff from official openSuse repos?

Solution: Build from sources!


Step 1: Create folder in home folder for Applications or name it whatever you like

mkdir ~/Applications

Step 2: Download CouchDB sources .tar.gz

navigate to url: https://downloads.apache.org/couchdb/source/ and find the latest version (in my case 3.4.3)

download, extract it:

mkdir ~/tmp
cd ~/tmp
wget https://downloads.apache.org/couchdb/source/3.4.3/apache-couchdb-3.4.3.tar.gz
tar -zxf apache-couchdb-3.4.3.tar.gz
cd apache-couchdb-3.4.3 

Step 3: Download dependencies (or fight with it at building step)

sudo zypper install gcc gcc-c++ make autoconf automake libtool \
  erlang erlang-rebar rebar \
  openssl-devel curl-devel \
  libicu-devel ncurses-devel \
  mozjs128 mozjs128-devel

if there will be issue with finding correct mozjs package run search:

sudo zypper search mozjs

which will return something like this:

Reading installed packages...

S  | Name           | Summary                                  | Type
---+----------------+------------------------------------------+--------
   | libmozjs-115-0 | JavaScript's library                     | package
i  | libmozjs-128-0 | JavaScript's library                     | package
   | mozjs115       | SpiderMonkey JavaScript library          | package
   | mozjs115-devel | Development files and tools for mozjs115 | package
i+ | mozjs128       | SpiderMonkey JavaScript library          | package
i+ | mozjs128-devel | Development files and tools for mozjs128 | package

so install necessary latest version:

sudo zypper install mozjs128 mozjs128-devel

Step 4: Let’s build it!

Building has 4 sub steps (“classic” as with most of tarballs in linux):

  1. configure
  2. make
  3. make install
  4. copy result

Sub-step: 1

./configure 

if You’ll get this output:

┌[num8er☮g8way1]-(~/tmp/apache-couchdb-3.4.3)
└> ./configure 
ERROR: SpiderMonkey 91 is not found. Please specify with --spidermonkey-version.

add version:

./configure --spidermonkey-version=128

should see such output:

┌[num8er☮g8way1]-(~/tmp/apache-couchdb-3.4.3)
└> ./configure --spidermonkey-version=128
==> configuring couchdb in rel/couchdb.config
You have configured Apache CouchDB, time to relax. Relax.

Sub-step: 2

make

it starts like this:

make couchdb

and must end like:

make couchdb


Sub-step: 3

make install

will end like this:

=> smoosh (compile)
==> weatherreport (compile)
==> couch_prometheus (compile)
==> couch_scanner (compile)
==> rel (compile)
==> apache-couchdb-3.4.3 (compile)
==> weatherreport (escriptize)
WARN:  'escriptize' command does not apply to directory /home/num8er/tmp/apache-couchdb-3.4.3/rel
WARN:  'escriptize' command does not apply to directory /home/num8er/tmp/apache-couchdb-3.4.3
Installing CouchDB into rel/couchdb/ ...
WARN:  Missing plugins: [pc]
WARN:  Missing plugins: [pc]
==> rel (generate)
WARN:  'generate' command does not apply to directory /home/num8er/tmp/apache-couchdb-3.4.3
... done

    You can now copy the rel/couchdb directory anywhere on your system.
    Start CouchDB with ./bin/couchdb from within that directory.


Notice: There is no 'make install' command for CouchDB 2.x+.

    To install CouchDB into your system, copy the rel/couchdb
    to your desired installation location. For example:
    cp -r rel/couchdb /usr/local/lib

means it’s compiled in rel/couchdb

┌[num8er☮g8way1]-(~/tmp/apache-couchdb-3.4.3)
└> cd rel/couchdb 
┌[num8er☮g8way1]-(~/tmp/apache-couchdb-3.4.3/rel/couchdb)
└> ls -la
total 144
drwxr-xr-x.  9 num8er num8er   4096 Aug 30 15:45 .
drwxr-xr-x.  7 num8er num8er   4096 Aug 30 15:45 ..
drwxr-xr-x.  2 num8er num8er   4096 Aug 30 15:45 bin
drwxr-xr-x.  8 num8er num8er   4096 Aug 30 15:45 erts-15.2.7
drwxr-xr-x.  4 num8er num8er   4096 Aug 30 15:45 etc
drwxr-xr-x. 53 num8er num8er   4096 Aug 30 15:45 lib
-rw-r--r--.  1 num8er num8er 109969 Aug 30 15:45 LICENSE
drwxr-xr-x.  2 num8er num8er   4096 Aug 30 15:45 releases
drwxr-xr-x.  5 num8er num8er   4096 Aug 30 15:45 share
drwxr-xr-x.  3 num8er num8er   4096 Aug 30 15:45 var

Sub-step: 4

As latest output says:

    To install CouchDB into your system, copy the rel/couchdb
    to your desired installation location. For example:
    cp -r rel/couchdb /usr/local/lib

let’s do as it says:

cp -r rel/couchdb /usr/local/lib

or alternative:

cp -r rel/couchdb /opt

“my way”:

I prefer to keep stuff in my home at beginning I’ve created Applications folder in home folder?

cp -r rel/couchdb ~/Applications

let’s update PATH in our shell:

add to ~/.bashrc or ~/.zshrc:

export COUCHDB_PATH="$HOME/Applications/couchdb"
export COUCHDB_BIN="$COUCHDB_PATH/bin"
export PATH="$PATH:$COUCHDB_BIN"

and reload it:

source ~/.bashrc

or

source ~/.zshrc

Step 5: Run it

couchdb

output will be:

[info] 2025-08-30T13:58:57.616643Z [email protected] 
<0.212.0> -------- Preflight check: Checking For Monsters [info] 2025-08-30T13:58:57.616821Z [email protected] 
<0.212.0> -------- Preflight check: Asserting Admin Account [info] 2025-08-30T13:58:57.617004Z [email protected] 
<0.212.0> -------- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
No Admin Account Found, aborting startup. Please configure an admin account in your local.ini file. 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

EASY!

edit local.ini (I use nvim):

v $COUCHDB_PATH/etc/local.ini

simply find [admins] section and add user = password under of it

in screenshot I’ve added user admin with password admin since I don’t care in dev env what password will be

admin user

P.S. v cause I’ve aliased it in .zshrc:

alias v="nvim"
alias vim="nvim"

Let’s run again:

couchdb

and You should see such line:

Apache CouchDB has started on http://127.0.0.1:5984/

and such screen in browser:

couchdb in browser

let’s open Fauxton - the management UI

simply open in browser:

http://127.0.0.1:5984/_utils/


BIG P.S. Don’t forget to cleanup temporary files

rm -rf ~/tmp/apache-couchdb-3.4.3*

Keep it clean.


Now we can Relax :)

couchdb