Don’t stop now! The next scenario will only take about 10 minutes to complete.

Nextcloud installation and test

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

Optional: 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: 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]].environments.katacoda.com/

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]].environments.katacoda.com/