MotionEye is a popular software that is used to turn your raspberry pi into a CCTV.
The easiest way to install it is using a dedicated raspbian image - instructions here
However, there are times where you would like to install motioneye on an existing raspbian image.
I created a script to do just that (Works with different flavours of Raspbian - Buster, Stretch, Jessie):
curl -L http://bit.ly/38ObQp3|sudo -E bash -