The snap package bundles everything you need — Apache, PHP, and MariaDB.
sudo snap install nextcloud
sudo nextcloud.manual-install admin yourpassword
Add your domain or IP to the trusted domains list.
sudo nextcloud.occ config:system:set trusted_domains 1 --value=yourdomain.com sudo nextcloud.occ config:system:set trusted_domains 2 --value=192.168.1.100
Nextcloud snap includes a built-in self-signed certificate. For production, you'll want a real one:
sudo nextcloud.enable-https lets-encrypt
Or use the self-signed certificate for testing:
sudo nextcloud.enable-https self-signed
Open your browser and navigate to:
https://yourdomain.com
sudo nextcloud.occ status
sudo nextcloud.occ maintenance:mode --on
sudo nextcloud.occ files:scan --all
sudo nextcloud.occ app:list