Hello. In this post, I will teach you how to deploy ArangoDB using Docker compose. It will be brief but explained step by step.
Briefly, I will tell you that Docker compose is more thought of production environments where compatibility should be as high as possible. This is precisely the great advantage of Docker images that we will be able to use in any supported system thanks to the technology of containers. Then, these steps can be done from any Linux distribution that has installed Docker and Docker Compose.
ArangoDB is a native multi-model, open-source database with flexible data models for documents, graphs, and key-values. Build high-performance applications using a convenient SQL-like query language or JavaScript extensions. Use ACID transactions if you require them. Scale horizontally and vertically with a few mouse clicks.
So, let us start.
Install Docker and Docker Compose on Linux
The first step is to have Docker installed in the system, obviously.
- If you are using Ubuntu: How to install Docker on Ubuntu 18.04?
- For CentOS 8: How to install Docker on CentOS 8?
- For CentOS 7: How to install Docker CE on CentOS 7?
- If you use Windows: How to install Docker in Windows 10?
- Or, if you are using Debian 10: How to install Docker on Debian 10?
And using your distribution’s package manager, you can install Docker Compose. For example:
:~$ sudo apt docker-compose
For Debian, Ubuntu, and derivatives.
:~$ sudo dnf install docker-compose
Or, for RHEL, CentOS and derivatives.
Deploy ArangoDB using Docker Compose
First, I will create a folder called arangodb
and within it a file called docker-compose.yml
which is where we will add the instructions.
:~$ mkdir arangodb :~$ cd arangodb
Now we’ll create the docker-compose file and add the following:
:~$ nano docker-compose.yml
version: '3.1' services: arangodb: image: arangodb:latest restart: always ports: - 1234:8529 environment: ARANGO_ROOT_PASSWORD: angelo123osradar volumes: - /home/angelo/arangodb_data:/var/lib/arangodb3
Now we proceed to explain. First, I’m using the latest version of ArangoDB. Then, I expose port 8529 which is the image port to 1234 of our host system. You can use another port if you want.
On the other hand, in the environment section, I define an initial password for the root user. And a volume to access the container data. I have chosen /home/angelo/arangodb_data
but you choose the one you want. Remember that before you raise the image you must create it.
Then, create the data folder and start the deployment.
:~$ mkdir/home/angelo/arangodb_data
:~$ sudo docker-compose up -d
When you finish, you can access the ArangoDB web interface. Open your browser and go to http://your-server:1234
. You will see the following:
Then, type your credentials. Keep in mind that the default user is root. After that, you will see this:
Finally, you will see the dashboard.
And that is it.
Conclusion
ArangoDB is a NoSQL database manager quite important in the current market. Deploying ArangoDB using Docker compose is simple but with many options available.
If you want more information, I recommend you to visit the official documentation of the image.