Loading…
Loading documentation...
Harden and tune Valkey, Redis, Qdrant vector DB, Meilisearch, and MinIO in Docker with overcommit sysctls, maxmemory policies, master keys, and WAL backups.
Commands checked on 2026-11-23 with Valkey 8, PostgreSQL 17, Qdrant 1.12+, Meilisearch 1.11+, MinIO.
Production-safe Docker and host configurations for your state, cache, vector, search, and object-storage layer—preventing unauthenticated database exposure, Valkey OOM crashes, Qdrant mmap limits, and unbacked MinIO single-volume surprises.
vm.overcommit_memory=1, vm.max_map_count=1048576, THP disabled) applied as in Diagnose Linux OOM kills, sysctl limits, and disk spikes.internal_net or 127.0.0.1 as in Fix Docker UFW bypasses with DOCKER-USER and nftables.Unbounded Redis/Valkey instances grow until the Linux OOM killer kills the daemon. Cap maxmemory, choose an eviction policy (allkeys-lru for pure cache or volatile-lru / noeviction for session/queue stores), require authentication, and keep bind ports strictly internal:
valkey:
image: valkey/valkey:8-alpine
container_name: prod-valkey
restart: unless-stopped
command:
- "valkey-server"
- "--requirepass"
- "${VALKEY_PASSWORD}"
- "--maxmemory"
- "2gb"
- "--maxmemory-policy"
- "volatile-lru"
- "--appendonly"
- "yes"
- "--appendfsync"
- "everysec"
volumes:
- valkey_data:/data
networks:
- internal_net
healthcheck:
test: ["CMD-SHELL", "valkey-cli -a $${VALKEY_PASSWORD} ping | grep PONG"]
interval: 10s
timeout: 5s
retries: 5
By default, Qdrant starts without an API key and Meilisearch runs in open development mode until MEILI_MASTER_KEY is configured. Always require strong generated secrets (openssl rand -hex 32) and raise nofile limits for memory-mapped HNSW/LMDB segments:
qdrant:
image: qdrant/qdrant:latest
restart: unless-stopped
environment:
- QDRANT__SERVICE__API_KEY=${QDRANT_API_KEY}
ulimits:
nofile:
soft: 65536
hard: 65536
volumes:
- qdrant_data:/qdrant/storage
networks:
- internal_net
meilisearch:
image: getmeili/meilisearch:v1.11
restart: unless-stopped
environment:
- MEILI_ENV=production
- MEILI_MASTER_KEY=${MEILI_MASTER_KEY}
- MEILI_NO_ANALYTICS=true
- MEILI_SCHEDULE_SNAPSHOT=86400
ulimits:
nofile:
soft: 65536
hard: 65536
volumes:
- meili_data:/meili_data
networks:
- internal_net
Notice MEILI_SCHEDULE_SNAPSHOT=86400 writes consistent point-in-time index snapshots daily so restores do not require re-indexing millions of records from scratch.
Use MinIO for local S3-compatible object storage (WAL-G PostgreSQL continuous archiving, n8n artifacts, restic backups), and keep API (:9000) / Console (:9001) behind authenticated HTTPS proxies or private WireGuard subnets rather than 0.0.0.0:9001:
minio:
image: minio/minio:latest
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}
volumes:
- minio_data:/data
networks:
- internal_net
- proxy_net
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:9000/minio/health/live"]
interval: 15s
timeout: 5s
retries: 5
For multi-drive fault tolerance on bare-metal/multi-volume nodes, pass four mounted directories (/data1 /data2 /data3 /data4) to enable MinIO erasure coding.
Verify health checks, password enforcement, and memory policies from inside the compose network:
docker exec prod-valkey valkey-cli -a "$VALKEY_PASSWORD" INFO memory | grep -E 'maxmemory_human|maxmemory_policy|used_memory_human'
docker exec prod-valkey valkey-cli ping
The second command (without -a) must fail with NOAUTH Authentication required, proving unauthenticated access is blocked.
WARNING overcommit_memory is set to 0! Background save may fail. Apply sudo sysctl -w vm.overcommit_memory=1 permanently in /etc/sysctl.d/99-production.conf.Too many open files or mmap error. Raise host vm.max_map_count=1048576 and verify container ulimits.nofile is at least 65536.MEILI_ENV=production, MEILI_MASTER_KEY must be at least 16 bytes long and provided cleanly at startup.valkey, qdrant, meilisearch, and postgres off public bridge ports entirely (internal_net only) and never publish unauthenticated admin consoles on 0.0.0.0.pg_dump backups to external S3 storage via Object storage bucket or Backups and snapshots.MEILI_NO_ANALYTICS=true) and monitor volume free space before min_free_disk triggers read-only locks.Every Servers Are Up virtual machine and container includes an integrated HTML5 browser-based SSH, RDP, and VNC console in your dashboard, default-off inbound firewall rules with per-IP allow-lists, and full programmatic control via REST API v1 and Model Context Protocol (MCP). Explore our Virtual Datacenter Plans or reach out to Servers Are Up Support.