Download and install ubuntu server 16.04 installer on a usb stick
Boot from ubuntu from usb
Follow install process until software selection
Choose LAMP server and openssh server
Boot ubuntu
Ensure /etc/apt/sources/list is as follows:

deb http://au.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb http://au.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://au.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse

install aptitude with:
sudo apt install aptitude

update and upgrade ubuntu with aptitude

install zoneminder ppa:
sudo add-apt-repository ppa:iconnor/zoneminder
sudo apt update

Follow the guide at: zoneminder readthedocs

When zoneminder is up and running, you can then configure stuff.

First add www-data to the video group:
sudo adduser www-data video

Check Apache /etc/apache2/conf-enabled/zoneminder.conf ScriptAlias matches PATH_ZMS.

Go ahead and install some cameras and configure them!