{
  "schema_version": 2,
  "id": "commands/slaveof",
  "title": "SLAVEOF",
  "url": "https://redis.io/docs/latest/commands/slaveof/",
  "summary": "Sets a Redis server as a replica of another, or promotes it to being a master.",
  "since": "1.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:48:09+01:00",
  "page_type": "content",
  "content_hash": "c9a7e25067de20f2ef58042d5ac4e0a7c4b6cafb3ccb044f19258b79a92f40b3",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "**A note about the word slave used in this man page and command name**: starting with Redis version 5, if not for backward compatibility, the Redis project no longer uses the word slave. Please use the new command [`REPLICAOF`](https://redis.io/docs/latest/commands/replicaof). The command `SLAVEOF` will continue to work for backward compatibility.\n\nThe `SLAVEOF` command can change the replication settings of a replica on the fly.\nIf a Redis server is already acting as replica, the command `SLAVEOF` NO ONE will\nturn off the replication, turning the Redis server into a MASTER.\nIn the proper form `SLAVEOF` hostname port will make the server a replica of\nanother server listening at the specified hostname and port.\n\nIf a server is already a replica of some master, `SLAVEOF` hostname port will stop\nthe replication against the old server and start the synchronization against the\nnew one, discarding the old dataset.\n\nThe form `SLAVEOF` NO ONE will stop replication, turning the server into a\nMASTER, but will not discard the replication.\nSo, if the old master stops working, it is possible to turn the replica into a\nmaster and set the application to use this new master in read/write.\nLater when the other Redis server is fixed, it can be reconfigured to work as a\nreplica."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>host port | NO ONE</code></summary>\n\nThe host and port of the master to replicate from, or `NO ONE` to stop replicating. `SLAVEOF` is deprecated; use `REPLICAOF` instead.\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=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> | <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> | Deprecated as of Redis v5.0.0. |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`.\n\n**RESP3:**\n\n[Simple string reply](../../develop/reference/protocol-spec#simple-strings): `OK`."
    }
  ],
  "examples": []
}
