Raspberry Pi IP camera with Motion

Using a Raspberry Pi and Camera module you can build yourself a simple IP camera, using Motion.

What you’ll need

– Raspberry Pi Zero Wireless – $10
– Camera module – $9
– Power supply – $5
– SD card – $6

Download and install the latest version of Raspbian onto your SD card, I used the lite version for this project, as I didn’t need a graphical user interface. Setup the wifi and you are ready to get started.


We need to setup the Pi first, run this command and make the following changes

sudo raspi-config

– Enable ssh
– Enable camera
– Enable boot to command prompt (automatic login)
– Update the default user password

From here you can now do everything over SSH, if that’s easier for you.

We’ll get started by updating Raspbian:

sudo apt-get update
sudo apt-get dist-upgrade

Then install the motion software

wget https://github.com/Motion-Project/motion/releases/download/release-4.0.1/pi_jessie_motion_4.0.1-1_armhf.deb
sudo apt-get install gdebi-core
sudo gdebi pi_jessie_motion_4.0.1-1_armhf.deb


We’ll make a folder to hold our new config file

mkdir ~/.motion

You can then either copy in the default configuration and edit it yourself, or use mine

cp /etc/motion/motion.conf ~/.motion/motion.conf
sudo nano ~/.motion/motion.conf

Note: You’ll probably want to update the password on line 519


To start motion you can run this command:

motion -c ~/.motion/motion.conf

To start motion on boot you can edit the rc.local file

sudo nano /etc/rc.local

Add in the following line, then reboot

motion -c /home/pi/.motion/motion.conf &

Next steps

Using MotionEye, you can create a hub to view all the cameras in your house/office/hackspace, instructions can be found here


  1. ali khan

    hey i followed your tutorial and used motion.conf file from your github it works the motion is triggered and pictures are saved but i want to know how to record videos using motion trigger and raspivid h.264 hardware encoded not ffmpeg

Leave a Reply to tom Cancel reply

Your e-mail address will not be published. Required fields are marked *