How to start ArangoDB with Docker

Tue, Jun 6, 2023

Read in 1 minutes

How to get ArangoDB up and running

Start a Server

Start with docker run

sudo docker run -e ARANGO_RANDOM_ROOT_PASSWORD=1 -p 8529:8529 -d --name arangodb-instance arangodb

The root password will be automatically generated. In order to discover it you have to check the docker logs.

sudo docker logs arangodb-instance

But this method gets cumbersome and the password, which will appear at the beginning of the logs, can be hard to copy. So use instead this command in order to retrieve it from the logs and store it directly to a .env file.

echo "DB_PASSWORD=$(sudo docker logs arangodb-instance | sed -n 's/.*GENERATED ROOT PASSWORD: \(.*\)$/\1/p')" > .env

Now you have the password, which you don’t know, stored in a .env file which you can copy into the root of your working directory, which you can check by entering the .env file or by typing

cat .env

You can check that the database is working properly by accessing it at http://localhost:8529 using the username root and the password from the .env file.