1. Size the Server
Qdrant's capacity-planning guide adds up memory per part, then about 20% headroom:
| Part | Formula |
|---|---|
| Dense vectors (float32) | points × replicas × dimensions × 4 bytes |
| Search index (HNSW, m = 16) | points × replicas × 16 × 2 × 4 bytes × 1.2 |
| Point IDs | points × replicas × 52 bytes |
On a single server the replication factor is 1, so a million 768-dimension vectors come to roughly 3 GB for the vectors themselves. Payloads (the text and metadata stored with each vector) are memory-mapped from disk by default and loaded when needed. Qdrant notes that keeping half as many vectors in memory roughly doubles search latency, so give it the memory if speed matters. It wants local SSD or NVMe, with at least 50,000 IOPS for vectors kept on disk; every VPS and dedicated server of ours uses local storage.
2. Run Qdrant With an API Key
On Ubuntu 24.04, after securing the server and installing Docker, create ~/qdrant/compose.yaml:
services:
qdrant:
image: qdrant/qdrant
restart: always
ports:
- "127.0.0.1:6333:6333" # REST API and dashboard, on the server only
- "127.0.0.1:6334:6334" # gRPC
environment:
QDRANT__SERVICE__API_KEY: ${QDRANT_API_KEY}
volumes:
- ./qdrant_data:/qdrant/storage
- ./qdrant_snapshots:/qdrant/snapshotscd ~/qdrant echo "QDRANT_API_KEY=$(openssl rand -hex 32)" > .env docker compose up -d curl -s -H "api-key: $(grep -oP '(?<==).*' .env)" http://127.0.0.1:6333/collections
Binding to 127.0.0.1 matters: Docker publishes ports past ufw, so a plain 6333:6333 would put an open database on the internet (see why ufw does not block Docker ports). Pin the image to a version tag once you are happy with it, so updates happen when you choose.
3. Store and Search Vectors
From Python on the same server, with pip install qdrant-client:
import os
from qdrant_client import QdrantClient
from qdrant_client.models import Distance, VectorParams, PointStruct
client = QdrantClient(url="http://localhost:6333", api_key=os.environ["QDRANT_API_KEY"])
client.create_collection(
collection_name="docs",
vectors_config=VectorParams(size=4, distance=Distance.DOT),
)
client.upsert(
collection_name="docs",
wait=True,
points=[PointStruct(id=1, vector=[0.05, 0.61, 0.76, 0.74], payload={"city": "Berlin"})],
)
hits = client.query_points(collection_name="docs", query=[0.2, 0.1, 0.9, 0.7], limit=3).points
print(hits)In a real application, size is your embedding model's dimension (768 or 1,536 are common), and the vectors come from that model. To browse collections in the dashboard, open an SSH tunnel and visit http://localhost:6333/dashboard:
ssh -L 6333:127.0.0.1:6333 [email protected]
4. Reach It From Other Servers
When your application runs elsewhere, do not publish 6333 to the internet. Between our servers in the same location, use private networking and bind the port to the private address instead of 127.0.0.1; elsewhere, use WireGuard. For read-only clients, Qdrant also accepts a second key, QDRANT__SERVICE__READ_ONLY_API_KEY. Across any network you do not control, turn on Qdrant's TLS as well, so the API key is not sent in the clear.
Backups With Snapshots
KEY=$(grep -oP '(?<==).*' ~/qdrant/.env) curl -X POST -H "api-key: $KEY" http://127.0.0.1:6333/collections/docs/snapshots ls -R ~/qdrant/qdrant_snapshots/
Each snapshot is a single file in the snapshots folder. Copy it off the server, for example to a storage box or object storage, and delete old ones. Snapshots restore only into the same or the next minor version of Qdrant, so take a fresh one before each upgrade. To run the language model behind your RAG app on your own hardware too, see Open WebUI with Ollama or serving an LLM API.