sudo apt-get update && sudo apt-get upgrade
sudo apt-get install motion
sudo apt-get install motion
sudo nano /etc/motion/motion.conf
sudo nano /etc/default/motion
start_motion_daemon=yes
sudo reboot
http://ipaddress:8081/?action=stream