Zoneminder( docker image) on OpenWrt

Hi there
as these opensource router get more and more powerful , I 've made the router do more and more tasks. So I compiled some docker images for those who might want zoneminder running on thier openwrt router it works with arm7, arm64 and amd64. it works with locally installed mariadb

form a fresh install of openwrt

ssh root@192.168.1.1

opkg update && opkg install block-mount e2fsprogs kmod-fs-ext4 kmod-usb-storage kmod-usb2 kmod-usb3
opkg install docker docker-compose dockerd luci-app-dockerman nano bash mosquitto-client-ssl mosquitto-ssl

mkdir /srv
mkdir /srv/mysql

opkg install mariadb-client mariadb-client-extra mariadb-server mariadb-server-extra openvpn-openssl luci-app-openvpn

nano /etc/config/mysqld
change to --> option enabled '1'

backup - primary ( for router rebuilt at some later date)

log into webportal to setup overlay and/or openvpn portforwarding
add overlay disk if using one ( ie SSD or USB stick)
System> Mount Points > Mount points > add

openvpn port forwarding refer to this
https://forum.openwrt.org/t/howto-free-cheap-vpn-port-forwarding-for-starlink-type-systems-portmap-io/

reboot
now setup mariadb
mariadb -u root

you can use these or edit for your custom settings

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

zoneminder opens on 443 by default -- a few ways around this ;
1: docker port map zoneminder via command line set up
2: change openwrt webport from 443 to something else ie 444 via

nano /etc/config/uhttpd

then reboot
or

3: edit the ports with in the container after you install it >edit>console

nano /etc/apache2/ports.conf

and edit the ports 443 to ones you prefer
then edit

nano /etc/apache2/sites-enabled/001-default-ssl.conf

edit Virtual host to a port you preferred

after reboot

ssh in again and install your image :
arm64

docker pull sash999/zoneminder_localdb:arm64

arm/v7

docker pull sash999/zoneminder_localdb:arm7

amd64

docker pull sash999/zoneminder_localdb:amd64

once finished downloading container

now log into openwrt webportal https://192.168.1.1:444 ( new port address ) or 192.168.1.1 if using http

go to docker > container then press add

Name zoneminder
image - sash999/zoneminder_localdb
network - host-host
timezone- "what ever your timezone is"

save then start container ( it takes some time to first initialize the container)

after a couple minutes you should be able to log into zoneminder at

https://192.168.1.1/zm
and set up your cameras

if you wish custom setting zoneminder setting once it started you can go to edit> console > connect then cd /etc/zm/ or nano zm.conf

1 Like