(Last Updated On: August 14, 2018)

In this tutorial, I’ll show you how to install OrientDB on your Ubuntu 18.04 server. OrientDB is the world’s leading open source NoSQL multi-model database management system written in Java. It is the most versatile DBMS which supports Graph, Document, Reactive, Full-Text, Geospatial and Key-Value models in one Multi-Model product.

You can run OrientDB in a distributed (Multi-Master) setup and supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries. To know the power of OrientDB, take a look at OrientDB vs MongoDB for Document Databases and OrientDB vs Neo4j to have a comparison with a popular Graph Database.

How To Install and Configure OrientDB on Ubuntu 18.04 LTS

In this guide, we will install OrientDB Community Edition which is available as a binary package for download. Open OrientDB downloads page.

Step 1: Install OrientDB Dependencies.

Java is needed on your Ubuntu 18.04 system to run OrientDB database system. Install it like below:

sudo apt update && sudo apt upgrade
sudo apt install apt-transport-https  openjdk-8-jre-headless

Install wget to download OriendDB installation file:

sudo apt-get update
sudo apt-get install wget

Step 2: Install OrientDB on Ubuntu 18.04 LTS

Once wget is installed, download the archive file. Check Github releases page and replace 3.0.5 with the latest version.

export RELEASE="3.0.4"
wget https://s3.us-east-2.amazonaws.com/orientdb3/releases/${RELEASE}/orientdb-${RELEASE}.tar.gz

Uncompress the file:

tar xvf orientdb-${RELEASE}.tar.gz

Move the resulting directory to /opt/orientdb

sudo mv  orientdb-${RELEASE} /opt/orientdb

Add system user to manage orientdb:

sudo groupadd -r orientdb
sudo useradd --system -g orientdb orientdb
sudo chown -R orientdb:orientdb /opt/orientdb

Create a root password:

cd /opt/orientdb/bin/
sudo ./server.sh

Sample output:

+---------------------------------------------------------------+
|                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.   |
+---------------------------------------------------------------+

Root password [BLANK=auto generate it]: **************
Please confirm the root password: **************

Step 3: Configure the OrientDB systemd service

The OrientDB’s package contains a service descriptor file for systemd based distros. The orientdb.service is placed in the bin directory. You can use locate command to find this fule path:

$ sudo locate orientdb.service
/opt/orientdb/bin/orientdb.service

Copy the service unit file to  /etc/systemd/system/ directory.

sudo cp /opt/orientdb/server/script/orientdb.service /etc/systemd/system/

Edit the file to set user and group for running the application.

sudo vim /etc/systemd/system/orientdb.service

It should look like below:

# Copyright (c) OrientDB LTD (http://http://orientdb.com/)
#
[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

Start orientdb service:

sudo systemctl daemon-reload
sudo systemctl start orientdb

Your orientdb service should now be running. Open the UI using:

http://server:2480/studio/index.html

Login with the username root and password configured earlier.

Thank you for using our guide to install OrientDB on Ubuntu 18.04 LTS.