{
  "schema_version": 2,
  "id": "commands/publish",
  "title": "PUBLISH",
  "url": "https://redis.io/docs/latest/commands/publish/",
  "summary": "Posts a message to a channel.",
  "since": "2.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-06-15T06:26:34-07:00",
  "page_type": "content",
  "content_hash": "8c6e1b32ca1b9b2b8a8a13f744fdfa8985a86ddb10244a554d3e1f9236897c23",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Posts a message to the given channel.\n\nIn a Redis Cluster, clients can publish to every node. The cluster makes sure\nthat published messages are forwarded as needed, so clients can subscribe to any\nchannel by connecting to any one of the nodes."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>channel</code></summary>\n\nThe channel to publish to.\n\n</details>\n\n<details open><summary><code>message</code></summary>\n\nThe message to publish.\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\n[Integer reply](../../develop/reference/protocol-spec#integers): the number of clients that the message was sent to. Note that in a Redis Cluster, only clients that are connected to the same node as the publishing client are included in the count.\n\n**RESP3:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): the number of clients that the message was sent to. Note that in a Redis Cluster, only clients that are connected to the same node as the publishing client are included in the count."
    }
  ],
  "examples": []
}
