{
  "schema_version": 2,
  "id": "operate/rs/installing-upgrading/install/prepare-install/port-availability",
  "title": "Ensure port availability",
  "url": "https://redis.io/docs/latest/operate/rs/installing-upgrading/install/prepare-install/port-availability/",
  "summary": "Make sure required ports are available.",
  "tags": [
    "docs",
    "operate",
    "rs"
  ],
  "last_updated": "2026-09-24T09:16:34+01:00",
  "page_type": "content",
  "content_hash": "4e0f92f9bd8d519bb73abb2a5c1c00b49fcedf4c0b4257c5032a605d355b0fec",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Before [installing Redis Software](https://redis.io/docs/latest/operate/rs/installing-upgrading/install), make sure all required ports are available.\n\nIf ports that Redis assigns to the database are being used by the operating system or other processes, the installation fails.\n\nFollow the relevant sections to configure required ports.\n\nFor recommended and optional port configuration, see [Network port configurations](https://redis.io/docs/latest/operate/rs/networking/port-configurations)."
    },
    {
      "id": "update-sysctlconf-to-avoid-port-collisions",
      "title": "Update `sysctl.conf` to avoid port collisions",
      "role": "content",
      "text": "To avoid port collision, update `/etc/sysctl.conf` to include:\n\n[code example]"
    },
    {
      "id": "os-conflicts-with-port-53",
      "title": "OS conflicts with port 53",
      "role": "content",
      "text": "If port 53 is in use, the installation fails. This issue can occur in default installations of certain operating systems in which `systemd-resolved` (DNS server) or `dnsmasq` is running.\n\nTo prevent this issue, change the system configuration to make this port available before installation.\n\nTo prevent `systemd-resolved` from using port 53:\n\n1. Edit `/etc/systemd/resolved.conf`: \n\n    [code example]\n\n1. Add `DNSStubListener=no` as the last line in the file and save the file.\n\n1. Rename the current `/etc/resolv.conf` file:\n\n    [code example]\n\n1. Create a symbolic link for `/etc/resolv.conf`:\n\n    [code example]\n\n    > [!NOTE]\n    > You might encounter a temporary name resolution error (`sudo: unable to resolve host {hostname}: Temporary failure in name resolution`), which should be fixed when you restart `systemd-resolved` in the next step.\n\n2. Restart the DNS service:\n\n    [code example]\n\nTo prevent `dnsmasq` from using port 53:\n\n1. Stop the `dnsmasq` service if it's running:\n\n    [code example]\n\n1. Prevent `dnsmasq` from starting automatically at system boot:\n\n    [code example]\n\n1. Mask `dnsmasq` to prevent it from being started manually or by other services:\n\n    [code example]\n\n1. Verify `dnsmasq` is no longer active and won't start at system boot:\n\n    [code example]"
    }
  ],
  "examples": [
    {
      "id": "update-sysctlconf-to-avoid-port-collisions-ex0",
      "language": " sh",
      "code": "net.ipv4.ip_local_port_range = 30000 65535",
      "section_id": "update-sysctlconf-to-avoid-port-collisions"
    },
    {
      "id": "os-conflicts-with-port-53-ex0",
      "language": "sh",
      "code": "sudo vi /etc/systemd/resolved.conf",
      "section_id": "os-conflicts-with-port-53"
    },
    {
      "id": "os-conflicts-with-port-53-ex1",
      "language": "sh",
      "code": "sudo mv /etc/resolv.conf /etc/resolv.conf.orig",
      "section_id": "os-conflicts-with-port-53"
    },
    {
      "id": "os-conflicts-with-port-53-ex2",
      "language": "sh",
      "code": "sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf",
      "section_id": "os-conflicts-with-port-53"
    },
    {
      "id": "os-conflicts-with-port-53-ex3",
      "language": "sh",
      "code": "sudo service systemd-resolved restart",
      "section_id": "os-conflicts-with-port-53"
    },
    {
      "id": "os-conflicts-with-port-53-ex4",
      "language": "sh",
      "code": "sudo systemctl stop dnsmasq",
      "section_id": "os-conflicts-with-port-53"
    },
    {
      "id": "os-conflicts-with-port-53-ex5",
      "language": "sh",
      "code": "sudo systemctl disable dnsmasq",
      "section_id": "os-conflicts-with-port-53"
    },
    {
      "id": "os-conflicts-with-port-53-ex6",
      "language": "sh",
      "code": "sudo systemctl mask dnsmasq",
      "section_id": "os-conflicts-with-port-53"
    },
    {
      "id": "os-conflicts-with-port-53-ex7",
      "language": "sh",
      "code": "sudo systemctl status dnsmasq",
      "section_id": "os-conflicts-with-port-53"
    }
  ]
}
