Databases

Install ArangoDB on Ubuntu 24.04 / Debian 13

ArangoDB is a multi-model NoSQL database that combines document, graph, and key-value data models in a single engine. Instead of running separate databases for different data types, ArangoDB handles all three with one query language – AQL (ArangoDB Query Language). This makes it a strong choice for applications that need flexible data relationships, such as recommendation engines, fraud detection, and knowledge graphs.

Original content from computingforgeeks.com - post 8366

This guide covers ArangoDB 3.12 installation on Ubuntu 24.04 and Debian 13 from the official repository. We walk through service configuration, web UI access, database creation, AQL queries, graph operations, authentication, firewall rules, and backups with arangodump. ArangoDB is developed by ArangoDB Inc. and the latest stable release is version 3.12.8.

Prerequisites

  • Ubuntu 24.04 LTS or Debian 13 server
  • Root or sudo access
  • Minimum 2 GB RAM (4 GB recommended for production)
  • Port 8529/TCP open for the ArangoDB web interface
  • A working internet connection to pull packages from the official repo

Step 1: Install ArangoDB from Official Repository

ArangoDB provides an official apt repository for Debian-based distributions. Start by downloading and adding the GPG signing key, then configure the repository.

Install the required dependency for HTTPS transport:

sudo apt update
sudo apt install -y apt-transport-https curl gnupg

Download and add the ArangoDB GPG key to verify package authenticity:

curl -fsSL https://download.arangodb.com/arangodb312/DEBIAN/Release.key | sudo gpg --dearmor -o /usr/share/keyrings/arangodb.gpg

Add the ArangoDB 3.12 repository to your system sources. For Ubuntu 24.04:

echo "deb [signed-by=/usr/share/keyrings/arangodb.gpg] https://download.arangodb.com/arangodb312/DEBIAN/ /" | sudo tee /etc/apt/sources.list.d/arangodb.list

The same repository works for Debian 13 as well – ArangoDB uses a single DEBIAN repository for all Debian-based distributions.

Update the package index and install ArangoDB:

sudo apt update
sudo apt install -y arangodb3

During installation, you will be prompted to set a password for the ArangoDB root user. Choose a strong password – this controls access to the web interface and API. You will also be asked whether to upgrade database files automatically and which storage engine to use. Select Yes for the upgrade prompt and auto for the storage engine (which defaults to RocksDB).

Verify the installed version after the installation completes:

arangod --version

The output should show ArangoDB 3.12.x confirming a successful installation:

arangodb3 3.12.8

Step 2: Start and Enable ArangoDB Service

The ArangoDB service may not start automatically after installation. Enable it to start on boot and start it now:

sudo systemctl enable --now arangodb3

Check the service status to confirm ArangoDB is running:

sudo systemctl status arangodb3

The output should show the service as active (running) with the ArangoDB server listening on port 8529:

● arangodb3.service - ArangoDB database server
     Loaded: loaded (/lib/systemd/system/arangodb3.service; enabled; preset: enabled)
     Active: active (running) since Sun 2026-03-22 10:15:00 UTC; 5s ago
   Main PID: 12345 (arangod)
     Memory: 128.0M
        CPU: 1.200s
     CGroup: /system.slice/arangodb3.service
             └─12345 /usr/sbin/arangod --uid arangodb --gid arangodb

Step 3: Access ArangoDB Web Interface

ArangoDB ships with a built-in web interface that runs on port 8529. By default, it only listens on 127.0.0.1. To access it remotely, you need to update the bind address.

Open the ArangoDB configuration file:

sudo vi /etc/arangodb3/arangod.conf

Find the [server] section and update the endpoint to listen on all interfaces:

[server]
endpoint = tcp://0.0.0.0:8529

Restart ArangoDB to apply the change:

sudo systemctl restart arangodb3

Open your browser and navigate to http://your-server-ip:8529. Log in with username root and the password you set during installation. The web UI provides a dashboard for managing databases, collections, queries, and graphs.

You can also verify access from the command line using arangosh – the ArangoDB shell client:

arangosh --server.endpoint tcp://127.0.0.1:8529 --server.username root --server.password YOUR_PASSWORD

A successful connection drops you into the ArangoDB shell prompt where you can run queries and manage databases interactively.

Step 4: Create a Database and Collections

ArangoDB organizes data into databases that contain collections (similar to tables in relational databases). Collections come in two types – document collections for standard data and edge collections for graph relationships.

Connect to the ArangoDB shell and create a new database:

arangosh --server.endpoint tcp://127.0.0.1:8529 --server.username root --server.password YOUR_PASSWORD

Once inside the shell, create a database called testdb:

db._createDatabase("testdb");

Switch to the new database:

db._useDatabase("testdb");

Create a document collection for storing user data:

db._create("users");

The shell returns collection metadata confirming the collection was created:

[ArangoCollection 12345, "users" (type document, status loaded)]

Create an edge collection for relationships (used later in graph operations):

db._createEdgeCollection("friends");

List all collections in the current database to verify:

db._collections();

Step 5: Insert and Query Documents with AQL

ArangoDB uses AQL (ArangoDB Query Language) for all data operations. AQL works across document, graph, and key-value access patterns – one language for all three models. If you are familiar with SQL or MongoDB queries, AQL has a similar feel but with graph traversal built in.

Insert a few documents into the users collection from the ArangoDB shell:

db.users.insert({ name: "Alice", age: 32, role: "engineer" });
db.users.insert({ name: "Bob", age: 28, role: "designer" });
db.users.insert({ name: "Carol", age: 35, role: "engineer" });

Each insert returns the document key, ID, and revision confirming the write succeeded.

Query all documents in the collection using AQL:

db._query("FOR u IN users RETURN u").toArray();

This returns all user documents as JSON objects:

[
  { "_key": "12345", "_id": "users/12345", "_rev": "_abc123", "name": "Alice", "age": 32, "role": "engineer" },
  { "_key": "12346", "_id": "users/12346", "_rev": "_abc124", "name": "Bob", "age": 28, "role": "designer" },
  { "_key": "12347", "_id": "users/12347", "_rev": "_abc125", "name": "Carol", "age": 35, "role": "engineer" }
]

Filter documents with a condition – find all engineers:

db._query("FOR u IN users FILTER u.role == 'engineer' RETURN u").toArray();

Update a document – change Bob’s role to “lead designer”:

db._query("FOR u IN users FILTER u.name == 'Bob' UPDATE u WITH { role: 'lead designer' } IN users");

Delete a document by condition:

db._query("FOR u IN users FILTER u.name == 'Carol' REMOVE u IN users");

Step 6: Graph Operations in ArangoDB

Graphs are where ArangoDB really stands apart from standard document databases. A graph connects documents through edge collections, making it natural to model relationships like social networks, dependency trees, or network topologies. Unlike PostgreSQL or other relational databases that need complex JOINs for relationship queries, ArangoDB traverses graphs natively.

First, insert some user documents if you removed them earlier:

db.users.insert({ _key: "alice", name: "Alice", age: 32 });
db.users.insert({ _key: "bob", name: "Bob", age: 28 });
db.users.insert({ _key: "carol", name: "Carol", age: 35 });
db.users.insert({ _key: "dave", name: "Dave", age: 30 });

Create edges in the friends collection to define relationships between users. Each edge has a _from and _to field pointing to document IDs:

db.friends.insert({ _from: "users/alice", _to: "users/bob", since: 2020 });
db.friends.insert({ _from: "users/alice", _to: "users/carol", since: 2019 });
db.friends.insert({ _from: "users/bob", _to: "users/dave", since: 2021 });
db.friends.insert({ _from: "users/carol", _to: "users/dave", since: 2022 });

Create a named graph to tie the vertex and edge collections together:

var graph_module = require("@arangodb/general-graph");
graph_module._create("social", [
  graph_module._relation("friends", ["users"], ["users"])
]);

Traverse the graph to find all friends of Alice (depth 1):

db._query("FOR v, e IN 1..1 OUTBOUND 'users/alice' friends RETURN v.name").toArray();

This returns the direct friends of Alice:

["Bob", "Carol"]

Traverse deeper to find friends-of-friends (depth 2):

db._query("FOR v, e IN 1..2 OUTBOUND 'users/alice' friends RETURN DISTINCT v.name").toArray();

The result includes both direct and indirect connections:

["Bob", "Carol", "Dave"]

Find the shortest path between two users:

db._query("FOR v, e IN OUTBOUND SHORTEST_PATH 'users/alice' TO 'users/dave' friends RETURN v.name").toArray();

The result shows the shortest path from Alice to Dave:

["Alice", "Bob", "Dave"]

Step 7: Configure Authentication

ArangoDB has authentication enabled by default when you set a root password during installation. To verify and manage authentication settings, check the configuration file.

Open the ArangoDB configuration file:

sudo vi /etc/arangodb3/arangod.conf

Confirm that authentication is enabled in the [server] section:

[server]
authentication = true

For production environments, you should create dedicated database users instead of using the root account. Connect to the ArangoDB shell and create a new user:

arangosh --server.endpoint tcp://127.0.0.1:8529 --server.username root --server.password YOUR_PASSWORD

Create a user with read-write access to a specific database:

var users = require("@arangodb/users");
users.save("appuser", "SecurePassword123!");
users.grantDatabase("appuser", "testdb", "rw");
users.grantCollection("appuser", "testdb", "*", "rw");

This creates the user appuser with read-write permissions on testdb and all its collections. The available permission levels are rw (read-write), ro (read-only), and none (no access).

Verify the user can connect:

arangosh --server.endpoint tcp://127.0.0.1:8529 --server.username appuser --server.password SecurePassword123! --server.database testdb

Step 8: Configure Firewall for ArangoDB

ArangoDB listens on TCP port 8529 for both the web interface and the HTTP API. If you configured it to listen on all interfaces in Step 3, restrict access using your firewall.

On Ubuntu/Debian systems with UFW enabled, allow access to port 8529 from a trusted IP or network:

sudo ufw allow from 10.0.1.0/24 to any port 8529 proto tcp comment "ArangoDB"

To allow access from a single IP address:

sudo ufw allow from 192.168.1.100 to any port 8529 proto tcp comment "ArangoDB admin"

Verify the firewall rules are active:

sudo ufw status numbered

If you are using iptables instead of UFW, the equivalent rule looks like this:

sudo iptables -A INPUT -p tcp --dport 8529 -s 10.0.1.0/24 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 8529 -j DROP

Never expose port 8529 to the public internet without authentication and ideally a reverse proxy with TLS termination. For production deployments, place ArangoDB behind Nginx or HAProxy with SSL certificates. If you need a different NoSQL option with built-in clustering, check out RavenDB on Ubuntu as an alternative.

Step 9: Backup ArangoDB with arangodump

ArangoDB includes arangodump for creating logical backups and arangorestore for restoring them. These tools work similarly to mongodump/mongorestore in MongoDB or pg_dump/pg_restore in PostgreSQL.

Back up a specific database to a directory:

arangodump --server.endpoint tcp://127.0.0.1:8529 --server.username root --server.password YOUR_PASSWORD --server.database testdb --output-directory /var/backups/arangodb/testdb-$(date +%Y%m%d)

The dump creates compressed JSON files for each collection’s structure and data:

Last tick provided by server is: 123456789
Dumping collection 'users'...
Dumping collection 'friends'...
Processed 2 collection(s), wrote 6 document(s), 4 edge(s)

Back up all databases on the server using the --all-databases flag:

arangodump --server.endpoint tcp://127.0.0.1:8529 --server.username root --server.password YOUR_PASSWORD --all-databases --output-directory /var/backups/arangodb/full-$(date +%Y%m%d)

Restore a backup to a database using arangorestore:

arangorestore --server.endpoint tcp://127.0.0.1:8529 --server.username root --server.password YOUR_PASSWORD --server.database testdb --input-directory /var/backups/arangodb/testdb-20260322

Create a backup directory and set up a cron job for automated daily backups:

sudo mkdir -p /var/backups/arangodb

Open the root crontab and add a daily backup job:

sudo crontab -e

Add the following line to run a full backup every day at 2:00 AM and keep backups for 7 days:

0 2 * * * arangodump --server.endpoint tcp://127.0.0.1:8529 --server.username root --server.password YOUR_PASSWORD --all-databases --output-directory /var/backups/arangodb/full-$(date +\%Y\%m\%d) && find /var/backups/arangodb/ -maxdepth 1 -type d -mtime +7 -exec rm -rf {} \;

Conclusion

ArangoDB 3.12 is running on your Ubuntu 24.04 or Debian 13 server with the web interface, authentication, and automated backups configured. The multi-model approach means you can handle documents, graphs, and key-value lookups without juggling multiple database engines.

For production hardening, enable TLS for all connections, place the web UI behind a reverse proxy with SSL, set up monitoring with a time-series database for performance metrics, and test your backup restores regularly. The official ArangoDB documentation covers clustering and replication for high-availability setups.

Related Articles

Databases How To Install PostgreSQL 17 on Kali Linux 2025.x AlmaLinux Install Azure Data Studio on Rocky / AlmaLinux 8 Desktop How To Install Google Chrome on Ubuntu 24.04 Linux Mint Install Linux Kernel 5.15 on Ubuntu / Linux Mint

Leave a Comment

Press ESC to close