{
  "id": "docker",
  "title": "Run Redis Stack on Docker",
  "url": "https://redis.io/docs/latest/operate/oss_and_stack/install/archive/install-stack/docker/",
  "summary": "How to install Redis Stack using Docker",
  "tags": [
    "docs",
    "operate",
    "stack",
    "oss"
  ],
  "last_updated": "2026-04-01T08:10:08-05:00",
  "page_type": "content",
  "content_hash": "179e7f92b4ca5270b16f70b009c899ed6b8e23b2c6d81e645a5edff82a1943f7",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "To get started with Redis Stack using Docker, you first need to select a Docker image:\n\n* `redis/redis-stack` contains both Redis Stack server and Redis Insight. This container is best for local development because you can use the embedded Redis Insight to visualize your data.\n\n* `redis/redis-stack-server` provides Redis Stack server only. This container is best for production deployment."
    },
    {
      "id": "getting-started",
      "title": "Getting started",
      "role": "setup",
      "text": ""
    },
    {
      "id": "redis-redis-stack-server",
      "title": "redis/redis-stack-server",
      "role": "content",
      "text": "To start Redis Stack server using the `redis-stack-server` image, run the following command in your terminal:\n\n\ndocker run -d --name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest"
    },
    {
      "id": "redis-redis-stack",
      "title": "redis/redis-stack",
      "role": "content",
      "text": "To start a Redis Stack container using the `redis-stack` image, run the following command in your terminal:\n\n\ndocker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest\n\n\nThe `docker run` command above also exposes Redis Insight on port 8001. You can use Redis Insight by pointing your browser to `localhost:8001`."
    },
    {
      "id": "connect-with-redis-cli",
      "title": "Connect with redis-cli",
      "role": "content",
      "text": "You can then connect to the server using `redis-cli`, just as you connect to any Redis instance.\n\nIf you don’t have `redis-cli` installed locally, you can run it from the Docker container:\n\n\n$ docker exec -it redis-stack redis-cli"
    },
    {
      "id": "configuration",
      "title": "Configuration",
      "role": "configuration",
      "text": ""
    },
    {
      "id": "persistence-in-docker",
      "title": "Persistence in Docker",
      "role": "content",
      "text": "To mount directories or files to your Docker container, specify `-v` to configure a local volume. This command stores all data in the local directory `local-data`:\n\n$ docker run -v /local-data/:/data redis/redis-stack:latest"
    },
    {
      "id": "ports",
      "title": "Ports",
      "role": "content",
      "text": "If you want to expose Redis Stack server or Redis Insight on a different port, update the left hand of portion of the `-p` argument. This command exposes Redis Stack server on port `10001` and Redis Insight on port `13333`:\n\n$ docker run -p 10001:6379 -p 13333:8001 redis/redis-stack:latest"
    },
    {
      "id": "config-files",
      "title": "Config files",
      "role": "content",
      "text": "By default, the Redis Stack Docker containers use internal configuration files for Redis. To start Redis with local configuration file, you can use the `-v` volume options:\n\n\n$ docker run -v `pwd`/local-redis-stack.conf:/redis-stack.conf -p 6379:6379 -p 8001:8001 redis/redis-stack:latest"
    },
    {
      "id": "environment-variables",
      "title": "Environment variables",
      "role": "content",
      "text": "To pass in arbitrary configuration changes, you can set any of these environment variables:\n\n* `REDIS_ARGS`: extra arguments for Redis\n\n* `REDISEARCH_ARGS`: arguments for the search and query features (RediSearch)\n\n* `REDISJSON_ARGS`: arguments for JSON (RedisJSON)\n\n* `REDISTIMESERIES_ARGS`: arguments for time series (RedisTimeSeries)\n\n* `REDISBLOOM_ARGS`: arguments for  the probabilistic data structures (RedisBloom)\n\n\nFor example, here's how to use the `REDIS_ARGS` environment variable to pass the `requirepass` directive to Redis:\n\n\ndocker run -e REDIS_ARGS=\"--requirepass redis-stack\" redis/redis-stack:latest\n\n\nAn example of setting [Redis persistence]():\n\ndocker run -e REDIS_ARGS=\"--save 60 1000 --appendonly yes\" redis/redis-stack:latest\n\n\nHere's how to set a retention policy for time series:\n\ndocker run -e REDISTIMESERIES_ARGS=\"RETENTION_POLICY=20\" redis/redis-stack:latest"
    }
  ],
  "examples": []
}
