Login to ubuntu 22.04 sever.
Run the following command to download Nextcloud.
snap install nextcloud
root@crown:~# sudo snap install nextcloud nextcloud 23.0.2snap1 from Nextcloud✓ installed
Now type your IP address in the URL to launch the Nextcloud.
You will have to create an admin account -- Enter the username and password which you want to set.