Development

Weaviate Database Install Docker

In this tutorial, we will show you how to configure a Weaviate cluster using Docker and Docker Compose.
Captain Salem 3 min read
Weaviate Database Install Docker

Weaviate is an open-source, decentralized knowledge graph for vector-based, real-time semantic search and recommendation systems. It leverages the power of graph databases and machine learning to efficiently organize and retrieve complex data structures.

Weaviate is built on a schema-driven approach, representing data as entities and their relationships. It utilizes word embeddings to transform textual data into high-dimensional vectors, enabling similarity-based searches and contextual recommendations.

The best way to learn Weaviate is a hands-on approach.

Requirements

In this tutorial, we will demonstrate the installation methods and process using:

  1. An Ubuntu system (22.04)
  2. A sudo or root user.

Installing Docker on Ubuntu

The first step is to install Docker and Docker Compose on Ubuntu. Start by refreshing the system repositories as:

sudo apt-get update

Once updated, run the command below to remove any conflicting packages that are associated with Docker or Docker components:

for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done

Next, install the packages to allow APT to download packages over HTTPS protocol:

sudo apt-get install ca-certificates curl gnupg

In the next step, add the Docker’s official GPG key with the command:

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

Once imported, run the command below to setup 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

Finally, update the system repositories and install Docker and associated components as shown:

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

This should download the Docker engine, Docker compose, and all associated packages.

Configuring Weaviate

Once we have Docker on our machine, we can configure the docker-compose.yml file, which we will use to launch the Weaviate cluster.

Luckily, Weaviate provides us with a graphical-based configurator that allows us to select the modules and features of Weaviate that we wish to include.

Open your browser and navigate to the link below:

Docker | Weaviate - Vector Database
Weaviate supports deployment with Docker.

Locate the configuration tool and follow the procedure, selecting the tools and features you wish to include in your Weaviate cluster.

Once completed, you will get the commands to download the docker-compose.yml as shown in the example below:

curl -o docker-compose.yml "https://configuration.weaviate.io/v2/docker-compose/docker-compose.yml?modules=standalone&runtime=docker-compose&weaviate_version=v1.26.1&weaviate_volume=named-volume"

The above command downloads a standalone copy of the Weaviate cluster with no modules. You can check the file with your editor to view the options on the container.

You should get an example configuration.

The next step is to start the Docker container; we can use the command as shown:

docker-compose up -d

Once started, you can use API clients such as cURL to ping the container on port 8080.

Conclusion

In this tutorial, you learned using the Weaviate configurator to create a basic Weaviate standalone cluster using Docker Engine.

Share
Comments
More from Cloudenv

Cloudenv

Developer Tips, Tricks and Tutorials.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Cloudenv.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.