{
  "id": "install-redis-cli",
  "title": "Install redis-cli",
  "url": "https://redis.io/docs/latest/operate/oss_and_stack/install/install-stack/install-redis-cli/",
  "summary": "How to install just the Redis CLI (redis-cli) without installing all of Redis",
  "tags": [
    "docs",
    "operate",
    "stack",
    "oss"
  ],
  "last_updated": "2026-07-31T16:56:30+01:00",
  "page_type": "content",
  "content_hash": "4bd69e7ab08ed00490da0c45f639194274a6a1b0c309b5cd8c81835b985d77d8",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "If you only need the [Redis CLI](https://redis.io/docs/latest/develop/tools/cli) (`redis-cli`) to connect to a remote Redis server, you can install it on its own, without installing the full Redis Open Source distribution or building it from source.\n\nThe installer downloads a single, statically linked `redis-cli` binary, so it works even on minimal images (such as Amazon Linux, openSUSE, or distroless). It requires only `curl` or `wget`.\n\n\nThis installation method is supported on **Linux** and **macOS** only, on `x86_64`/`amd64` and `arm64`/`aarch64` processors. It does not run on native Windows. You have two options:\n\n1. You can run it under the [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/windows/wsl/).\n1. You can use it with Docker; see [Run Redis Open Source on Docker](https://redis.io/docs/latest/operate/oss_and_stack/install/install-stack/docker) for more information."
    },
    {
      "id": "install-redis-cli",
      "title": "Install redis-cli",
      "role": "setup",
      "text": "Run the following command:\n\n\ncurl -fsSL https://packages.redis.io/redis-cli/install.sh | sh\n\n\nThe script detects your operating system and architecture, downloads the matching `redis-cli` binary, verifies its SHA-256 checksum, and installs it to `/usr/local/bin` (using `sudo` if required). If `/usr/local/bin` is not writable, it installs to `~/.local/bin` instead.\n\n\nAs with any `curl ... | sh` command, review the [install script](https://packages.redis.io/redis-cli/install.sh) before running it if you want to see exactly what it does."
    },
    {
      "id": "install-a-specific-version",
      "title": "Install a specific version",
      "role": "setup",
      "text": "By default, the script installs the latest stable release. To install a particular version, set the `REDIS_CLI_VERSION` environment variable:\n\n\ncurl -fsSL https://packages.redis.io/redis-cli/install.sh | REDIS_CLI_VERSION=8.8.0 sh"
    },
    {
      "id": "choose-the-installation-directory",
      "title": "Choose the installation directory",
      "role": "content",
      "text": "To install `redis-cli` to a location of your choice, set the `REDIS_CLI_INSTALL_DIR` environment variable:\n\n\ncurl -fsSL https://packages.redis.io/redis-cli/install.sh | REDIS_CLI_INSTALL_DIR=\"$HOME/bin\" sh\n\n\nIf the installation directory is not on your `PATH`, the script prints a note reminding you to add it."
    },
    {
      "id": "connect-to-redis",
      "title": "Connect to Redis",
      "role": "content",
      "text": "Once `redis-cli` is installed, you can use it to connect to any Redis instance. For example, to connect to a server running on `localhost` on the default port:\n\n\nredis-cli\n\n\nTo connect to a remote server, specify the host and port:\n\n\nredis-cli -h <host> -p <port>\n\n\nTest the connection with the `ping` command:\n\n\n127.0.0.1:6379> PING\nPONG"
    },
    {
      "id": "next-steps",
      "title": "Next steps",
      "role": "content",
      "text": "- Try the [Redis CLI tutorial](https://redis.io/docs/latest/develop/tools/cli).\n- If you need a full Redis installation, see the other [installation guides](https://redis.io/docs/latest/operate/oss_and_stack/install/install-stack)."
    }
  ],
  "examples": []
}
