How To Install OrientDB on Ubuntu 16.04

OrientDB is an open source NoSQL database management system written in Java. It is a multi-model database, supporting graph, document, key/value, and object models, but the relationships are managed as in graph databases with direct connections between records.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation OrientDB on a Ubuntu 16.04 (xenial xerus) server.

Install OrientDB on Ubuntu 16.04 LTS

Step 1. First, make sure that all your system packages are up-to-date

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing Dependencies.

First of all, let’s install dependencies for OrientDB:

apt-get install oracle-java8-set-default git ant

Step 3. Installing OrientDB.

Download the latest version of OrientDB by executing the following command, At the moment of writing this article it is version 2.2.22:

wget -O orientdb-community-2.2.22.tar.gz http://orientdb.com/download.php?file=orientdb-community-2.2.22.tar.gz&os=linux

Once the package is downloaded we will untar and move the extracted folder to the /opt/orientdb:

tar -zxf orientdb-community-2.2.22.tar.gz
mv orientdb-community-2.2.22 /opt/orientdb

Step 4. Starting the OrientDB Server.

Change to the /opt/orientdb folder and start the OrientDB database server:

cd /opt/orientdb
sudo bin/server.sh

OrientDB should now prompt for the root password with a message like the one below:

+---------------------------------------------------------------+
|                WARNING: FIRST RUN CONFIGURATION               |
+---------------------------------------------------------------+
| This is the first time the server is running. Please type a   |
| password of your choice for the 'root' user or leave it blank |
| to auto-generate it.                                          |
|                                                               |
| To avoid this message set the environment variable or JVM     |
| setting ORIENTDB_ROOT_PASSWORD to the root password to use.   |
+---------------------------------------------------------------+

Step 5. Configure OrientDB Daemon.

Create a system user which we want to run OrientDB here we assume orientdb user:

useradd –r 0riendb –s  /sbin/nologin
chown –R orientdb:orientdb /opt/orientdb
nano /opt/orientdb/bin/orientdb.sh

Find the below line in the configuration and change them to:

# You have to SET the OrientDB installation directory here
ORIENTDB_DIR="/opt/orientdb"
ORIENTDB_USER="orientdb"

Once the configuration is done, change the configuration server file’s permission:

chmod 640 /opt/orientdb/config/orientdb-server-config.xml

Step 6. Install the Systemd service OrientDB.

First, we needed to copy the file to /etc/system/services folder:

cp /opt/orientdb/bin/orientdb.service /etc/systemd/system

Edit the OrientDB service file:

### nano /etc/systemd/system/orientdb.service

[Unit]
Description=OrientDB Server
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
[Service]
User=orientdb
Group=orientdb
ExecStart /opt/orientdb /bin/server.sh

Reload systemd daemon service:

systemctl daemon-reload

Start OrientDB and enable for starting at boot time:

systemctl start orientdb
systemctl enable orientdb

Congratulation’s! You have successfully installed OrientDB. Thanks for using this tutorial for installing OrientDB on Ubuntu 16.04 (xenial xerus) server. For additional help or useful information, we recommend you to check the official OrientDB web site.

Leave a Reply