List Ports
sudo snap get nextcloud ports
Change Http port
snap set nextcloud ports.http=8000
Change Https port
snap set nextcloud ports.https=4444
If you are using Firewall add this port
sudo ufw allow 8000,4444/tcp
Check the changes
netstat -ntlp | grep LISTEN