To use ZoneMinder on a Raspberry Pi, follow these steps:
-
Prepare your Raspberry Pi:
- Ensure your Raspberry Pi is running the latest version of Raspberry Pi OS.
-
Update and Upgrade:
- Open a terminal and run:
sudo apt update sudo apt upgrade
- Open a terminal and run:
-
Install Apache, MySQL, and PHP (LAMP stack):
- Install Apache:
sudo apt install apache2
- Install MySQL:
sudo apt install mariadb-server
- Secure MySQL installation:
sudo mysql_secure_installation
- Install PHP and required modules:
sudo apt install php libapache2-mod-php php-mysql php-gd php-xml php-mbstring
- Install Apache:
-
Install ZoneMinder:
- Add the ZoneMinder repository:
sudo sh -c 'echo "deb http://www.deb-multimedia.org bullseye main non-free" >> /etc/apt/sources.list' sudo apt update sudo apt install deb-multimedia-keyring sudo apt update
- Install ZoneMinder:
sudo apt install zoneminder
- Add the ZoneMinder repository:
-
Configure ZoneMinder:
- Enable ZoneMinder to start at boot:
sudo systemctl enable zoneminder sudo systemctl start zoneminder
- Configure Apache for ZoneMinder:
sudo a2enconf zoneminder sudo a2enmod rewrite sudo systemctl restart apache2
- Enable ZoneMinder to start at boot:
-
Database Setup:
- Create ZoneMinder database:
Inside MySQL prompt:sudo mysql -uroot -p
CREATE DATABASE zm; CREATE USER 'zmuser'@'localhost' IDENTIFIED BY 'zmpass'; GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost'; FLUSH PRIVILEGES; EXIT;
- Import ZoneMinder database schema:
sudo mysql -uroot -p zm < /usr/share/zoneminder/db/zm_create.sql
- Create ZoneMinder database:
-
Final Adjustments:
- Set the correct timezone in
php.ini
:
Find and set:sudo nano /etc/php/7.4/apache2/php.ini
date.timezone = "Your/Timezone"
- Restart Apache:
sudo systemctl restart apache2
- Set the correct timezone in
-
Access ZoneMinder:
- Open a web browser and go to
http://your_raspberry_pi_ip/zm
.
- Open a web browser and go to
This should get ZoneMinder up and running on your Raspberry Pi. Adjustments may be necessary based on your specific setup and requirements.