How to Self-Host Qdrant: Step-by-Step Guide
This page may contain affiliate links. If you buy through them we may earn a commission at no extra cost to you.
Direct answer: self-hosting Qdrant gets you the full Apache-2.0 engine, hybrid search, quantization, and no feature gate versus the managed cloud, running on your own infrastructure in under ten minutes with Docker. This guide covers the setup most quick-start tutorials skip past: configuring collections correctly the first time, turning on quantization before you need it, securing the instance with an API key, and backing it up with snapshots rather than a raw file copy.
What you need before you start
You need a server or VPS with Docker installed, and that's genuinely most of it. Qdrant is written in Rust and runs efficiently on CPU alone; a 2-4 vCPU VPS with 4GB of RAM comfortably handles a collection in the hundreds of thousands of vectors for development or a small production workload. Scale that up as your stored vector count and query concurrency grow, and reach for quantization, covered below, before reaching for a bigger server.
Step 1: Run Qdrant with Docker
Pull and start the official image with a persistent volume so your data survives a container restart:
docker run -d --name qdrant \
-p 6333:6333 -p 6334:6334 \
-v $(pwd)/qdrant_storage:/qdrant/storage \
qdrant/qdrant
Port 6333 serves the REST API, and 6334 serves gRPC, which most official client libraries (Python, TypeScript, Go, Rust, Java) use by default for lower-latency calls. Within a minute, http://localhost:6333/dashboard gives you a basic web UI to inspect collections and run test queries.
Step 2: Design your collection before you create it
This is the step worth slowing down for. Creating a collection means deciding, upfront, on the vector size (matching your embedding model's output dimensions), the distance metric (cosine is the common default for most embedding models), and whether you need named vectors for hybrid dense-plus-sparse search. Retrofitting hybrid search onto a collection you already created as dense-only means reindexing everything, not a quick config change, so decide this before you load real data, not after.
from qdrant_client import QdrantClient
from qdrant_client.models import VectorParams, Distance
client = QdrantClient(url="http://localhost:6333")
client.create_collection(
collection_name="agent_memory",
vectors_config=VectorParams(size=1536, distance=Distance.COSINE),
)
If you're storing both an agent's conversation facts and document chunks for RAG in the same collection, add a payload index on fields like user_id or source_doc at creation time, so the agent can filter to the current user before the vector search even runs, rather than filtering after the fact.
Step 3: Turn on quantization once you have real volume
Quantization is Qdrant's standout lever for controlling memory cost as a collection grows, and it's worth knowing about even if you don't enable it on day one. Scalar quantization compresses vectors to int8 with a small, measurable accuracy tradeoff you control; binary quantization compresses further still, for workloads that can tolerate a larger tradeoff in exchange for a bigger memory win. Enable it on an existing collection with an update call, no need to recreate it:
from qdrant_client.models import ScalarQuantization, ScalarQuantizationConfig
client.update_collection(
collection_name="agent_memory",
quantization_config=ScalarQuantization(
scalar=ScalarQuantizationConfig(type="int8", quantile=0.99, always_ram=True)
),
)
Benchmark retrieval accuracy before and after on a held-out query set before enabling quantization in production; the tradeoff is genuinely small for most embedding models, but "small" isn't "zero," and it's worth confirming for your specific data.
Step 4: Secure it with an API key
Qdrant has no authentication enabled by default, which is fine for local development and a real problem the moment the instance is reachable from anywhere else. Set an API key by passing an environment variable to the container:
docker run -d --name qdrant \
-p 6333:6333 -p 6334:6334 \
-v $(pwd)/qdrant_storage:/qdrant/storage \
-e QDRANT__SERVICE__API_KEY=your-generated-key \
qdrant/qdrant
Generate that key the same way you'd generate any secret, with openssl rand -base64 32, rather than typing something memorable. Every client call now needs to send that key in the api-key header; update your application code before you flip this on, or you'll lock yourself out along with everyone else.
Step 5: Put TLS in front of it
Don't expose Qdrant's raw ports directly to the internet, even with an API key set. Put Caddy or Nginx in front of it as a reverse proxy, terminating TLS there and forwarding to the container over your Docker network, and firewall the server so only 80 and 443 are reachable externally. An API key protects against unauthorized access; TLS protects that same key, and every vector and payload you send, from being readable in transit.
Step 6: Back up with snapshots, not a file copy
Qdrant's storage directory isn't meant to be backed up by copying files while the service is running; use its built-in snapshot feature instead, which captures a collection's full state, vectors, payloads, and index, to a portable file:
curl -X POST http://localhost:6333/collections/agent_memory/snapshots \
-H "api-key: your-generated-key"
Ship the resulting snapshot file off-server on a schedule, the same discipline you'd apply to a database dump. A snapshot taken this way also restores cleanly on Qdrant Cloud if you ever want to migrate to a managed instance, since both run the identical engine.
Common mistakes to avoid
Skipping named vectors at collection creation and then wanting hybrid search later is the mistake that costs the most rework; decide on your search model before loading real data. Leaving the default no-auth configuration exposed beyond localhost is the second, and it's a genuine security gap, not a theoretical one, the moment the port is reachable from outside your network. And treating the storage directory as a plain filesystem backup, instead of using snapshots, is the third; it works until it doesn't, and you won't find out which until you actually need the restore.
What's next
Once your instance is running, our Qdrant vs Pinecone for AI agents comparison covers how this self-hosted setup stacks up against a fully managed alternative for agent memory specifically, and our best self-hosted vector databases for RAG roundup covers how Qdrant compares to Milvus, Weaviate, Chroma, and pgvector if you're still confirming it's the right engine for your scale. If you're connecting Qdrant to a RAG platform rather than building the pipeline by hand, our Dify vs Flowise comparison covers two options that can sit on top of it, and if long-term agent memory rather than document retrieval is the actual goal, our Mem0 vs Letta comparison covers that adjacent, higher-level layer.
Frequently asked questions
Is self-hosting Qdrant actually free?
Yes. Qdrant's engine is open source under Apache 2.0, and the self-hosted build has full feature parity with Qdrant Cloud, no capability is gated behind the managed offering. Your only cost is the server you run it on. Qdrant Cloud exists for teams that want managed hosting instead of running their own infrastructure, with its own usage-based pricing.
Do I need a GPU or powerful server to self-host Qdrant?
No, for most workloads. Qdrant's HNSW indexing runs efficiently on CPU, and a small VPS with 2-4 vCPUs and a few gigabytes of RAM handles a collection in the hundreds of thousands of vectors comfortably. You need more resources as your vector count and query concurrency grow, and quantization is the first lever to pull before resizing the server.
How do I back up a self-hosted Qdrant instance?
Use Qdrant's built-in snapshot feature, which captures a collection's full state, vectors, payloads, and index, to a file you can store off-server. A snapshot is the correct unit of backup here, not a raw filesystem copy of the storage directory, since Qdrant's on-disk format isn't meant to be backed up by copying files while the service is running.
Can I migrate from Qdrant Cloud to self-hosted later, or the other way around?
Yes, in both directions. Qdrant Cloud runs the same engine as the self-hosted build, so a snapshot taken on one side restores cleanly on the other. That portability is one of the real advantages of Qdrant's single-engine model over a vendor that only offers a managed service with no self-hosted equivalent at all.