Install RethinkDB Realtime Database on RHEL / CentOS 7 & 8

RethinkDB stores JSON documents with dynamic schemas and is designed to facilitate pushing real-time updates for query results to applications. Today I’m going to share how to setup RethinkDB on RHEL / CentOS.

Table of Contents

  1. Install RethinkDB
  2. Configuration
  3. Config Firewall & Test
  4. Run RethinkDB

Install RethinkDB

Let’s add RethinkDB repository provided by RethinkDB team:

# RHEL/CentOS 8
sudo wget`uname -m`/rethinkdb.repo -O /etc/yum.repos.d/rethinkdb.repo

# RHEL/CentOS 7
sudo wget`uname -m`/rethinkdb.repo -O /etc/yum.repos.d/rethinkdb.repo

After adding the repository, we can install RethinkDB using yum or dnf package manager.

sudo yum -y install rethinkdb


You can read their configuration file documentation. Let’s create an instance of rethinkdb:

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

If you don’t have the sample .conf file, you can download it from here. Now we have to customize the instance1.conf. Open instance1.conf file:

sudo nano /etc/rethinkdb/instances.d/instance1.conf

Comment out these lines:


Then set permissions:

sudo chown -R rethinkdb:rethinkdb  /var/log/rethinkdb /var/lib/rethinkdb

sudo chmod -R 775 /var/log/rethinkdb /var/lib/rethinkdb

Config Firewall & Test

If firewall is active on your server, you need to open 8080 on port.

# open http port
sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent

# open driver port
sudo firewall-cmd --zone=public --add-port=28015/tcp --permanent

# reload firewall
sudo firewall-cmd --reload

Now run this command to enable run RethinkDB on port 8080.

rethinkdb --bind all

Visit http://[server-ip-address]:8080 to see the web interface of RethinkDB.

Now stop exist from RethinkDB console and stop:

# exit
Ctrl + C

# stop
sudo /etc/init.d/rethinkdb stop

Run RethinkDB

Enable RethinkDB on start:

sudo systemctl enable --now rethinkdb

Start RethinkDB:

sudo systemctl start rethinkdb

Check status:

sudo systemctl status rethinkdb

Again visit http://[server-ip-address]:8080 to see the web interface of RethinkDB. You’ll see the screen like this:

Done. RethinkDB is running and available to use. Thank you. ?

Software Engineer | Ethical Hacker & Cybersecurity...

Md Obydullah is a software engineer and full stack developer specialist at Laravel, Django, Vue.js, Node.js, Android, Linux Server, and Ethichal Hacking.