I recently installed nextcloud on a fresh Ubuntu 18.04 install on a spare PC I had, via the VM scripts. The install completed with no errors, including configuring SSH, and I can access the server just fine when connecting to the LAN IP. However, when connecting to either the public IP or the hostname, I get a “the server is taking too long to respond” error after a minute or so of loading. I checked to make sure the IP is correct and that ports 80 and 443 are open, and SSH did install correctly so I know it can access the ports. I am unsure on what to do next.
Your router should be setup to forward the ports to your PC. Did you do this?
Yes, both 80 and 443.