Install Nextcloud via SNAP
sudo apt install snapd
sudo snap install nextcloud
To activate the NextCloud database and configuration file values, visit your Server IP using a web browser.
sudo nano /var/snap/nextcloud/current/nextcloud/config/config.php
'trusted_domains' =>
array (
0 => 'nextcloud.example.com',
),
"overwriteprotocol" => "https"