Raspberry PI opensource video surveillance with Zoneminder


RaspberryRasperri Pi was mainly designed to be used by young people who want to learn and discover the electronics and programming world without investing big amount of money. The latest improved version which has a 512 MB RAM available can be used to perform more complicated tasks as the one we want to show you today: how to make your home opensource video surveillance system using Raspberry PI, Zoneminder and a IP cam. In this system the Rasperry Pi works as a DVR (Digital Video Recorder); the acquired video files will be stored into the SD memory card and can be reached from everywhere by using a FTP server like Vsftpd.

ZoneMinder (http://www.zoneminder.com/) is an integrated set of applications which provide a complete surveillance solution allowing capture, analysis, recording and monitoring of any CCTV or security cameras attached to a Linux based machine; it can be used in single or multi-camera video security applications however, to avoid overstress of the Rasperry PI hardware and to have a reliable system,  it’s preferred to use only one camera. Zoneminder can be downloaded from http://www.zoneminder.com/downloads or can be installed from the Raspian repositories using the console and the “sudo apt-get install zoneminder” command following the installation instructions. Raspbian is a Debian based distribution optimized for the Rasperry PI so we suggest you to follow the installation guide for Debian (http://www.zoneminder.com/wiki/index.php/Debian). The installation procedure requires few minutes during which the user has to insert some data like mysql password. At the end you can get access to the web interface at http://localhost/zm where you can set your camera parameters and define surveillance areas, recording path and motion detection:


There are tips and suggestions for many kind of cameras at http://www.zoneminder.com/wiki/index.php/Hardware_Compatibility_List

 To set the FTP path use “Options” and “Upload” and configure the fields in order to match with the  FTP server.

EDIT 28 January 2018:

See https://wiki.zoneminder.com/Raspbian for further details.

21 thoughts on “Raspberry PI opensource video surveillance with Zoneminder

  1. Hello, I tried doing the apt-get install zoneminder on my pi and I get mysql errors after entering a root password. the error is telling me that a mysql root user already exists. So i tried removing mysql-server-5.5 , then I did apt-get autoremove, then apt-get purge. After everything that dealt with mysql server was removed i tried apt-get install zoneminder again. I got the mysql error again after entering the root password. Does anybody know what the root password is for mysql when installed in raspbian?


  2. Geez, why isn’t it in the instructions that you need to make the link

    sudo ln -s /etc/zm/apache.conf /etc/apache2/conf.d/zoneminder.conf

    sudo /etc/init.d/apache2 reload

    Everything was going smoothly up too this the point. It was really frustrating lol

    • Thank you kindly for coming back to share this important step after learning of it yourself. I was at a loss as to why localhost/zm returned a 404 and this solver the issue.

  3. Hi there, i’ll describe my planned Scenario for the use of a Raspberry Pi B+ with zoneminder:
    Video surveillance of a large room over night with two cams, one IP-based (in the compatibility list of zoneminder), the other usb wired (can be changed with an ip based).
    I run a MS AD Network and the Raspberry and the IP cam have to contact my DHCP-Server.
    I wish to save the captures into a Network share.
    The Raspberry should be controled only remotely.

    Have you any hints for me? Is this is a possible solution?

    Thanks for responses

    • Hi Dirk,

      you should perform some tests in order to make sure that the Raspberry Pi can manage both cams at a reasonable bitrate: don’t forget that it has limited capabilities for such kind of things.

      • I installed the apache2 and zoneminder on the pi and could open the Website on other machines.
        Then trying to establish a monitor (Remote IP-Cam) fails – I exactly used the instructions from the wiki, specially for my ip-cam model (Apexis J011 WS). Another try was the use of a USB cam. It was displayed as devce via dmesg | tail but configured as a monitor in zoneminder it fails. The errormessage with the probe-function in both configurations replied code 127.

        Help Wanted

  4. I have a Foscam FI8910W currently working on Windows 7 with a his proprietary Windows 7 tool. It is possible to save the MJPEG stream on an hard disk.

    The questions:
    1. if i move to rapberry-zoneminder, is it possible with zoneminder to save the MJPEG stream on an hard disk?
    2. is is possible to save only video or audio-video stream?


    • Hi,

      you can configure zoneminder to work as you like but obviously some features depend on the camera capabilities.

  5. Hi!
    I’ve been testing the solution using QEMU before buying the actual HW and finally made the purchase (being delivered in the next few days)

    My main question is, have you tested it with TWO IP cams instead of one?
    Is there a real performance degradation using two cammeras?
    I have no problem using only one, since it’s the camera I have outside home the one I attempt to monitor, but since I have another one inside as well, I was thinking in monitoring both.

    Second question, did you test it using WiFi dongle? Or wired via UTP?
    Did you see any significant difference between both scenarios?
    Thanks for the feedback!

    • Hi Pablo,

      we tested the system using one camera and a wired connection. The resources available on a Raspberry Pi are pretty limited so you have to try out if the result is as you aspect to be.

      Hardware Makers

  6. I installed in a RaspberryPi with debian and made ​​it to the login screen. But when I’m at …. zm/index.php I can only see some options and the page cycled and begin refreshing a lot of times, after that it send me to a page that says:

    Not Found

    The requested URL / zm / undefined was not found on this server.

    What do you think that it’s the problem?

  7. Hi,
    Thanks. I found instructions on the zoneminder website and wiki for my brand of ipcamera. Zoneminder seems to be running on the Pi and I seem to be logged into the ip camera but I can’t get the video to display on the screen. Can you point me to somewhere that might help me to troubleshoot this problem?
    Thanks for your help.

  8. Wait! I got the console running! Thank you for the instructions. I had mistyped one of the commands…

    Now, how do I add an IP camera on my local network? If you can guide me to a tutorial or instructions for zoneminder I would appreciate it.


    • Hi,

      you can find useful information on the official zoneminder website where you can find also tips related to many ipcam brands and models.

  9. Followed your instructions and (apparently) got Zoneminder installed successfully on my Pi. However, when I start Midori and enter http://localhost/zm I get “Not Found: The requested URL /zm was not found on this server”.

    Any suggestions?

Leave a Reply

Your email address will not be published. Required fields are marked *