It can be an ip address, if you have a static ip. If you’re planning to host this on the open internet and have a dynamic ip (home internet is most likely for this), or static and don’t want to pay for a top level domain you can use a service like noip.com for a free address like “test.ddns.net”
You can also change this after the initial setup in Nextcloud’s config.php as well as as additional domain names/ip addresses that can reach the server.