If you want a fast vector database for RAG and semantic search, this guide shows the fastest way to install Qdrant on a Linux VPS and make it ready for real app queries. Qdrant supports Docker-based deployment, REST and gRPC interfaces, collections, points, and vector search features that fit retrieval workloads well.
In this article, you will learn to install Qdrant on a Linux VPS, secure it, create the first collection, insert records, and test search with practical examples for RAG.
Why Qdrant fits RAG
Qdrant is an open-source vector search engine built for storing embeddings and querying them by similarity, which makes it a strong fit for retrieval-augmented generation and semantic search applications. It supports collections, points, payload filters, and API access that can be used directly from backend apps and AI pipelines.
If you are still comparing options, read this guide on the best vector database for RAG.
Server Requirements to Install Qdrant on a Linux VPS
Before you install Qdrant on a Linux VPS, you must prepare a clean Ubuntu server with sudo access and Docker support. Qdrant officially supports installation with Docker, binary builds, and Kubernetes, but Docker is the easiest path for a VPS setup.
You should have:
- Ubuntu 22.04 or 24.04
- SSH access with sudo
- At least 2 vCPU and 2 GB RAM for small tests
- More RAM and storage for larger RAG workloads
A stable Linux VPS is a good option for self-hosted vector search. If you also run embedding models or AI workloads on the same stack, you can check AI Hosting for heavy deployments.
Step 1. Update Ubuntu, Install Docker, and Secure VPS
You must start by updating the system packages before you install Qdrant on a Linux VPS. This helps avoid package conflicts and makes the server ready for Docker-based service:
sudo apt update && sudo apt upgrade -y
Qdrant’s quickstart shows Docker as the simplest local and self-hosted deployment method. You must install Docker from the official repository, not from an old distro package, so you get the current engine and compose support:
sudo apt install ca-certificates curl gnupg -ysudo install -m 0755 -d /etc/apt/keyringscurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpgsudo chmod a+r /etc/apt/keyrings/docker.gpg 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 sudo apt updatesudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -ysudo systemctl enable --now docker
Check that Docker works by checking the version:
docker --versionsudo docker compose version
Before exposing any service, add basic firewall rules. Qdrant commonly uses port 6333 for REST and 6334 for gRPC. It is safer to keep these bound to localhost and let your app or reverse proxy connect internally:
sudo apt install ufw -ysudo ufw allow OpenSSHsudo ufw allow 80/tcpsudo ufw allow 443/tcpsudo ufw default deny incomingsudo ufw default allow outgoingsudo ufw enablesudo ufw status verbose
Now you are ready to install Qdrant on a Linux VPS with Docker.
Step 2. Create the Qdrant stack
First, create a project folder and generate a strong API key with the commands below:
mkdir -p ~/qdrant && cd ~/qdrantopenssl rand -hex 32
Qdrant supports environment variable configuration with the QDRANT__ prefix, and the service API key can be set with QDRANT__SERVICE__API_KEY. That makes Docker Compose a clean way to install Qdrant on a Linux VPS while keeping configuration simple.
Create the Docker compose YAML file with the command below:
Add the following config to the file:
1services:2 qdrant:3 image: qdrant/qdrant:latest4 container_name: qdrant5 restart: unless-stopped6 ports:7 - "127.0.0.1:6333:6333"8 - "127.0.0.1:6334:6334"9 volumes:10 - qdrant_storage:/qdrant/storage11 environment:12 - QDRANT__SERVICE__API_KEY=REPLACE_WITH_YOUR_API_KEY13 - QDRANT__LOG_LEVEL=INFO14 15volumes:16 qdrant_storage:
Save and close the file.
qdrant/qdrant:latest pulls the official image.
127.0.0.1 keeps the API local to the server.
/qdrant/storage is the correct storage path used by Qdrant containers.
- The named volume keeps your data after restarts.
Then, start the stack with the command below:
sudo docker compose up -dsudo docker compose pssudo docker compose logs qdrant
At this point, you have successfully started to install Qdrant on a Linux VPS.
Verify the service
Once the container is up, test the health endpoint locally:
curl http://localhost:6333/healthz
You can list collections with the API key:
curl -X GET http://localhost:6333/collections \ -H "api-key: REPLACE_WITH_YOUR_API_KEY"
If you get a valid JSON response, the Qdrant installation process is working correctly.
Step 3. Create the First Qdrant Collection
A collection is where Qdrant stores vectors and related payload data. To create a collection, send a request with vector size and distance metric:
curl -X PUT http://localhost:6333/collections/rag_docs \ -H "Content-Type: application/json" \ -H "api-key: REPLACE_WITH_YOUR_API_KEY" \ -d '{ "vectors": { "size": 384, "distance": "Cosine" } }'
For text embeddings in RAG, Cosine is the normal default:
| Setting |
Value |
| Collection name |
rag_docs |
| Vector size |
384 |
| Distance |
Cosine |
This is a good starter setup when you install Qdrant on a Linux VPS for semantic search.
Step 4. Insert your First Records
Qdrant stores data as points, and each point can include an ID, a vector, and payload fields. This payload is what your app can return later as context for a language model:
curl -X PUT http://localhost:6333/collections/rag_docs/points \ -H "Content-Type: application/json" \ -H "api-key: REPLACE_WITH_YOUR_API_KEY" \ -d '{ "points": [ { "id": 1, "vector": [0.12, 0.21, 0.31, 0.44], "payload": { "text": "Qdrant stores embeddings for semantic search.", "source": "kb/qdrant.txt", "topic": "vector-db" } }, { "id": 2, "vector": [0.15, 0.25, 0.35, 0.40], "payload": { "text": "RAG retrieves relevant chunks before generation.", "source": "kb/rag.txt", "topic": "rag" } } ] }'
Notes: The upsert API inserts new points and overwrites points with the same ID if they already exist. In a real setup, after you install Qdrant on a Linux VPS, these vectors should come from your embedding model, and they must match the exact collection size.
Step 5. Test Semantic Search
After inserting data, you can run a similarity search query. Qdrant supports REST and SDK-based search for matching vectors:
curl -X POST http://localhost:6333/collections/rag_docs/points/query \ -H "Content-Type: application/json" \ -H "api-key: REPLACE_WITH_YOUR_API_KEY" \ -d '{ "query": [0.12, 0.22, 0.30, 0.41], "limit": 2, "with_payload": true }'
If your query vector is close to the inserted records, Qdrant returns the closest matches with payload data. That is the core retrieval step used when you install Qdrant on a Linux VPS for a RAG app.
You can also filter by payload fields to narrow the search to one topic or source, which is useful in multi-document knowledge bases.
Python Client Example: Connect to Qdrant with Python
The Python client is available through qdrant-client. You can install it with:
pip install qdrant-client
1from qdrant_client import QdrantClient, models2 3client = QdrantClient(4 url="http://localhost:6333",5 api_key="REPLACE_WITH_YOUR_API_KEY"6)7 8client.create_collection(9 collection_name="rag_docs_py",10 vectors_config=models.VectorParams(size=4, distance=models.Distance.COSINE)11)12 13client.upsert(14 collection_name="rag_docs_py",15 points=[16 models.PointStruct(17 id=1,18 vector=[0.1, 0.2, 0.3, 0.4],19 payload={"text": "Install Qdrant on a Linux VPS for RAG apps.", "source": "guide"}20 )21 ]22)23 24result = client.query_points(25 collection_name="rag_docs_py",26 query=[0.1, 0.2, 0.3, 0.39],27 limit=1,28 with_payload=True29)30 31print(result)
This gives your app the normal flow, creates embeddings, queries Qdrant, and passes the returned context to the LLM. For larger AI stacks, this guide on RAG pipelines using GPU servers is a useful next read.
Safe Ways to Access Qdrant
If you install Qdrant on a Linux VPS and want remote access, do not expose port 6333 directly unless you fully understand the risk. Safer options are:
- Keep Qdrant on localhost only.
- Connect from your app on the same VPS.
- Use an SSH tunnel for temporary remote access.
- Put Nginx or Caddy in front with HTTPS and access control.
For example, an SSH tunnel looks like this:
ssh -L 6333:localhost:6333 user@your-server-ip
Then open http://localhost:6333/dashboard in your browser.
For more details on securing your instance in production, see the official Qdrant Security guide.
Conclusion
To install Qdrant on a Linux VPS the right way, use Docker, keep ports local, enable an API key, mount persistent storage, and test the collection and query flow before connecting your app. This gives you a clean setup for semantic search and RAG without adding extra complexity.