Debian 12 Bookworm with Zoneminder 1.36.x and 1.37.x

From ZoneMinder Wiki
Revision as of 11:33, 8 June 2023 by Bbunge (talk | contribs)
Jump to navigationJump to search

Debian 12 Bookworm is being released with Zoneminder 1.36.33 and as usual for Debian the zm database needs to be created manually.

Note: This is an initial version done with Bookworm RC4. I am able to get a cam to stream and capture but several other things do not work such as the API. I will work more with this after the official release.

In Bookworm sudo is installed with the desktop version but you will have to install sudo with the server version and add the user to the sudoers file. Become root with

su

Install sudo

apt install sudo

Then add the user

/sbin/adduser username sudo 

I recommend rebooting at this point

Become root

sudo su

Install Apache2, PHP and your favorite database (Mariadb recommended). A quick way to install LAMP is:

apt install apache2 mariadb-server php libapache2-mod-php php-mysql 

Secure MySQL or Mariadb, create root password et. al.

mysql_secure_installation

Install Zoneminder

apt install zoneminder


Create Zoneminder database in MySQL (Note: this also creates the default Zoneminder user and permissions in MySQL)

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
mysqladmin -uroot -p reload

Set permissions of /etc/zm/zm.conf to root:www-data 740

chmod 740 /etc/zm/zm.conf
chown root:www-data /etc/zm/zm.conf
chown -R www-data:www-data /usr/share/zoneminder/
chown -R www-data:www-data /var/cache/zoneminder/

Enable Zoneminder service to start at boot

systemctl enable zoneminder.service

Add www-data to the sudo group (to enable use of local video devices)

adduser www-data video

Start Zoneminder

systemctl start zoneminder.service

Enable Zoneminder configuration in Apache.

a2enconf zoneminder
a2enmod cgi
a2enmod rewrite
a2enmod headers
a2enmod expires
service apache2 reload

Install complete. Open Zoneminder/Options and set the timezone