{
  "schema_version": 2,
  "id": "commands/subscribe",
  "title": "SUBSCRIBE",
  "url": "https://redis.io/docs/latest/commands/subscribe/",
  "summary": "Listens for messages published to channels.",
  "since": "2.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T16:45:25+01:00",
  "page_type": "content",
  "content_hash": "9ed34543ed7d205a7416663a7595d238646d17b8801ea5ce0e36a5e88e9b1c7f",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Subscribes the client to the specified channels.\n\nOnce the client enters the subscribed state it is not supposed to issue any\nother commands, except for additional `SUBSCRIBE`, [`SSUBSCRIBE`](https://redis.io/docs/latest/commands/ssubscribe), [`PSUBSCRIBE`](https://redis.io/docs/latest/commands/psubscribe), [`UNSUBSCRIBE`](https://redis.io/docs/latest/commands/unsubscribe), [`SUNSUBSCRIBE`](https://redis.io/docs/latest/commands/sunsubscribe), \n[`PUNSUBSCRIBE`](https://redis.io/docs/latest/commands/punsubscribe), [`PING`](https://redis.io/docs/latest/commands/ping), [`RESET`](https://redis.io/docs/latest/commands/reset) and [`QUIT`](https://redis.io/docs/latest/commands/quit) commands.\nHowever, if RESP3 is used (see [`HELLO`](https://redis.io/docs/latest/commands/hello)) it is possible for a client to issue any commands while in subscribed state.\n\nFor more information, see [Pub/sub](https://redis.io/docs/latest/develop/pubsub)."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>channel [channel ...]</code></summary>\n\nOne or more channels to subscribe to.\n\n</details>"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nWhen successful, this command doesn't return anything. Instead, for each channel, one message with the first element being the string `subscribe` is pushed as a confirmation that the command succeeded.\n\n**RESP3:**\n\nWhen successful, this command doesn't return anything. Instead, for each channel, one message with the first element being the string `subscribe` is pushed as a confirmation that the command succeeded."
    }
  ],
  "examples": []
}
