this Tuturial describes the steps to setup owncloud on top of debian/raspian with lighttpd as webserver and https encryption with certificates sign by Let’s encrypt campain.
Install a minimal debian jessie system.
Login as root. On raspbian login as user pi change to root.
Continue reading Debian: Setup owncloud with TLS (LetsEncrypt) and protected by AppArmor