| CPU | |
| Memory | 8GB |
| Storage | 128GB SSD |
| 3TB HDD | |
| OS | Ubuntu 20.04 LTS |
Zoneminder 1.34.x
Before we can install ZoneMinder we have to install and configure the software it needs to run. This includes Apache2, PHP7, & MySQL. We can install these one by one or, the easy way, by using tasksel.
sudo apt install taskselsudo tasksel install lamp-server
Note that you were not asked for password during the MySQL installation. Starting in 16.04 there is no need for a root password. Instead you can only connect via local socket, meaning you have to type “sudo mysql” at the command line to log in as root.
Next, per ZoneMinder’s recommendation, we’ll replace the default MySQL config file.
sudo rm /etc/mysql/my.cnf sudo cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf
Edit my.cnf and add sql_mode = NO_ENGINE_SUBSTITUTION to the [mysqld] section.
sudo nano /etc/mysql/my.cnf

Save the file and restart mysql
sudo systemctl restart mysql
This one is very important and one that you don’t see mentioned a lot. You need to setup the time and time zones before installing ZoneMinder. If you make changes afterwards, you’ll start to see error messages in the ZM logs and, in my case, lose access to see videos from the last hour.
sudo dpkg-reconfigure tzdata
If you’re in the US, like me, do not select US. Instead select America and find your time zone there. For me, its America > Los Angeles.
Next, set the time in PHP.
sudo nano /etc/php/7.4/apache2/php.ini
Search for date.timezone and uncomment the line by removing the ; at the begging. Set your time zone according to the PHP website. Again, making sure they match. For me its America/Los_Angeles.
By default MySQL is set to system time. If you changed the Time Zone on the system, restart the service before checking MySQLs time. To check, run this command:
sudo systemctl restart mysqlsudo mysql -e “SELECT NOW();”
If the time matches, then you’re good to go.
First we’ll need to install the official ZoneMinder PPA from Isaac Conner and then we can install ZoneMinder
sudo add-apt-repository ppa:iconnor/zoneminder-1.34sudo apt install -y zoneminder
Once the installation finishes, we’ll need to configure Apache2 by copying and enabling the zm.conf file, enabling a few mods, and finially restarting ZoneMinder and Apache2.
sudo chmod 740 /etc/zm/zm.confsudo chown root:www-data /etc/zm/zm.confsudo chown -R www-data:www-data /usr/share/zoneminder/sudo a2enmod cgi rewrite expires headerssudo a2enconf zonemindersudo systemctl enable zonemindersudo systemctl start zonemindersudo systemctl restart apache2
Zoneminder should be installed and ready to add cameras. To test this, go to http://ip_address/zm and the interface should be available. Its also a good idea to test the API by going to http://ip_address/zm/api/host/getVersion.json. You should see the API version in your browser.

That’s it! ZoneMinder is ready to go and you can start adding your cameras.