Install Zoneminder 1.30.4
Add Repository
NOTE:You may need to run: “apt install software-properties-common” if you did the minimal net install of Ubuntu.
add-apt-repository ppa:iconnor/zoneminder
Update Sources
apt update
Install Zoneminder
apt install zoneminder
Create a new user
adduser www-data video
Enable CGI, Zoneminder and rewrite configuration in Apache.
a2enmod cgi
a2enconf zoneminder
a2enmod rewrite
Fix Permissions
chown -R www-data:www-data /usr/share/zoneminder/
Enable and start Zoneminder
systemctl enable zoneminder
service zoneminder start
Add timezone to PHP
nano /etc/php/7.0/apache2/php.ini
Search for [Date] (Ctrl + w then type Date and press Enter) and make changes as follows for your time zone. Make sure to remove the ; from the front of date.timezone
[Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = America/New_York
Ctrl+o Enter to save
CTRL+x to exit
Restart Apache
service apache2 reload
IMPORTANT FINAL STEP: Open Zoneminder in a web browser (http://server-ip/zm). Click on Options – Paths and change PATH_ZMS to /zm/cgi-bin/nph-zms
Source: https://wiki.zoneminder.com/Ubuntu_Server_16.04_64-bit_with_Zoneminder_1.30.4_the_easy_way