Installing ZoneMinder Camera System on Debian Bookworm

ZoneMinder is a popular open-source video surveillance and security application that allows users to monitor and record video streams from various types of cameras. If you’re running Debian Bookworm and looking to set up a robust surveillance system, ZoneMinder is an excellent choice. In this guide, we will walk you through the steps to install ZoneMinder on Debian Bookworm.

Don’t forget to join my Discord: https://discord.gg/YbSYGsQYES

Prerequisites

Before you start the installation process, make sure you have the following prerequisites in place:

  1. Debian Bookworm: Ensure you have a fresh installation of Debian Bookworm. You can download the latest version from the official Debian website.
  2. Root Access: You will need superuser (root) privileges to install and configure ZoneMinder.
  3. Internet Connection: Ensure your system has an active internet connection to fetch necessary packages during installation.

Step 1: Update System Packages

Start by updating your system’s package list to ensure you have the latest information about available software packages. Open a terminal and run the following command:

sudo apt update

Step 2: Install Required Dependencies

ZoneMinder has some prerequisites that need to be installed. Run the following command to install them:

sudo apt install -y apache2 mariadb-server mariadb-client libapache2-mod-php7.4 php7.4 php7.4-cli php7.4-common php7.4-mysql php7.4-gd php7.4-mbstring php7.4-xml php7.4-json php7.4-zip

During the installation, you will be prompted to set up a root password for the MariaDB database server.

Step 3: Install ZoneMinder

Now, it’s time to install ZoneMinder itself. Run the following command:

sudo apt install -y zoneminder

During the installation, you will be prompted to configure ZoneMinder. Select “Yes” to configure the database for ZoneMinder using dbconfig-common.

Step 4: Configure Apache

You need to configure Apache to work with ZoneMinder. Enable the necessary modules and configure the virtual host file:

sudo a2enmod cgi
sudo a2enmod rewrite
sudo a2enmod headers

sudo ln -s /etc/zm/apache.conf /etc/apache2/sites-available/zoneminder.conf
sudo a2ensite zoneminder.conf

Step 5: Adjust PHP Configuration

Edit the PHP configuration file to make the necessary adjustments:

sudo nano /etc/php/7.4/apache2/php.ini

Find the following lines and change their values as shown:

memory_limit = 256M
max_execution_time = 300
max_input_time = 300
post_max_size = 32M
upload_max_filesize = 16M
date.timezone = your_time_zone  # e.g., "Europe/Budapest"

Save the file and exit the text editor.

Step 6: Create the ZoneMinder Database

Next, you need to create the ZoneMinder database and grant privileges to the ZoneMinder user:

sudo mysql -u root -p

Enter your MariaDB root password and then execute the following SQL commands:

CREATE DATABASE zm;
CREATE USER 'zmuser'@'localhost' IDENTIFIED BY 'zmpass';
GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 7: Start ZoneMinder and Apache

Start the ZoneMinder service and enable it to start at boot:

sudo systemctl start zoneminder
sudo systemctl enable zoneminder

Restart Apache to apply the configuration changes:

sudo systemctl restart apache2

Step 8: Configure ZoneMinder

Now, open your web browser and access the ZoneMinder web interface by navigating to http://your_server_ip/zm/. You will be prompted to log in. The default username and password are both “admin.” It’s essential to change the password immediately after the first login.

Conclusion

Congratulations! You’ve successfully installed ZoneMinder on Debian Bookworm. You can now configure cameras and start using ZoneMinder for your video surveillance needs. Make sure to consult the official ZoneMinder documentation for advanced configuration and usage tips.

Don’t forget to join my Discord: https://discord.gg/YbSYGsQYES

Leave a comment