Run This Ai
EN DE

Getting Started with RedisStack: Docker Deployment and Vector Search Guide

RedisStack Logo

Getting Started with RedisStack: Docker Deployment Guide

RedisStack makes it incredibly easy to get a fully-featured Redis instance with vector search, JSON, and full-text search capabilities up and running. This guide will walk you through deploying RedisStack with Docker, connecting via RedisInsight, and running your first vector similarity search.

Prerequisites

Before you start, make sure you have Docker installed on your system. RedisStack requires very modest resources — just 512MB RAM and 1 CPU core minimum, with 2 cores and 1GB RAM recommended for production use. Any modern Linux server, macOS machine, or Windows system with WSL2 will work perfectly.

Step 1: Pull and Run RedisStack

Getting RedisStack running is a single Docker command:

docker run -d --name redis-stack \
  -p 6379:6379 \
  -p 8001:8001 \
  -v redis-stack-data:/data \
  redis/redis-stack:latest

This starts RedisStack with Redis on the default port (6379) and RedisInsight — the visual GUI — on port 8001. The -v flag creates a persistent volume so your data survives container restarts.

RedisInsight Browser Screenshot

Step 2: Connect with RedisInsight

Once the container is running, open your browser and navigate to http://localhost:8001. RedisInsight's web interface will load automatically. Click "Add Redis Database" and enter host.docker.internal (or your server's IP) with port 6379. RedisInsight will connect and display your Redis Stack instance in the browser view — you can explore keys, run commands, view memory usage, and monitor performance in real-time.

Step 3: Run Your First Vector Search

RedisStack's vector search capabilities are what make it indispensable for AI applications. Let's create a simple vector index, add some embeddings, and search them. Connect via redis-cli or RedisInsight's workbench and run:

# Create a vector index for 1536-dimensional embeddings (OpenAI-compatible)
FT.CREATE idx:docs ON HASH PREFIX 1 "doc:" \
  SCHEMA content TEXT \
  embedding VECTOR HNSW 6 TYPE FLOAT32 DIM 1536 DISTANCE_METRIC COSINE

# Add a document with its embedding vector
HSET doc:1 content "RedisStack is great for RAG" \
  embedding \x00\x01\x02\x03...

# Search by vector similarity
FT.SEARCH idx:docs "*=>[KNN 5 @embedding $vec AS score]" \
  SORTBY score PARAMS 2 vec "\x00\x01\x02..." \
  RETURN 3 score content DIALECT 2
RedisInsight Workbench Query Screenshot

Step 4: Docker Compose for Production

For a more robust setup, use Docker Compose with persistent storage and resource limits:

services:
  redis-stack:
    image: redis/redis-stack:latest
    restart: unless-stopped
    ports:
      - "6379:6379"
      - "8001:8001"
    volumes:
      - ./data/redis-stack:/data
    environment:
      - REDIS_ARGS=--save 60 1 --appendonly yes
    deploy:
      resources:
        limits:
          memory: 2G

Why RedisStack for AI?

RedisStack is uniquely positioned as the data backbone for AI applications. Its vector search integrates natively with every major AI framework — LangChain, LlamaIndex, Haystack all have first-class Redis vector store implementations. The built-in RedisInsight GUI gives you full visibility into your vector indexes, search performance, and memory usage. With 75k+ GitHub stars and decades of production use, RedisStack is the most battle-tested database you can run alongside your AI stack.

Conclusion

From a single Docker command to a production-grade vector search engine, RedisStack delivers everything you need for AI data infrastructure. Start with the quick Docker command, explore with RedisInsight, and scale up with Docker Compose. Your self-hosted AI stack isn't complete without RedisStack.