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:

I am choosing t3:medium

Step 2: Launch an EC2 Instance and Install Qdrant

  1. Go to AWS EC2 Dashboard.

  2. Click Launch Instance.

  3. Choose Ubuntu 22.04 (or another Linux distribution).

  4. Select an instance type (t3.medium or larger recommended).

  5. Set Storage: At least 10GB (more if you expect a lot of embeddings).

  6. Configure Security Group:

    • Open Port 6333 (Qdrant API). TCP
    • Open Port 22 (SSH, for admin access).
  7. 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

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": []}