How to Install RethinkDB on Ubuntu Linux

This article guides users on installing RethinkDB on Ubuntu 16.04 and 18.04. It details the necessary packages, installation steps via DEB or source, service management, and highlights RethinkDB’s real-time capabilities and web interface. The piece encourages testing in a lab environment before production deployment.

This article explains installing RethinkDB on Ubuntu 16.04 | 18.04 LTS servers.

RethinkDB provides a free, open-source, and scalable database system with real-time features suitable for web development and monitoring. If you need a database management system with native multi-model capabilities that make building real-time apps easy, you may look at RethinkDB.

RethinkDB uses JSON to query documents using Python, Ruby, Node.js, and many other languages right out of the box. Building your apps using the database system should do your job using its intuitive web UI.

For more about RethinkDB, please visit its homepage.

If you want to test it in your lab environment before going out and using it in production, the steps below should be a great place to start. Follow the steps below to install RethinkDB on Ubuntu.

Install Required Packages

To get the latest RethinkDB version, you can download the DEB file from its website or add its official repository to Ubuntu. However, some required packages may be needed for the installation to work.

First, run the commands below to install apt-transport-https.

sudo apt update
sudo apt install apt-transport-https

After installing the package above, continue to install RethinkDB below.

Install RethinkDB

Now that some required packages have been installed, follow the steps below to get RethinkDB installed and configured. If you don’t want to install the RethinkDB from its DEB file, you can add the RethinkDB’s official package repository to make installing and updating it easier.

To add the RethinkDB repository and key, run the commands below. The first line imports the repository’s GPG key.

The second adds the RethinkDB repository into a new file called rethinkdb. List.

wget -qO- https://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list

After the steps above, run the commands below to install them.

sudo apt update
sudo apt install rethinkdb

After installation, the commands below can stop, start, and enable the RethinkDB service.

sudo systemctl stop rethinkdb
sudo systemctl start rethinkdb
sudo systemctl enable rethinkdb

To verify that RethinkDB is installed and running, run the commands below to check its status.

sudo systemctl status rethinkdb

You should see similar lines as shown below:

● rethinkdb.service - LSB: This starts a set of rethinkdb server instances.
   Loaded: loaded (/etc/init.d/rethinkdb; generated)
   Active: active (exited) since Tue 2019-04-23 12:03:50 CDT; 22s ago
     Docs: man:systemd-sysv-generator(8)
    Tasks: 0 (limit: 4683)
   CGroup: /system.slice/rethinkdb.service

Apr 23 12:03:50 ubuntu1804 systemd[1]: Starting LSB: This starts a set of rethinkdb server instances.
Apr 23 12:03:50 ubuntu1804 rethinkdb[19021]: rethinkdb: No instances defined in /etc/rethinkdb/instances.d
Apr 23 12:03:50 ubuntu1804 rethinkdb[19021]: rethinkdb: See http://www.rethinkdb.com/docs/guides/startup/ 
Apr 23 12:03:50 ubuntu1804 systemd[1]: Started LSB: This starts a set of rethinkdb server instances.

That should do it!

Install RethinkDB from Source

If RethinkDB’s repository doesn’t have packages for your system yet, you may want to install it manually from the source. Unfortunately, at the time of this writing, Ubuntu 18.04 isn’t supported.

So, to install RethinkDB from the source, run the commands below to install the required packages for building the app.

sudo apt update
sudo apt install build-essential protobuf-compiler python curl libprotobuf-dev libcurl4-openssl-dev libboost-all-dev libncurses5-dev libjemalloc-dev wget m4

Next, run the commands below to download its archived version, which includes version 2.3.6.

cd /tmp
wget https://download.rethinkdb.com/dist/rethinkdb-2.3.6.tgz
tar xf rethinkdb-2.3.6.tgz

After extracting the downloaded archive, change it into the directory and install it.

cd rethinkdb-2.3.6
./configure --allow-fetch
make
sudo make install

That should install RethinkDB on your system.

After installing, run the commands below to configure it quickly.

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

Then enable the default HTTP port number when the file opens,

## r.http(.) queries will use the given server as a web proxy
### Web options
## Port for the http admin console
## Default: 8080 + port-offset
 http-port=8080

## Disable web administration console
# no-http-admin

Save the file and exit.

After that, use the commands below to start, stop and restart.

sudo /etc/init.d/rethinkdb stop
sudo /etc/init.d/rethinkdb start
sudo /etc/init.d/rethinkdb restart

Access RethinkDB Web Interface

RethinkDB also comes with a web interface that allows management in your web browser. To log in, go to the server’s IP address followed by port # 8080

http://127.0.0.1:8080

Enjoy!

Congratulations! You have successfully installed RethinkDB on Ubuntu 16.04 and 18.05

You may also like the post below:

Richard Avatar

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *


Exit mobile version