Either install the MotionEye OS (all components included, but otherwise stripped out):
https://github.com/ccrisan/motioneyeos
or install Raspbian and then install the packages on top.
https://github.com/ccrisan/motioneye/wiki/Install-On-Raspbian – be sure to add bcm2835-v4l2
to /etc/modules
and reboot before starting. Follow the instructions exactly as written – simple.
Configuration file can be edited:
https://github.com/ccrisan/motioneye/wiki/Configuration-File
e.g. to change web port from 8765 (default) to 80