This is most likely the most difficult and complicated way to install.
I suggest Nextcloud AIO, or if you prefer, I wrote a guide for a Docker installation based on an older version.
I have done both of these methods with good results. I suggest avoiding the snap version. There is also a setup script you can try under the community section. I havenāt tried it personally⦠it says itās easy⦠Who knows?