[{"data":1,"prerenderedAt":225},["ShallowReactive",2],{"seo-verification":3,"blog-hosting-qdrant-on-a-vps-ma-en":6,"promo-bar-likely":224},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"key":7,"data":8},"blog-hosting-qdrant-on-a-vps-ma-en",{"id":9,"slug":10,"slugs":11,"title":15,"excerpt":16,"readTime":17,"views":18,"isPinned":19,"noindex":19,"publishedAt":20,"updatedAt":21,"category":22,"categories":28,"featuredImage":30,"bgImage":31,"posterImage":32,"relatedSolution":33,"intro":36,"sections":37,"ctaTitle":165,"ctaBody":166,"ctaButton":167,"ctaUrl":168,"relatedPosts":169},65,"hosting-qdrant-on-a-vps",{"fr":12,"en":10,"ar":13,"es":14},"heberger-qdrant-vps","استضافة-qdrant-على-خادم-vps","alojar-qdrant-en-un-vps","Hosting Qdrant on a VPS","Host Qdrant on your VPS: Docker Compose, API key, TLS, HNSW tuning, quantization, Python v1 client, snapshots and Prometheus monitoring.",8,1,false,"2026-04-16T00:00:00+00:00","2026-10-20T23:18:05+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},6,"Databases","bases-de-donnees","bg-teal-500\u002F10 text-teal-400","database",[29],{"id":23,"name":24,"slug":25,"color":26,"icon":27},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fheberger-qdrant-vps-poster.svg",{"categorySlug":34,"appSlug":35},"databases","qdrant","Qdrant is a vector database written in Rust, built for semantic search, recommendation systems and the RAG pipelines of AI applications. Lightweight and fast, it self-hosts perfectly on a VPS to keep your embeddings under your control and avoid the per-vector billing of managed services.\n\nThis guide covers the full path: installation with Docker Compose, securing with an API key and TLS reverse proxy, inserting vectors in Python with the official v1 client, tuning the HNSW index and quantization, backing up with snapshots and monitoring via the Prometheus-compatible `\u002Fmetrics` endpoint. ServOrbit NVMe SSD VPS plans start at 99 DH\u002Fmonth and handle corpora under one million vectors without any special configuration.",[38,42,52,68,71,83,98,101,125,129,136,151,154,162],{"type":39,"title":40,"body":41},"h2","Why self-host Qdrant on a VPS","Qdrant stores and queries embedding vectors to find the most semantically similar items: it is the search building block at the heart of RAG chatbots, recommendation engines and natural-language search. Written in Rust, it is fast and resource-efficient, making it ideal to host on a VPS rather than paying for a managed vector service billed per stored vector.\n\nSelf-hosting is essential for AI applications handling sensitive data: your embeddings, often derived from confidential internal documents, never leave your infrastructure. You also control latency, which is decisive when every user request triggers a vector search, and you avoid the rate limits of third-party APIs during load spikes.",{"type":43,"title":44,"items":45},"ul","Prerequisites and recommended VPS resources",[46,47,48,49,50,51],"RAM: minimum 1 GB for testing, 2 GB for a few hundred thousand vectors, 4–8 GB beyond a million high-dimensional vectors (the HNSW index lives in memory).","Storage: 20–50 GB of NVMe SSD to persist collections and snapshots.","CPU: 1–2 vCPUs are sufficient for moderate traffic; add cores if you index continuously.","Docker and Docker Compose installed on the VPS.","Ports 6333 (REST) and 6334 (gRPC) accessible from your application; 80\u002F443 for the public reverse proxy.","A DNS A record (e.g. `vectors.mydomain.com`) if you expose the API over HTTPS.",{"type":53,"title":54,"steps":55},"steps","Install Qdrant with Docker Compose",[56,59,62,65],{"title":57,"body":58},"Create the directory and compose.yml","On the VPS, create a dedicated folder: `mkdir -p \u002Fopt\u002Fqdrant && cd \u002Fopt\u002Fqdrant`. Create the following `compose.yml`:\n\n```yaml\nservices:\n  qdrant:\n    image: qdrant\u002Fqdrant:latest\n    restart: unless-stopped\n    ports:\n      - \"127.0.0.1:6333:6333\"\n      - \"127.0.0.1:6334:6334\"\n    volumes:\n      - .\u002Fqdrant_storage:\u002Fqdrant\u002Fstorage\n    environment:\n      - QDRANT__SERVICE__API_KEY=${QDRANT_API_KEY}\n```\n\nBinding ports to `127.0.0.1` prevents any direct exposure on the Internet; only the reverse proxy can reach them.",{"title":60,"body":61},"Generate the API key and start the container","Create the `.env` file with your key:\n\n```bash\necho \"QDRANT_API_KEY=$(openssl rand -hex 32)\" > .env\n```\n\nStart Qdrant:\n\n```bash\ndocker compose up -d\n```",{"title":63,"body":64},"Check instance health","Wait a few seconds then verify the health endpoint:\n\n```bash\ncurl -s http:\u002F\u002Flocalhost:6333\u002Fhealthz\n# Expected: {\"title\":\"qdrant - vector search engine\",\"version\":\"...\"}\n```",{"title":66,"body":67},"Create your first collection","Create a test collection with 384-dimensional vectors (typical format for `all-MiniLM-L6-v2`):\n\n```bash\ncurl -s -X PUT http:\u002F\u002Flocalhost:6333\u002Fcollections\u002Ftest \\\n  -H 'Content-Type: application\u002Fjson' \\\n  -H \"api-key: $(grep QDRANT_API_KEY .env | cut -d= -f2)\" \\\n  -d '{\"vectors\":{\"size\":384,\"distance\":\"Cosine\"}}'\n```",{"type":39,"title":69,"body":70},"Securing access: API key and TLS","Qdrant enables no authentication by default: an instance exposed without an API key would allow anyone to read, modify or delete all your collections. The `QDRANT__SERVICE__API_KEY` environment variable is the first line of defence; the TLS reverse proxy is the second.\n\nFor Caddy, the minimal configuration is:\n\n```\nvectors.mydomain.com {\n    reverse_proxy localhost:6333\n}\n```\n\nCaddy automatically obtains and renews the Let's Encrypt certificate. For nginx, add inside your server block:\n\n```nginx\nlocation \u002F {\n    proxy_pass http:\u002F\u002F127.0.0.1:6333;\n    proxy_set_header Host $host;\n    proxy_set_header X-Real-IP $remote_addr;\n}\n```\n\nEnable TLS with Certbot: `certbot --nginx -d vectors.mydomain.com`.",{"type":53,"title":72,"steps":73},"Test authentication and the reverse proxy",[74,77,80],{"title":75,"body":76},"Verify that unauthenticated access is rejected","```bash\ncurl -s https:\u002F\u002Fvectors.mydomain.com\u002Fcollections\n# Expected: {\"status\":{\"error\":\"Unauthorized\",...}}\n```",{"title":78,"body":79},"Authenticated call with the API key","```bash\ncurl -s https:\u002F\u002Fvectors.mydomain.com\u002Fcollections \\\n  -H \"api-key: YOUR_KEY\"\n# Expected: {\"result\":{\"collections\":[]},\"status\":\"ok\",...}\n```",{"title":81,"body":82},"Verify the TLS certificate","```bash\ncurl -sv https:\u002F\u002Fvectors.mydomain.com\u002Fhealthz 2>&1 | grep 'SSL connection\\|issuer'\n# Expected: lines confirming Let's Encrypt and TLS 1.3\n```",{"type":53,"title":84,"steps":85},"Create a collection and insert vectors with the Python v1 client",[86,89,92,95],{"title":87,"body":88},"Install the official client","```bash\npip install qdrant-client>=1.7\n```",{"title":90,"body":91},"Connect with the API key","```python\nfrom qdrant_client import QdrantClient\n\nclient = QdrantClient(\n    url=\"https:\u002F\u002Fvectors.mydomain.com\",\n    api_key=\"YOUR_KEY\",\n)\n```",{"title":93,"body":94},"Create a collection with VectorParams","```python\nfrom qdrant_client.models import Distance, VectorParams\n\nclient.recreate_collection(\n    collection_name=\"documents\",\n    vectors_config=VectorParams(size=384, distance=Distance.COSINE),\n)\n```\n\n`size` must match the embedding dimension of your model. `Distance.COSINE` suits most sentence-transformer models.",{"title":96,"body":97},"Insert points with payload and query","```python\nfrom qdrant_client.models import PointStruct\n\n# Insert vectors\nclient.upsert(\n    collection_name=\"documents\",\n    points=[\n        PointStruct(\n            id=1,\n            vector=[0.1, 0.2, ...],  # vector of size 384\n            payload={\"title\": \"Qdrant Guide\", \"lang\": \"en\"},\n        ),\n    ],\n)\n\n# Search for the 5 nearest neighbours\nresults = client.search(\n    collection_name=\"documents\",\n    query_vector=[0.1, 0.21, ...],\n    limit=5,\n    with_payload=True,\n)\nfor r in results:\n    print(r.score, r.payload)\n```",{"type":39,"title":99,"body":100},"Optimise performance: HNSW tuning","The HNSW (Hierarchical Navigable Small World) algorithm is the core of fast search in Qdrant. Three parameters govern the speed\u002Faccuracy\u002Fmemory trade-off.",{"type":102,"title":103,"headers":104,"rows":109},"comparison","Key HNSW parameters",[105,106,107,108],"Parameter","Default","Recommended range","Impact",[110,115,120],[111,112,113,114],"m","16","16–64","Connections per node — higher = better recall, more RAM",[116,117,118,119],"ef_construct","100","100–400","Index build quality — higher = better index, slower build",[121,122,123,124],"ef","128 (at query)","64–512","Search quality — higher = better recall, slower query",{"type":126,"title":127,"body":128},"tip","Configure HNSW at collection creation","Pass HNSW parameters directly in `recreate_collection`:\n\n```python\nfrom qdrant_client.models import HnswConfigDiff\n\nclient.recreate_collection(\n    collection_name=\"documents\",\n    vectors_config=VectorParams(size=384, distance=Distance.COSINE),\n    hnsw_config=HnswConfigDiff(m=32, ef_construct=200),\n)\n```\n\nFor balanced search on a corpus of 500,000 vectors, `m=32` and `ef_construct=200` provide good recall (>0.97) without overloading RAM. Increase `ef` at query time for cases where precision matters more than latency.",{"type":43,"title":130,"items":131},"Reduce memory footprint: scalar and binary quantization",[132,133,134,135],"**Scalar quantization (uint8)**: compresses each float32 coordinate (4 bytes) to uint8 (1 byte), roughly a 4× RAM reduction. Slight precision loss offset by oversampling. Enable with `ScalarQuantizationConfig(type=ScalarType.INT8, quantile=0.99, always_ram=True)`.","**Binary quantization**: up to 32× reduction by binarising each dimension. Ideal for models trained for binary quantization (e.g. Cohere `embed-english-v3.0`). Faster but lower recall without oversampling.","**`on_disk` parameter**: store the original vectors on disk (`on_disk=True`) and keep only the quantised index in RAM. Essential on memory-constrained VPS.","**Oversampling**: with `oversampling=2.0` at query time, Qdrant retrieves 2× more candidates from the quantised index then re-ranks them with the original vectors — recall close to full-precision at moderate cost.",{"type":53,"title":137,"steps":138},"Back up and restore with Qdrant snapshots",[139,142,145,148],{"title":140,"body":141},"Create a snapshot of a collection","```bash\ncurl -s -X POST https:\u002F\u002Fvectors.mydomain.com\u002Fcollections\u002Fdocuments\u002Fsnapshots \\\n  -H \"api-key: YOUR_KEY\"\n# Returns: {\"result\":{\"name\":\"documents-...\",\"creation_time\":\"...\"}}\n```",{"title":143,"body":144},"List available snapshots","```bash\ncurl -s https:\u002F\u002Fvectors.mydomain.com\u002Fcollections\u002Fdocuments\u002Fsnapshots \\\n  -H \"api-key: YOUR_KEY\"\n```",{"title":146,"body":147},"Download the snapshot","```bash\ncurl -O https:\u002F\u002Fvectors.mydomain.com\u002Fcollections\u002Fdocuments\u002Fsnapshots\u002FSNAPSHOT_NAME \\\n  -H \"api-key: YOUR_KEY\"\n```\n\nThen copy the `.snapshot` file to object storage (e.g. Scaleway Object Storage, Backblaze B2) for off-site backup.",{"title":149,"body":150},"Restore from a snapshot","```bash\ncurl -s -X PUT https:\u002F\u002Fvectors.mydomain.com\u002Fcollections\u002Fdocuments\u002Fsnapshots\u002Fupload \\\n  -H \"api-key: YOUR_KEY\" \\\n  -H 'Content-Type: multipart\u002Fform-data' \\\n  -F snapshot=@documents-snapshot.snapshot\n```\n\nThe collection is recreated from the snapshot with all its data and original HNSW configuration.",{"type":126,"title":152,"body":153},"Monitoring with Prometheus and Grafana","Qdrant exposes a `\u002Fmetrics` endpoint in Prometheus format on port 6333. Useful production metrics: `app_requests_total` (throughput), `app_requests_duration_seconds` (p50\u002Fp99 latency), `collection_vector_count` (corpus size) and gRPC errors.\n\nAdd the target to your `prometheus.yml`:\n\n```yaml\nscrape_configs:\n  - job_name: qdrant\n    static_configs:\n      - targets: ['localhost:6333']\n    metrics_path: \u002Fmetrics\n    bearer_token: YOUR_KEY\n```\n\nIn Grafana, import the community Qdrant dashboard (ID 18278) to visualise p99 latency and error rate in real time.",{"type":43,"title":155,"items":156},"Common troubleshooting",[157,158,159,160,161],"**Connection refused on port 6333**: check the container is running (`docker compose ps`) and the port is not blocked by `ufw` — `ufw allow from 127.0.0.1 to any port 6333`. If the port is bound to `0.0.0.0` instead of `127.0.0.1`, fix the `compose.yml` and restart.","**OOM error \u002F container killed**: reduce `ef_construct` (e.g. 100 → 64) or enable scalar quantization to lower the index RAM footprint. Enable `on_disk: true` for original vectors. Check actual consumption with `docker stats qdrant`.","**Slow startup or first load**: the HNSW index is loaded from disk on first access. Use NVMe SSD (not a spinning disk) and warm up the collection after startup with an empty search request.","**Unauthorized 403**: the key passed in the `api-key` header does not match `QDRANT__SERVICE__API_KEY`. Check for trailing spaces or newlines in the environment variable.","**Degraded recall after enabling binary quantization**: increase `oversampling` to `3.0` or `4.0` and enable `rescore=True` to re-rank candidates with original vectors.",{"type":39,"title":163,"body":164},"Pair Qdrant with Ollama for a fully self-contained RAG stack","Run Ollama on the same VPS for embedding generation (`ollama pull mxbai-embed-large`) and inference (`ollama pull llama3.1:8b`). Your RAG pipeline then works end-to-end without any external API call: user question → Ollama embed → Qdrant search → top-k chunks → Ollama generate → grounded answer.\n\nAdd LiteLLM in front to expose a unified OpenAI-compatible endpoint to your app — and swap models without changing a line of code. A VPS with 8 GB of RAM comfortably hosts Qdrant + Ollama (quantised 7B model) + LiteLLM for a corpus of a few hundred thousand vectors.","Launch your Qdrant vector database for AI","The ServOrbit Cloud VPS offers the memory and SSD disks you need to host Qdrant and power your RAG pipelines and semantic search engines, with SSL and authentication under your control.","Deploy on Cloud VPS","\u002Fvps-cloud",[170,188,206],{"id":171,"slug":172,"slugs":173,"title":177,"excerpt":178,"readTime":179,"views":18,"isPinned":19,"noindex":19,"publishedAt":180,"updatedAt":181,"category":182,"categories":183,"featuredImage":30,"bgImage":31,"posterImage":185,"relatedSolution":186},56,"postgresql-on-a-vps-a-reliable-and-controlled-database",{"fr":174,"en":172,"ar":175,"es":176},"heberger-postgresql-vps","postgresql-على-خادم-vps-قاعدة-بيانات-موثوقة-ومتحكم-بها","alojar-postgresql-en-un-vps","PostgreSQL on a VPS: reliable, controlled database","Host PostgreSQL on a VPS: production config, pgBackRest backups, streaming HA, RDS\u002FSupabase\u002FNeon comparison and OOM troubleshooting.",9,"2026-04-25T00:00:00+00:00","2026-10-21T15:21:37+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},[184],{"id":23,"name":24,"slug":25,"color":26,"icon":27},"\u002Fblog\u002Fcovers\u002Fheberger-postgresql-vps-poster.svg",{"categorySlug":34,"appSlug":187},"postgresql-stack",{"id":189,"slug":190,"slugs":191,"title":195,"excerpt":196,"readTime":179,"views":197,"isPinned":19,"noindex":19,"publishedAt":198,"updatedAt":199,"category":200,"categories":201,"featuredImage":30,"bgImage":31,"posterImage":203,"relatedSolution":204},57,"hosting-mysql-on-a-vps",{"fr":192,"en":190,"ar":193,"es":194},"heberger-mysql-vps","استضافة-mysql-على-خادم-vps","alojar-mysql-en-un-vps","Hosting MySQL on a VPS: complete guide","Install MySQL 8.4 LTS on a VPS: prerequisites, security hardening, InnoDB performance, secure remote access, automated backups, and troubleshooting.",0,"2026-04-24T00:00:00+00:00","2026-11-09T20:55:18+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},[202],{"id":23,"name":24,"slug":25,"color":26,"icon":27},"\u002Fblog\u002Fcovers\u002Fheberger-mysql-vps-poster.svg",{"categorySlug":34,"appSlug":205},"mysql-stack",{"id":207,"slug":208,"slugs":209,"title":213,"excerpt":214,"readTime":215,"views":197,"isPinned":19,"noindex":19,"publishedAt":216,"updatedAt":217,"category":218,"categories":219,"featuredImage":30,"bgImage":31,"posterImage":221,"relatedSolution":222},58,"hosting-redis-on-a-vps",{"fr":210,"en":208,"ar":211,"es":212},"heberger-redis-vps","استضافة-redis-على-خادم-vps","alojar-redis-en-un-vps","Hosting Redis on a VPS: the complete guide","Deploy Redis on your Cloud VPS: RAM\u002FCPU requirements, security (ACL, TLS), RDB\u002FAOF persistence, troubleshooting, and high availability.",10,"2026-04-23T00:00:00+00:00","2026-09-08T21:59:59+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},[220],{"id":23,"name":24,"slug":25,"color":26,"icon":27},"\u002Fblog\u002Fcovers\u002Fheberger-redis-vps-poster.svg",{"categorySlug":34,"appSlug":223},"redis-stack",true,1794270420918]