AI

Install Milvus Using Docker

Milvus is an open-source vector database designed for efficient storage, retrieval, and similarity search of high-dimensional vectors. It is built to handle large-scale vector data that are commonly used in machine learning, data mining, computer vision, and natural language processing applications.

Milvus leverages the concept of embeddings which are numeric representations of data points in a high-dimensional vector space. These embeddings can be generated from various data types such as images, audio, text, or structured and unstructured data.

Before we can use Milvus, we need to ensure that we have it installed and running. In this post, we will cover how we can configure and run Milvus on Ubuntu using Docker.

Update the System Packages

First, let’s update the system packages to ensure the latest versions are available. Open a terminal and run the following command:

$ sudo apt-get update

Install Docker

We deploy a Milvus server using Docker for this tutorial. Let’s start by installing Docker.

Start by importing the repository GPG keys:

$ sudo install -m 0755 -d /etc/apt/keyrings
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
$ sudo chmod a+r /etc/apt/keyrings/docker.gpg

Add the repository:

echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"
$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Update the repos and install Docker:

$ sudo apt-get update

Install Docker:

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Run the Milvus Container

Once you have Docker configured, download the YAML configuration file to set up the cluster.

wget https://github.com/milvus-io/milvus/releases/download/v2.2.10/milvus-standalone-docker-compose.yml -O docker-compose.yml

Once you have the file downloaded, run the “docker compose” command to start the container as follows:

sudo docker compose up -d

The previous command should use all the configurations that are defined in the YAML file to deploy a standalone Milvus cluster.

You can then connect to the server using the following command:

docker port milvus-standalone 19530/tcp

This command should drop you to the Milvus CLI which allows you to execute the commands on the Milvus sever.

Once done, you can stop the cluster with the following command:

sudo docker compose down

Conclusion

We described the steps that you can use to install and configure the Milvus vector database server on Ubuntu using Docker.

About the author

John Otieno

My name is John and am a fellow geek like you. I am passionate about all things computers from Hardware, Operating systems to Programming. My dream is to share my knowledge with the world and help out fellow geeks. Follow my content by subscribing to LinuxHint mailing list