ZoneMinder is a free, open-source programme for closed-circuit television monitoring that was created to run on Linux and FreeBSD and distributed under the GNU General Public License (GPL).

Web-based controls allow users to manage ZoneMinder. Standard cameras or IP-based camera devices can be used with the application (through capture cards, USB, FireWire, etc.). The programme offers three different operating modes:

  • monitoring (without recording) 
  • persistent recording when movement is detected
  • permanent recording

The application allows for simultaneous viewing of many cameras. One can choose areas inside the range of view that the software will ignore before recording begins when the application detects changes between camera frames. ZoneMinder is compatible with ONVIF-compliant cameras.

Requirement's of Zoneminder

  • Fresh Installation of Ubuntu Server 20.04/22.04
  • Php
  • Mysql Server
  • Apache Server

The step's to install Zoneminder are as follow's


Step 1:  Update & Upgrade the Repositories


    sudo apt update && upgrade -y


Step 2: Enable Root login 


    sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config


    sudo systemctl restart ssh


    sudo passwd


then login using root user, i,e. root@ip-addr


Step 3: Install Apache server and enable apache service


    apt install apache2

    systemctl enable --now apache2

   

Step 4: Install Mysql and enable mysql service

    apt install mysql -y

    systemctl enable --now mysql


Step 5: Install Php7.4 and modules for php

    apt install php7.4 php7.4-tidy php7.4-xml php7.4-pgsql php7.4-mysql php7.4-json php7.4-gd php7.4-fpm php7.4-dev php7.4-mbstring php7.4-cli php7.4-cgi libphp7.4-embed libapache2-mod-php7.4

For Other Modules search in terminal as 

    apt search php7.4

Step 6: Add PPA for Zaoneminder latest Version

    add-apt-repository ppa:iconnor/zoneminder-1.36

    apt update && apt upgrade -y

Step 7: Install ZoneMinder on Ubuntu 20.04 | 22.04

    apt install zoneminder

Step 8: Modify the Mysql my.cnf file as follows

   remove the already existing file and copy the new file

        rm /etc/mysql/my.cnf 

        cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf

       nano /etc/mysql/my.cnf

        Add the below line at end of file

            sql_mode = NO_ENGINE_SUBSTITUTION

Step 9: Set Permissions for apache user

    chmod 740 /etc/zm/zm.conf

    chown root:www-data /etc/zm/zm.conf

    chown -R www-data:www-data /usr/share/zoneminder/

Step 10: Enable Apache Modules:

    a2enmod cgi rewrite expires headers

Step 11: Enable Zaoneminder Virtual Host Configuration file

    a2enconf zoneminder

Step 12: Reload Apache service

    systemctlreload apache2

Step 13: Set Date & Time Zone in PhP.ini

    nano /etc/php/*/apache2/php.ini

    date.timezone =Asia/Kolkata


Note: Use the link to find the date & time Zones.

https://www.php.net/manual/en/timezones.asia.php

Step 14:Start and Enable Zaoneminder service

    systemctl enable zoneminder or service zoneminder enable

    systemctl start zoneminder or service zoneminder start

    systemctl status zoneminder or service zoneminder status

Step 15: Access the web interface

To access the web Inreface/GUI enter the IP Address / zm

i.e server-ip/zm

After entering the Server Ip-Address then the page will appear as shown


Then Click on Apply, after that the Zoneminder Console will load as ashown


Therefore the Installation of ZoneMinder is Successfully.


Remove|Uninstall  zoneminder

    apt autoremove --purge zoneminder

    add-apt-repository --remove ppa:iconnor/zoneminder-1.36

    apt autoremove --purge apache2 mysql-server php