Welcome to our guide on how to install ArangoDB on Ubuntu 18.04. ArangoDB is a multi-model, open-source database with flexible data models for graphs, documents, and key-values. It is designed for high-performance applications which use SQL-like query language or JavaScript extensions.

ArangoDB is ACID compliant and it is designed to scale horizontally with a few mouse clicks. On top of that, it also provides an internal API that is used to communicate with clients.

ArangoDB doesn’t support SQL as it comes with its own declarative language called AQL (ArangoDB Query Language). AQL is a single SQL-like query language for all data models of the database.

Key features of ArangoDB

  • It is fully open source and released under Apache 2.0 License.
  • Has a flexible data modeling which allows you to model your data as combination of key-value pairs, documents or graphs – perfect for social relations
  • Comes with a Powerful query language (AQL) for modifying and retrieving data.
  • You can run queries on multiple documents or collections with optional transactional consistency and isolation
  • Support for Replication and Sharding: You can set up the database in a master-slave configuration or spread bigger datasets across multiple servers
  • You can use ArangoDB as an application server and fuse your application and database together for maximal throughput.
  • Good storage for performance and data durability through its support for modern storage hardware, like SSD and large caches.
  • ArangoDB can be easily deployed as a fault-tolerant distributed state machine, which can serve as the animal brain of distributed appliances

Install ArangoDB on Ubuntu 18.04

The process of installing ArangoDB on Ubuntu 18.04 is straightforward. This guide will demonstrate a single instance installation of ArangoDB but you can also do:

  • Master/Slave installation
  • Active Failover setup
  • Cluster installation
  • Multiple Datacenters & Standalone Agency setup

The packages are readily available on an Apt repository. The only manual work required is adding the apt repository to your system using the commands below.

Step 1: Add ArangoDB Apt repository

Run the following command to add an apt repository to your system.

echo 'deb https://download.arangodb.com/arangodb34/DEBIAN/ /' | sudo tee /etc/apt/sources.list.d/arangodb.list

Step 2: Import repository key

The next step is to import GPG key used for signing the packages.

wget -q https://download.arangodb.com/arangodb34/DEBIAN/Release.key -O- | sudo apt-key add - 

You should see the “OK” message as the output.

Step 3: Update system and install ArangoDB

Update your Apt package cache then install ArangoDB on Ubuntu 18.04.

sudo apt update
sudo apt -y install apt-transport-https
sudo apt -y install arangodb3

You will be required to answer a couple questions during installation.

1. Set DB root password

Enter the password and confirm it.

2. Select if to automatically upgrade database files.

3. Choose the database storage engine to use.

4. Set to backup database before doing an upgrade.

Wait for the installation to finish then proceed to step 3 where you’ll start and manage ArangoDB service with systemd.

If you had miss to set root password during installation, you can secure ArangoDB after installation by running:

$ arango-secure-installation

Step 4: Start ArangoDB service

The service should be automaticaly started upon installation. If it is not started, you can manually start it using systemctl service management command.

sudo systemctl start arangodb3
sudo systemctl enable arangodb3

Check service with below command.

$ systemctl status arangodb3
● arangodb3.service - ArangoDB database server
Loaded: loaded (/lib/systemd/system/arangodb3.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2019-02-15 18:43:29 CET; 2min 24s ago
Main PID: 4140 (arangod)
Tasks: 18 (limit: 131072)
CGroup: /system.slice/arangodb3.service
└─4140 /usr/sbin/arangod --uid arangodb --gid arangodb --pid-file /var/run/arangodb3/arangod.pid --temp.path /var/tmp/arangodb3 --log.foregr
Feb 15 18:43:30 ubuntu-2gb-nbg1-1 arangod[4140]: 2019-02-15T17:43:30Z [4140] INFO ArangoDB 3.4.2-1 [linux] 64bit, using jemalloc, build tags/v3.4.2.1-0
Feb 15 18:43:30 ubuntu-2gb-nbg1-1 arangod[4140]: 2019-02-15T17:43:30Z [4140] INFO detected operating system: Linux version 4.15.0-42-generic ([email protected]
Feb 15 18:43:30 ubuntu-2gb-nbg1-1 arangod[4140]: 2019-02-15T17:43:30Z [4140] INFO {authentication} Jwt secret not specified, generating…
Feb 15 18:43:30 ubuntu-2gb-nbg1-1 arangod[4140]: 2019-02-15T17:43:30Z [4140] INFO using storage engine rocksdb
Feb 15 18:43:30 ubuntu-2gb-nbg1-1 arangod[4140]: 2019-02-15T17:43:30Z [4140] INFO {cluster} Starting up with role SINGLE
Feb 15 18:43:30 ubuntu-2gb-nbg1-1 arangod[4140]: 2019-02-15T17:43:30Z [4140] INFO {syscall} file-descriptors (nofiles) hard limit is 131072, soft limit
Feb 15 18:43:30 ubuntu-2gb-nbg1-1 arangod[4140]: 2019-02-15T17:43:30Z [4140] WARNING {threads} --server.threads (64) is more than eight times the numbe
Feb 15 18:43:30 ubuntu-2gb-nbg1-1 arangod[4140]: 2019-02-15T17:43:30Z [4140] INFO {authentication} Authentication is turned on (system only), authentic
Feb 15 18:43:31 ubuntu-2gb-nbg1-1 arangod[4140]: 2019-02-15T17:43:31Z [4140] INFO using endpoint 'http+tcp://127.0.0.1:8529' for non-encrypted requests
Feb 15 18:43:32 ubuntu-2gb-nbg1-1 arangod[4140]: 2019-02-15T17:43:32Z [4140] INFO ArangoDB (version 3.4.2-1 [linux]) is ready for business. Have fun!

The status should return “running“.

Step 5: Launching ArangoDB shell

To launch ArangoDB shell, run:

# arangosh

Please specify a password: <Enter-db-root-password-here>
                                       _     
  __ _ _ __ __ _ _ __   __ _  ___  ___| |__  
 / _` | '__/ _` | '_ \ / _` |/ _ \/ __| '_ \ 
| (_| | | | (_| | | | | (_| | (_) \__ \ | | |
 \__,_|_|  \__,_|_| |_|\__, |\___/|___/_| |_|
                       |___/
arangosh (ArangoDB 3.4.2-1 [linux] 64bit, using jemalloc, build tags/v3.4.2.1-0-g91afc6501f, VPack 0.1.33, RocksDB 5.16.0, ICU 58.1, V8 5.7.492.77, OpenSSL 1.1.0j  20 Nov 2018)
 Copyright (c) ArangoDB GmbH
 Connected to ArangoDB 'http+tcp://127.0.0.1:8529' version: 3.4.2-1 [server], database: 'testdb', username: '[email protected]'
 Type 'tutorial' for a tutorial or 'help' to see common examples
 127.0.0.1:[email protected]> 

Create a test database.

127.0.0.1:[email protected]_system> db._createDatabase("testdb");
true

Create database user and grant access to the database created above.

var users = require("@arangodb/users");
users.save("[email protected]", "dbuserpassword");
users.grantDatabase("[email protected]", "testdb");

Check complete user management guide for more information.

List databases.

127.0.0.1:[email protected]_system> db._databases()
[
"_system",
"testdb"
]

You can now connect to the test database using the user [email protected].

# arangosh --server.username "[email protected]" --server.database testdb

Please specify a password: 
                                       _     
  __ _ _ __ __ _ _ __   __ _  ___  ___| |__  
 / _` | '__/ _` | '_ \ / _` |/ _ \/ __| '_ \ 
| (_| | | | (_| | | | | (_| | (_) \__ \ | | |
 \__,_|_|  \__,_|_| |_|\__, |\___/|___/_| |_|
                       |___/
arangosh (ArangoDB 3.4.2-1 [linux] 64bit, using jemalloc, build tags/v3.4.2.1-0-g91afc6501f, VPack 0.1.33, RocksDB 5.16.0, ICU 58.1, V8 5.7.492.77, OpenSSL 1.1.0j  20 Nov 2018)
 Copyright (c) ArangoDB GmbH
 Connected to ArangoDB 'http+tcp://127.0.0.1:8529' version: 3.4.2-1 [server], database: 'testdb', username: '[email protected]'
 Type 'tutorial' for a tutorial or 'help' to see common examples
 127.0.0.1:[email protected]> 

To drop the database, use:

127.0.0.1:[email protected]_system> db._dropDatabase("testdb");
true

Step 6: Accessing ArangoDB Admin Web Interface

ArangoDB server comes with a built-in web interface for administration. It lets you manage databases, collections, documents, users, graphs, run and explain queries, see server stats and much more.

The service is set to listen on localhost address but it can be changed to listen on Local LAN IP.

Comment the line endpoint = tcp://127.0.0.1:8529 and add your network IP.

$ sudo vim /etc/arangodb3/arangod.conf
...
#endpoint = tcp://127.0.0.1:8529
endpoint = tcp://192.168.10.11:8529

Restart ArangoDB service after making this change.

sudo systemctl restart arangodb3

If you have UFW firewall enable, ensure port 8529 is allowed in the firewall.

sudo ufw allow proto tcp from any to any port 8529

Access the Admin dashboard on http://[serverip or localhost]:8529. By default, authentication is enabled.

Provide username and password to authenticate as and select database to connect to on the next screen.

The database management web interface should look similar to below.

Next Steps

Visit the ArangoDB Documentation and Tutorials to learn more about it and how you can do integrations with your Applications. This cheat sheet may also come in handy.

Our next guide will cover ArangoDB Cluster setup on Ubuntu 18.04. Until then, check other Database related guides on our website.

How to Install Percona MySQL Server 8.0 on Ubuntu / Debian

Install and Configure DBeaver on Ubuntu 18.04 / Ubuntu 16.04 / Debian 9

How to Install and use Percona Toolkit on Ubuntu 18.04 LTS

Install PostgreSQL 11 on Ubuntu 18.04 / Ubuntu 16.04

How to Install Metabase with Systemd on Ubuntu 18.04 / Ubuntu 16.04