Arango logo

Get started with ArangoDB

Run the open-source ArangoDB database in a Docker container, store your first documents, and query them with AQL

Run a single-node ArangoDB instance on your machine, store a few documents, and query them. Takes about two minutes, most of it pulling the container image.

Prerequisites

  • Docker: Docker Desktop  or Docker Engine installed and running.
  • Resources: 2 GB of available memory.
  • Ports: Port 8529 free on localhost.

Start the container

docker run -d --name arangodb \
  -p 8529:8529 \
  -e ARANGO_ROOT_PASSWORD=openSesame \
  -e LANG=en_US.UTF-8 \
  arangodb:3.12

The LANG variable sets the language the server is initialized to. It only takes effect on the first run, when the database directory is created, and cannot be changed afterwards without re-initializing.

openSesame is a placeholder. Pick your own password - it is set once, on the first run, and this instance is only meant for local evaluation.

On Apple silicon and other ARM machines, add --platform linux/arm64/v8 to the command. See Install with Docker for the full set of container options.

Confirm it is running

curl http://localhost:8529/_api/version

You should see a response like the following:

{"server":"arango","license":"community","version":"3.12.4"}

If the request is refused, the server may still be starting up. Check the logs with docker logs arangodb.

Open the web interface

Go to http://localhost:8529  and log in as root with the password you set.

The web interface gives you a query editor, a collection browser, and a graph viewer.

Store and query some data

Open the ArangoDB shell inside the running container:

docker exec -it arangodb arangosh --server.password openSesame

Create a collection and insert three documents:

db._create("people");

db.people.save({ _key: "einstein", name: "Albert Einstein", field: "Physics", nobel: 1921 });
db.people.save({ _key: "bohr", name: "Niels Bohr", field: "Physics", nobel: 1922 });
db.people.save({ _key: "heisenberg", name: "Werner Heisenberg", field: "Physics", nobel: 1932 });

Query them with AQL:

db._query(`
  FOR p IN people
    FILTER p.nobel < 1930
    SORT p.nobel
    RETURN p.name
`).toArray();

You should see this:

[
  "Albert Einstein",
  "Niels Bohr"
]

Type exit to leave the shell.

You now have a running ArangoDB instance with a collection you can query. The same AQL runs unchanged from every driver and against the HTTP API.

Keep your data between restarts

The container above stores its data inside the container. Removing the container removes the data. To keep it, mount a volume:

docker run -d --name arangodb \
  -p 8529:8529 \
  -e ARANGO_ROOT_PASSWORD=openSesame \
  -e LANG=en_US.UTF-8 \
  -v arangodb-data:/var/lib/arangodb3 \
  -v arangodb-apps:/var/lib/arangodb3-apps \
  arangodb:3.12

Clean up

docker stop arangodb
docker rm arangodb

Next steps