I followed these steps:

https://zoneminder.readthedocs.io/en/latest/installationguide/debian.html#easy-way-debian-stretch

Reference:

https://wiki.zoneminder.com/Debian