> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# ArangoDB

> Ready-to-run ArangoDB container template you can run directly or inherit to integrate a multi-model NoSQL database into your stack.

## Overview

This template provides a production‑ready ArangoDB instance as a Monk runnable. You can:

* Run it directly to get a managed ArangoDB container with sensible defaults
* Inherit it in your own runnable to seamlessly add a multi-model database to your stack

ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. It supports SQL-like queries with AQL (ArangoDB Query Language) and provides built-in graph traversal capabilities.

## What this template manages

* ArangoDB container (`arangodb` image, configurable tag)
* Network service on port 8529
* Persistent volumes for data storage
* Root user authentication

## Quick start (run directly)

1. Load templates

```bash theme={null}
monk load MANIFEST
```

2. Run ArangoDB with defaults

```bash theme={null}
monk run arangodb/db
```

3. Customize credentials (recommended via inheritance)

Running directly uses the defaults defined in this template's `variables`. Secrets added with `monk secrets add` will not affect this runnable unless you inherit it and reference those secrets.

* Preferred: inherit and replace variables with `secret("...")` as shown below.
* Alternative: fork/clone and edit the `variables` in `arangodb.yml`, then `monk load MANIFEST` and run.

Once started, connect to `localhost:8529` (or the runnable hostname inside Monk networks) using the configured credentials.

## Configuration

Key variables you can customize in this template:

```yaml theme={null}
variables:
  image: "latest"                    # container image tag
  root_password: "monk"              # ROOT password (env: ARANGO_ROOT_PASSWORD)
  db_port: 8529                      # ArangoDB port
```

Data is persisted under `${monk-volume-path}/arangodb/data` on the host.

## Use by inheritance (recommended for apps)

Inherit the ArangoDB runnable in your application and declare a connection. Example:

```yaml theme={null}
namespace: myapp
db:
  defines: runnable
  inherits: arangodb/db
api:
  defines: runnable
  containers:
    api:
      image: myorg/api
  connections:
    database:
      runnable: db
      service: db
  variables:
    database-host:
      value: <- connection-hostname("database")
    database-password:
      value: <- secret("arango-root-password")
```

Then set the secrets once and run your app group:

```bash theme={null}
monk secrets add -g arango-root-password="STRONG_ROOT_PASSWORD"
monk run myapp/api
```

## Ports and connectivity

* Service: `db` on TCP port `8529`
* From other runnables in the same process group, use `connection-hostname("\<connection-name>")` to resolve the DB host.

## Persistence and configuration

* Data path: `${monk-volume-path}/arangodb/data:/var/lib/arangodb3`
* ArangoDB stores documents, graphs, and key-value data in the same database

## Related templates

* For ArangoDB cluster, configure coordinators, DB servers, and agents
* Use with graph analytics and machine learning workflows
* Combine with `grafana/` for performance visualization

## Troubleshooting

* If you changed `root_password` but the container has existing data, authentication may fail. Either reset the data volume or update the password inside the DB to match.
* Ensure the host volumes are writable by the container user.
* Check logs:

```bash theme={null}
monk logs -l 500 -f local/arangodb/db
```
