Qdrant in EC2
Step 1: Choose Your AWS EC2 Instance Type
Since Qdrant is lightweight, you don’t need a high-end instance. The best options are:
- t3.micro (Free Tier, Small Datasets)
- t3.medium (Recommended for Medium-Sized Data)
- t3.large (Best for Larger Scale, More Memory)
- GPU Instance (If You Want to Run ML Alongside Qdrant, e.g., g4dn.xlarge)
I am choosing t3:medium
Step 2: Launch an EC2 Instance and Install Qdrant
-
Go to AWS EC2 Dashboard.
-
Click Launch Instance.
-
Choose Ubuntu 22.04 (or another Linux distribution).
-
Select an instance type (t3.medium or larger recommended).
-
Set Storage: At least 10GB (more if you expect a lot of embeddings).
-
Configure Security Group:
- Open Port 6333 (Qdrant API). TCP
- Open Port 22 (SSH, for admin access).
-
Click Launch and connect via SSH:
ssh -i your-key.pem ubuntu@your-instance-ip
Step 3: Install Docker
sudo apt update && sudo apt install docker.io -y
sudo systemctl start docker
sudo systemctl enable docker
To avoid using sudo with Docker, add your user (ubuntu) to the docker group:
sudo usermod -aG docker ubuntu
Note: Log out and log back in (or run newgrp docker
) to apply group changes.
Step 4: Prepare the Persistent Storage Directory
Create a directory on the host that Qdrant will use to store its data:
mkdir -p ~/qdrant_storage
Since the official Qdrant Docker image runs as a non‑root user with UID 1001, change the directory’s ownership so that it is writable:
sudo chown -R 1001:1001 ~/qdrant_storage
You can verify the permissions:
ls -ld ~/qdrant_storage
You should see that the owner is 1001
(or at least that the directory is writable by the container user).
Step 5: Run the Qdrant Docker Container
Now, run the container with the proper port binding and volume mount. In this example, we expose port 6333 (the Qdrant API port) to the host and mount our persistent storage directory:
docker run -d \
--name qdrant \
-p 6333:6333 \
-v ~/qdrant_storage:/qdrant/storage \
qdrant/qdrant
-d
runs the container in detached mode.-p 6333:6333
publishes the container’s port 6333 to the host.-v ~/qdrant_storage:/qdrant/storage
mounts your storage directory inside the container.
Step 6: Test the Qdrant API
List all collections (initially, there should be none):
curl http://3.234.72.121:6333/collections
You should get a JSON response like:
{"result": []}