Download Flathub repository file:
https://flathub.org/repo/flathub.flatpakrepo
Open downloaded file with Software Install option
Install Nextcloud app from Flathub repo:
flatpak install flathub org.nextcloud.Nextcloud
List installed Flatpack apps:
flatpak list
Run Nextcloud app:
flatpak run org.nextcloud.Nextcloud
You can also copy nextcloud.cfg config file from your previous standalone nextcloud client:
cp ./.config/Nextcloud/nextcloud.cfg ./.var/app/org.nextcloud.Nextcloud/config/Nextcloud/nextcloud.cfg