In the following guide, you will learn how to install CouchDB and create a database using their web UI on your Ubuntu 20.04 LTS operating system.
Table of Contents
- Ubuntu 20.04 OS (20.10 and 21.04 can be used)
- Update to date system packages
- Root access or sudo privilages.
- Common properties and Curl installed.
sudo apt update && sudo apt upgrade -y
Next, install the required packages.
sudo apt install software-properties-common wget
Download GPG Key CouchDB
Now you need to download the GPG key for the repository to install CouchDB and receive further updates in the future automatically when running the apt package manager update command.
curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc | sudo apt-key add -
Now, add the repository.
echo "deb https://apache.bintray.com/couchdb-deb focal main" | sudo tee –a /etc/apt/sources.list
An example output:
~$ echo "deb https://apache.bintray.com/couchdb-deb focal main" | sudo tee -a /etc/apt/sources.list deb https://apache.bintray.com/couchdb-deb focal main
Once the repository is added, you will need to update the package manager to sync the new repo, and you can then install CouchDB onto your Ubuntu 20.04 system.
sudo apt update && sudo apt install couchdb -y
Once you have started the installation process, you will see a screen pop up very quickly.
Configuration Mode Choice
You will need to select ok to proceed to the next screen. Note you will need to hit the tab key on your keyboard to select the ok. Once done, hit enter. When you get to the second part, choose the Standalone server option.
IP Address Configuration
The next option in the configuration is to set the IP address of the network interface to which CouchDB will bind. Again, if you run a single server, you do not need to modify the default “127.0.0.1” address.
You now create an admin account. It will ask you for a password to proceed further. Type it in and select ok. It is not recommended to skip this step. By leaving blank, you leave a security loophole in the future.
CouchDB Status Check
By default, the software should be automatically enabled at startup and already on. To check, enter the following.
sudo systemctl status couchdb
Example output should be:
~$ sudo systemctl status couchdb ● couchdb.service - Apache CouchDB Loaded: loaded (/lib/systemd/system/couchdb.service; enabled; vendor prese> Active: active (running) since Sat 2021-06-19 07:50:41 PDT; 42s ago Main PID: 14835 (beam.smp) Tasks: 38 (limit: 4617) Memory: 34.9M CGroup: /system.slice/couchdb.service ├─14835 /opt/couchdb/bin/../erts-184.108.40.206/bin/beam.smp -K true -A > ├─14847 /opt/couchdb/bin/../erts-220.127.116.11/bin/epmd -daemon ├─14866 erl_child_setup 65536 ├─14894 inet_gethost 4 └─14895 inet_gethost 4 Jun 19 07:50:41 ubuntu systemd: Started Apache CouchDB.
Create a New CouchDB Database
You can add a new database using CouchDB with the username “admin” and the password you set for the account during the initial install configuration. This can be accessed through CouchDB’s Fauxton web UI control panel that comes installed with the package.
To launch Fauxton, enter the following in your browser.
Once logged in, you will see a create a database link with an icon in the top right-hand corner. Select this, which will then bring up a “Create Database” screen. Enter the name testdb and select partitioned or non-partitioned, then click on the Create button to continue.
Now back on the database page, you can see the new database you created.
Comments and Conclusion
The guide has shown you how to install CouchDB and create a database using the software’s inbuilt web UI Fauxton. To find out more information on what you can do with CouchDB or more configuration options in a live environment, see their documentation.