Nextcloud installation and test - OLD

Initail update of the machine: sudo apt-get update

Install perquisites: sudo apt-get install -y snap snapd php7.0-cli apache2

Optional addons: sudo apt-get install -y mariadb-server libapache2-mod-php7.0 php7.0-gd php7.0-json php7.0-mysql php7.0-curl php7.0-mbstring php7.0-intl php7.0-mcrypt php-imagick php7.0-xml php7.0-zip

Download nextcloud snap image: sudo snap install nextcloud

Check the installation was successful: snap changes nextcloud

Set username and password (admin thelazyfox): sudo nextcloud.manual-install admin thelazyfox

Add trusted domain: sudo nextcloud.occ config:system:set trusted_domains 1 --value=https://[[HOST_SUBDOMAIN]]-80-[[KATACODA_HOST]]

Check what domains are trusted: sudo nextcloud.occ config:system:get trusted_domains

Configure SSL:

sudo ufw allow 80,443/tcp

sudo nextcloud.enable-https lets-encrypt

sudo nextcloud.enable-https self-signed

sudo ufw allow 80,443/tcp

Check apache is running:

sudo ufw app list

If no apache is in the list, run:

sudo apt-get install -y apache2

Check apache is running:

sudo ufw app list

Finally you can now access your nextcloud server by clicking here: https://[[HOST_SUBDOMAIN]]-80-[[KATACODA_HOST]]