AI

Install Milvus on Ubuntu

Milvus is a free, open-source vector database for AI and machine learning applications. Developed by Zilliz, Milvus is designed to manage and search the large-scale vectorized data which provides flexibility, scalability, and reliability.

As a popular vector database, we can use Milvus to build various AI applications such as speech recognition, natural language process, recommendation systems, and more.

This is because unlike the relational databases, a vector database such as Milvus is designed from the ground up to handle the unstructured data, index it, and build patterns from the provided data.

In this tutorial, we will learn how to start with the Milvus vector database by installing it on the Ubuntu system.

Requirements:

To follow along with this tutorial, ensure that you have the following:

  1. Ubuntu 20.04 and higher
  2. Docker 19.03 and above
  3. Docker Compose 1.25.1 and later

We can learn how to configure Milvus on the Ubuntu system with the given requirements.

NOTE: This tutorial demonstrates how to install Milvus on Ubuntu using the Ubuntu version 23.04.

Install the Milvus Standalone Using the Docker Compose

The first step is to download the Docker Compose YAML file to configure Milvus. Then, you can run the “wget” command as follows:

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

This command should download the Milvus docker-compose file which allows you to configure the Docker container to your needs.

Run the Milvus Container

Once you downloaded the YAML file, run the docker-compose command in the same directory as the Milvus YAML file.

The command is as follows:

$ sudo docker-compose up -d

The previous command should create, start, and detach the services that are specified in the Docker Compose file by running them in the background.

You can open the YAML file with your editor and make any changes to the file before running the previous command. However, you can use the default configuration to get a standard Milvus server running.

Once completed, you can check if the container is running using the following command:

$ sudo docker-compose ps

Once the Milvus standalone starts, three Docker containers will be running, including the Milvus standalone service and its two dependencies.

To stop the containers, run the following command:

$ sudo docker-compose down

This should stop the Milvus containers and its associated services.

Install Milvus with APT

We can also install Milvus using the APT package manager. We can also do this using the Ubuntu Launchpad and Deb packages.

Run the following commands as follows:

$ sudo apt install software-properties-common

Next, add the PPA repository:

$ sudo add-apt-repository ppa:milvusdb/milvus

Then, update the packages:

sudo apt update

Finally, install Milvus:

sudo apt install milvus

Install Milvus with Deb Packages

If you don’t wish to use the Launchpad and PPA packages, you can download the “.deb” package installer as shown in the following commands:

$ wget https://github.com/milvus-io/milvus/releases/download/v2.1.4/milvus_2.1.4-1_amd64.deb

Update the software repositories:

$ sudo apt-get update

Finally, run the “dpkg” command to install Milvus as shown in the following:

$ sudo dpkg -I milvus_2.1.4-1_amd64.deb

$ sudo apt-get -f install

Once completed, you should have the Milvus server installed and ready to go on your Ubuntu system.

Conclusion

In this tutorial, we explored how to setup a standalone Milvus server on Ubuntu using Docker, Launchpad, and APT. Stay tuned for more Milvus tutorials.

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