{
  "id": "port-availability",
  "title": "Ensure port availability",
  "url": "https://redis.io/docs/latest/operate/rs/8.0/installing-upgrading/install/prepare-install/port-availability/",
  "summary": "Make sure required ports are available.",
  "content": "\nBefore [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).\n\n## Update `sysctl.conf` to avoid port collisions\n\nTo avoid port collision, update `/etc/sysctl.conf` to include:\n\n``` sh\nnet.ipv4.ip_local_port_range = 30000 65535\n```\n\n\n## OS conflicts with port 53\n\nIf 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    ```sh\n    sudo vi /etc/systemd/resolved.conf\n    ```\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    ```sh\n    sudo mv /etc/resolv.conf /etc/resolv.conf.orig\n    ```\n\n1. Create a symbolic link for `/etc/resolv.conf`:\n\n    ```sh\n    sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf\n    ```\n\n    \nYou 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    \n\n2. Restart the DNS service:\n\n    ```sh\n    sudo service systemd-resolved restart\n    ```\n\nTo prevent `dnsmasq` from using port 53:\n\n1. Stop the `dnsmasq` service if it's running:\n\n    ```sh\n    sudo systemctl stop dnsmasq\n    ```\n\n1. Prevent `dnsmasq` from starting automatically at system boot:\n\n    ```sh\n    sudo systemctl disable dnsmasq\n    ```\n\n1. Mask `dnsmasq` to prevent it from being started manually or by other services:\n\n    ```sh\n    sudo systemctl mask dnsmasq\n    ```\n\n1. Verify `dnsmasq` is no longer active and won't start at system boot:\n\n    ```sh\n    sudo systemctl status dnsmasq\n    ```\n\n",
  "tags": ["docs","operate","rs"],
  "last_updated": "2026-07-23T12:05:56-05:00"
}
