Install RethinkDB on Ubuntu 22.04|20.04|18.04 & Debian 11|10

Posted on 333 views

Hey folks!. Our blog guide for today is on how to Install RethinkDB on Ubuntu 22.04|20.04|18.04 & Debian 11|10 Linux system. RethinkDB is the leading Open-source, scalable database for building realtime web applications. It enables you to build amazing realtime applications with dramatically less engineering effort.

RethinkDB is a NoSQL database that stores schemaless JSON documents. It was designed with automatic failover and robust fault tolerance in mind. It exposes a new database access model  instead of polling for changes, the developer can tell the database to continuously push updated query results to applications in realtime.

Let’s now dive to the installation of RethinkDB on Ubuntu 22.04|20.04|18.04 & Debian 11|10 Linux system.

For CentOS: How To Install RethinkDB on CentOS 8 / CentOS 7

Install RethinkDB on Debian / Ubuntu

There is an official APT repository for both Debian and Ubuntu system where you can install RethinkDB packages from.

Add RethinkDB repository to your system using the commands below.

Add RethinkDB repository to Ubuntu

Install basic packages required:

sudo apt update
sudo apt install curl gpg gnupg2 software-properties-common apt-transport-https lsb-release ca-certificates gnupg2

Import repository GPG key:

wget -qO- https://download.rethinkdb.com/repository/raw/pubkey.gpg|sudo gpg --dearmor -o /usr/share/keyrings/rethinkdb-archive-keyrings.gpg

Import repository GPG key:

echo "deb [signed-by=/usr/share/keyrings/rethinkdb-archive-keyrings.gpg] https://download.rethinkdb.com/repository/ubuntu-$(lsb_release -cs) $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list

Add RethinkDB repository to Debian

Install basic packages required:

sudo apt update
sudo apt install curl gpg gnupg2 software-properties-common apt-transport-https lsb-release ca-certificates

On your Debian machine, add RethinkDB repository with the command:

export CODENAME=`lsb_release -cs`
echo "deb https://download.rethinkdb.com/repository/debian-$CODENAME $CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list

Then import GPG key:

wget -qO- https://download.rethinkdb.com/repository/raw/pubkey.gpg|sudo gpg --dearmor -o /usr/share/keyrings/rethinkdb-archive-keyrings.gpg

Install RethinkDB on ubuntu / Debian

After adding the repository, update APT cache and install RethinkDB on your Ubuntu / Debian machine.

sudo apt update
sudo apt install rethinkdb

Configuring RethinkDB on Ubuntu / Debian

Copy the sample configuration file and use the configuration file documentation as a guide to customize it. (If you don’t have the sample .conf file, you can download it here.)

sudo cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/instance1.conf
sudo vim /etc/rethinkdb/instances.d/instance1.conf

Examples:

Enable http admin console.

### Network options
bind=all

### Web options
## Port for the http admin console
## Default: 8080 + port-offset
http-port=8080

Set the name for the server.

......
### Meta

## The name for this server (as will appear in the metadata).
## If not specified, it will be randomly chosen from a short list of names.
server-name=server1

The default Data directory is /var/lib/rethinkdb/ but you can change it.

.....................
### File path options

## Directory to store data and metadata
## Command line default: ./rethinkdb_data
## Init script default: /var/lib/rethinkdb// (where  is the name of this file without the extension)
directory=/var/lib/rethinkdb/default

Restart systemd service.

sudo systemctl restart rethinkdb.service 

Then check service status:

$ systemctl status rethinkdb.service 
 ● rethinkdb.service - LSB: This starts a set of rethinkdb server instances.
    Loaded: loaded (/etc/init.d/rethinkdb; generated)
    Active: active (running) since Mon 2019-04-22 10:08:23 CEST; 7s ago
      Docs: man:systemd-sysv-generator(8)
   Process: 23585 ExecStop=/etc/init.d/rethinkdb stop (code=exited, status=0/SUCCESS)
   Process: 23713 ExecStart=/etc/init.d/rethinkdb start (code=exited, status=0/SUCCESS)
     Tasks: 74 (limit: 4915)
    CGroup: /system.slice/rethinkdb.service
            ├─23840 /usr/bin/rethinkdb --daemon --config-file /etc/rethinkdb/instances.d/instance1.conf --runuser rethinkdb --rungroup rethinkdb --p
            ├─23842 /usr/bin/rethinkdb --daemon --config-file /etc/rethinkdb/instances.d/instance1.conf --runuser rethinkdb --rungroup rethinkdb --p
            └─23919 /usr/bin/rethinkdb --daemon --config-file /etc/rethinkdb/instances.d/instance1.conf --runuser rethinkdb --rungroup rethinkdb --p
 Apr 22 10:08:23 ubuntu2 systemd[1]: Starting LSB: This starts a set of rethinkdb server instances….
 Apr 22 10:08:23 ubuntu2 rethinkdb[23713]: rethinkdb: instance1: Starting instance. (logging to `/var/lib/rethinkdb/instance1/data/log_file')
 Apr 22 10:08:23 ubuntu2 rethinkdb[23713]: Recursively removing directory /var/lib/rethinkdb/instance1/data/tmp
 Apr 22 10:08:23 ubuntu2 systemd[1]: Started LSB: This starts a set of rethinkdb server instances..

Access RethinkDB Web console on the Server IP and port 8080.

rethinkdb-admin-interface-1024x399

You’re on your way to database bliss!. Check out the RethinkDB docs and ReQL API. The ten-minute guide will also help you learn how to use the client drivers, get more in-depth information on basic commands, and start writing real applications with RethinkDB.

Here are the quick links to official and third party drivers.

Read the documentation guides to learn how to manage and administer RethinkDB like a ninja!.

coffee

Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.