April 16, 20179 yr This is an update of the Zoneminder Docker initially created by aptalca to the latest version of Zoneminder. You can do an in place update of this Docker and your current configuration will be kept and the database updated.Note: This Docker has settings pre-configured so all you have to do is install your cameras and make your particular adjustments. Changes can be made as necessary for special needs after installation. If you need help with Zoneminder click here for the documentation and here for the forum. Search for Zoneminder in CA and install it. The Zoneminder WebUI can be accessed by left clicking on the Zoneminder Docker and selecting WebUI. The URL shown in the browser address bar is how you access Zoneminder. Any changes made to the port or networking setup can change this URL. A self signed ssl certificate is generated when the Docker starts if it does not exist and it is stored at appdata/Zoneminder/keys. This certificate is used for https access to Zoneminder and for the zmNinja Event Notification Server. You can supply your own certificate and replace the auto generated certificate if you'd like. Only secure access is allowed. An update is performed on every startup of the Zoneminder Docker to keep patches and updates applied to Linux. Zoneminder minor updates are applied automatically. Zoneminder major updates are not applied so I can test and verify them before being applied to the Docker. Major updates normally require changes to the Docker to work properly.Hardware Acceleration: Intel hardware acceleration is enabled in the Zoneminder Container.Follow these steps to enable Zoneminder to use it:Edit the Zoneminder template.Enable advanced view.Add '--device /dev/dri:/dev/dri' to the 'Extra Parameters'.Click Apply.Go to each Camera->Source.Enter 'vaapi' as the 'DecoderHWAccelName'.Enter '/dev/dri/renderD128' as the 'DecoderHWAccelDevice'.Check the log and see if it says anything about not enabling hardware acceleration. You can check and see if the intel VA-API driver is working inside the docker console by entering 'vainfo'. You should see the details of the VA-API driver. PTZ Control Scripts: If you have a PTZ camera that has a custom script, put it in the '/appdata/Zoneminder/control/' folder and whenever the Zoneminder docker is started, it will copy the script to the '/usr/share/perl5/ZoneMinder/Control' folder in the docker image. Change Databases: You can change to an external database by overwriting the default zm.config database settings. Change the following settings for your particular needs and put them in the file "99-mysql.conf' in the /appdata/Zoneminder/conf/ folder. Your settings will be installed when the docker is started.# ZoneMinder database hostname or ip address ZM_DB_HOST=localhost # ZoneMinder database name ZM_DB_NAME=zm # ZoneMinder database user ZM_DB_USER=zmuser # ZoneMinder database password ZM_DB_PASS=zmpass Set up eMail Notifications: Follow the guide here. The ssmtp configuration files are at appdata/Zoneminder/ssmtp/. Note: Be sure to set up a filter for emails. These changes are kept if Zoneminder is updated or removed and re-installed. Set up zmNinja Event Norifications: The zmNinja Event Notification Server is included in the Docker. The zmNinja Notification Server pushes events to your iOS and Android devices. Enable the 'Event Server' on your iOS or Andriod device and the server will automatically connect. Be sure to forward port 9000 on your router to the Zoneminder Docker. The server is configured to run with security with the self signed certificate generated on installation of Zoneminder. The zmNinja event server is not enabled by default. Enable it in Options->System->OPT_USE_EVENTNOTIFICATION. You can configure the zmnotificationserver.pl to run with or without security. Modify the 'appdata/Zoneminder/zmeventnotification.ini' file to turn off ssl and configure other parameters like the port to listen on for events. If you change the port, you'll need to modify the port in the docker configuration. Restart the Docker after you've made changes to the zmeventnotification.ini file. You can set up multiple ports for the notification server by defining two environment variables. MULTI_PORT_START="(start port number)" and MULTI_PORT_END="(end port number)" to configure apache2 for multi-port operation. Refer to the guide here. Here is a guide on the notification server. crontab Zoneminder has the ability to change states so you can have different operation of your cameras based on the time of day and/or day of the week. To set up cron events, create a file called 'cron; and place it in the appdata/Zoneminnder/ folder. The 'cron' file contents should be the crontab entries you want created. When the Zoneminder Docker is started it will put your 'cron' file entries into the root crontab. Example 'cron' file:# Daytime camera operation 0 8 * * * /usr/bin/zmpkg.pl Daytime # Nightime camera operation 0 20 * * * /usr/bin/zmpkg.pl Nighttime Note: The default purge 'Filter' is set for 50% of the disk where the Zoneminder data is stored. On Unraid this is not a good way to manage the growth of the events. I recommend setting up a purge filter based on the age of the events. This is the way to set up a filter to purge events by age: This filter purges events older than 30 days. You can set the 'days ago' to a value that makes sense for you. User Script You can enable a custom user script. Edit the docker template xml and add a variable: ADVANCED_SCRIPT with a value of 1. This will enable your script. Put your script in the appdata/Zoneminder/ folder and name it userscript.sh. The script will be executed each time the Docker is started before Zoneminder is started. Be sure to chmod +x userscript.sh so the script is executable. Troubleshooting when the container fails If you have a situation where the container fails to start, you can set NO_START_ZM="1" as an environment variable - this will spin up the container but will not automatically start the MySql and Zoneminder processes. This way, you can get into a command line in the container (docker exec -it Zoneminder /bin/bash) and troubleshoot your issue by using the following commands to start MySql and Zoneminder and fix any errors/problems with them starting. service mysql start service zoneminder startAccessing ZoneMinder Remotely with TailscaleThe ZoneMinder Docker container supports Tailscale for secure remote access without exposing ZoneMinder directly to the Internet.This eliminates the need for:Router port forwardingPublic DNS recordsA public IP addressA publicly managed SSL certificateOnly authenticated devices connected to the same Tailscale tailnet can access ZoneMinder.The examples below use this fictional Tailscale hostname:zoneminder.your-tailnet.ts.net Replace it with the Tailscale hostname assigned to your ZoneMinder container.PrequesitesTailscale must be installed and configured on Unraid.The ZoneMinder container must be authorized on your tailnet.MagicDNS and HTTPS certificates must be enabled for the tailnet.Tailscale must be installed and connected on each remote device.Docker template settingsEnable the advanced Tailscale settings in the ZoneMinder Docker template and configure Tailscale Serve as follows:Tailscale Serve: Serve Tailscale Serve Port: 8443 Tailscale Serve Target: https+insecure://localhost Tailscale Serve Local Path: Empty Tailscale Serve Protocol: Empty Tailscale Serve Protocol Port: =443 Tailscale Serve Path: Empty Tailscale Advertise Routes: Empty Tailscale Accept Routes: No The equals sign in =443 is required and should not be removed.Verify the Tailscale WebUI URLAfter applying the changes, the Tailscale WebUI link should resemble:https://zoneminder.your-tailnet.ts.net/zm Unraid may sometimes add the container’s WebUI port to the generated Tailscale WebUI link, particularly when the WebUI URL does not use a fixed IP address.The client-facing Tailscale URL must not include the container port.Use:https://zoneminder.your-tailnet.ts.net/zm Do not use:https://zoneminder.your-tailnet.ts.net:8443/zm Including :8443 connects directly to the container’s HTTPS service and presents its self-signed certificate. Omitting the port connects through Tailscale Serve on the standard HTTPS port and presents the trusted Tailscale certificate.The Tailscale Serve Port setting should remain 8443. Only remove the port from the generated WebUI link and from URLs configured in browsers and zmNinjaNg.Tailscale certificate configurationThe important setting for ZoneMinder is:https+insecure://localhost ZoneMinder’s internal web server uses HTTPS with a self-signed certificate. This setting tells Tailscale Serve to:Connect to the ZoneMinder backend using HTTPS.Connect through localhost inside the container.Accept ZoneMinder’s internally generated self-signed certificate.Tailscale Serve terminates the client HTTPS connection and presents the trusted Tailscale certificate for the *.ts.net hostname. The internal connection from Tailscale Serve to ZoneMinder continues to use ZoneMinder’s self-signed certificate.Without https+insecure://localhost, Tailscale Serve may not be able to establish the HTTPS connection to the ZoneMinder backend.This setting cannot be selected automatically for every container because applications may use plain HTTP, HTTPS with a trusted certificate, or HTTPS with a self-signed certificate.Testing browser accessMake sure Tailscale is running on the client, and then open:https://zoneminder.your-tailnet.ts.net/zm The normal ZoneMinder login page should appear without a certificate warning. The browser should show a valid Tailscale certificate for the *.ts.net hostname.If the page cannot be reached, first verify that Tailscale is connected on the client device.Testing the ZoneMonder APIThe ZoneMinder API can be tested with:https://zoneminder.your-tailnet.ts.net/zm/api/host/getVersion.json For direct browser or command-line access to this API endpoint, enable the following ZoneMinder option:OPT_USE_LEGACY_API_AUTH This option is not required for zmNinjaNg. It is needed only for direct browser or command-line API testing with this configuration.Configuring znMinjaNgConfigure the ZoneMinder portal address in zmNinjaNg as:https://zoneminder.your-tailnet.ts.net/zm Enter the normal ZoneMinder username and password.The phone or tablet must have Tailscale installed and connected before zmNinjaNg can reach ZoneMinder.OPT_USE_LEGACY_API_AUTH does not need to be enabled for zmNinjaNg.Event Server notifications are not covered here. The current container uses the legacy Event Notification Server, and testing with the newer zmesNg Event Server will be performed separately.Security and operational considerationsThis configuration provides:Encrypted remote accessA trusted Tailscale HTTPS certificateNo publicly exposed ZoneMinder web portsNo dependency on public DNSNo requirement for a static public IP addressAccess restricted to authorized tailnet devicesThe primary operational requirement is that Tailscale must be connected on the remote device.Returning to the previous configurationThe change is reversible.Set the container’s Tailscale option back to No Tailscale and restore the previous external-access configuration if necessary. This allows Tailscale to be tested without immediately removing an existing working configuration. Edited 38 minutes ago38 min by dlandon Added Tailscale implementation.
April 16, 20179 yr Any way to disable the internal MYSQL server and use an external one if you already have a dedicated server and/or docker running for it?
April 16, 20179 yr Author 1 hour ago, chaosratt said: Any way to disable the internal MYSQL server and use an external one if you already have a dedicated server and/or docker running for it? You'd have to go in the docker and change the mysql settings. I'm no expert on mysql, so I can't say how to do it.
April 16, 20179 yr Author I ended up making my own docker to do some updates to the OS and add a missing package. Wait until you see CA offer the version that is authored by me and then install it.
April 17, 20179 yr I'm glad you're picking this up [emoji1] I'll put a link to this thread in my template thread
April 17, 20179 yr Remeber to do this or you cant see live stream On first start, open zoneminder settings, go to the paths tab and enter the following for PATH_ZMS: /zm/cgi-bin/nph-zms
April 20, 20179 yr Author I have updated Zoneminder to 1.30.2 and changed the Docker template to accommodate setting a version to use. Zoneminder does not update in place, so you have to start a fresh configuration when updating. If you want to update to the newest version read the instructions in the OP. You can stay on the current version you have installed. The Docker manager will never show an "Update Ready" that would change versions. Any "Update Ready" notation will update the current version you have installed. Caution: Changing versions will render Zoneminder inoperative. You have delete the Zoneminder appdata folder and start a fresh configuration.
April 22, 20179 yr Hi guys, so i am using an old Android phone to test out ZM using IP Webcam app. For some reason i can not get a picture. I am seeing a ton of errors in the logs for m1. I am not sure what to do to correct this. Any help would be greatly appreciated? I have also included screen shots of the monitor config. Thanks! zm-log.html Edited April 22, 20179 yr by blknitro11
April 22, 20179 yr Author It appears from the log that Zoneminder can't get the jpeg images from the phone. Go back to the OP and verify all the settings have been made as suggested. Be sure you have set the PATH_ZMS properly. I found when setting up my cameras, it worked best to set them up as a 'Monitor' first and I had to restart Zoneminder after adding each camera. Zoneminder recommends using ffmpeg for the source type. Try using that setup. You might also click on the link to the Zoneminder documentation and review the camera setup section. Edited April 22, 20179 yr by dlandon
April 22, 20179 yr Author On 4/16/2017 at 11:59 AM, chaosratt said: Any way to disable the internal MYSQL server and use an external one if you already have a dedicated server and/or docker running for it? There is a zm.conf file in appdata/Zoneminder where the database is setup. Look for ZM_DB_HOST=localhost. You should be able to set that for the ip address of your mysql server. Enter the name of your database, and there are two additional lines where you set your credentials for the database. The zm.conf file will persistent and will not be removed if you update or uninstall Zoneminder.
April 22, 20179 yr Author The latest Zoneminder Docker has the options settings pre-configured on initial installation so they don't have to be changed after installation. You can just start out configuring your cameras.
April 22, 20179 yr The latest Zoneminder Docker has the options settings pre-configured on initial installation so they don't have to be changed after installation. You can just start out configuring your cameras. I had some trouble with buffer overruns then monitor timeouts with the initial install. So I decided to wipe everything and reinstall. Nice not to have to reconfigure. Thanks, all is working fine now.
April 23, 20179 yr Author I always thought it made sense to have those settings configured to start with. Ended up to just be some initial database settings that are set when the Docker is built. A lot more convenient for sure and is less prone to errors. I had some trouble setting up my cameras initially. I had to set them up as 'Monitor' and stop and start Zoneminder before they would stream video. It seemed to be a little harder to get them going with the 1.30.2 version.
April 23, 20179 yr Author The updated Zoneminder docker now updates on every restart. The updates are Linux patches and security fixes. This will keep the docker OS up to date.
April 25, 20179 yr Author All of the updates to the docker are me trying to get to the goal of an in-place Zoneminder update. I hate the idea that each new version of Zoneminder requires a complete setup from scratch. I am working on getting the docker build script to that point. Every time I make a change and push it to Github, a new docker is automatically built. Zoneminder is not being updated in any of these new docker builds. You can do a docker update without causing any problems.
May 5, 20179 yr Author I just released the docker for Zoneminder version 1.30.3. I finally achieved an in place version update! Version 1.30.3 of the Zoneminder docker will now update a previous Zoneminder version in place. Just edit the docker, select the 1.30.3 repository and apply. Your Zoneminder will update in place and your configuration will be kept. You no longer have to start from scratch when updating Zoneminder versions. Because of the ease in updating now, I encourage you to update to version 1.30.3 due to improved security. Previous versions have security issues. Edited May 5, 20179 yr by dlandon
May 5, 20179 yr Author Thanks for letting me know. I'm going to rework the repository and the template to have a single version of the Zoneminder docker that will do in place updates. Maintaining older versions is not my idea of a good time, and the security of previous versions is suspect. People should be using the latest version.
May 5, 20179 yr Author I am removing all previous versions of this docker. You will need to update by using the latest template. I recommend you backup your appdata first. To setup for the latest docker template: Remove the Zoneminder docker container. Search for the Zoneminder template in CA. Install the new Zoneminder template with any changes for your particular situation. Your configuration will be kept and the database updated. I am only going to maintain this docker with the latest version of Zoneminder for the following reasons: Maintaining and supporting previous versions is too much work. You can't roll back versions once the database has been updated. Previous versions have security issues.
May 6, 20179 yr Author I've removed the perl scripts from the appdata/Zoneminder folder. These files change with each version of Zoneminder and can't be persistent between versions. I think these scripts were exposed so users could customize the scripts. This presents problems in updating Zoneminder because they change on each version and I'm not sure it is really a good idea to modify them.
May 6, 20179 yr Is there a how to for getting email alerts in zoneminder on unraid working? I can't see any reference to ssmtp in the appdata folder to enter any config. VSent from my iPhone using Tapatalk
May 6, 20179 yr Author 25 minutes ago, dlandon said: As far as I know, you just configure it in the options of Zoneminder. It looks like I need to install ssmtp in the docker. EDIT: I'm working on updating the docker and will add ssmtp. The ssmtp configuration files will be at appdata/Zoneminder/ssmtp. Edited May 6, 20179 yr by dlandon
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.