Introduction: Raspberry Pi Home CCTV System

Picture of Raspberry Pi Home CCTV System


In this instructable, I will be showing you how to make a small CCTV system using the raspberry pi. I have wanting to do this for a while and have now got round to doing it! For this build, you will need the following:

1. A raspberry pi (Model B or later)

2.A webcam (Anyone will do)

3.An ethernet cable or wifi dongle (to connect to the internet)

4. An SSH client to connect remotely to the Pi. PuTTY, for windows or vSSH for mac. (You can also use vSSH lite)

5. A power cable

6. An HDMI or composite cable

7. A monitor ot TV

Follow along carefully and enjoy the build!

Step 1: Step 1: Seting Up Your Pi

Picture of Step 1: Seting Up Your Pi

1. The first step is to make sure you pi is connected to the internet. Click here on instructions on how to set up a wifi dongle. If you have already install ed your dongle or ethernet cable, then type into the command line, hostname -I. If you see a valid IP address like this eg., then you are connected to the internet!

2. Next open up your SSH client ie. putty or vSSH. In the space that says 'Host' or 'Hostname', type the IP address you saw earlier on your raspberry pi. ie Once this done, click 'connect'. It may ask if you want to connect, click 'yes permanently'. Next, if it asks you, type your login username and password, pi and raspberry by default.

3. After this you need to do is update your raspberry pi. To do this type, sudo apt-get update.

Step 2: Step 2: Installing the Software

Picture of Step 2: Installing the Software

One of the most important parts of the project is installing the camera software. The software is called 'Motion'.

1.First, install Motion by typing, sudo apt-get install motion. When it asks if you want to continue, press y and then enter

2. Now attach your webcam to one of the USB ports.

3. To make sure it is connected type, lsusb. If you see the name of your webcam, then it is connected.

Step 3: Step 3: Configuring Motion and Starting the Software

Picture of Step 3: Configuring Motion and Starting the Software

This will configure motion to start and begin to stream.

1. To enter the configuration file type,sudo nano /etc/motion/motion.conf.

2. The two things you need to change are, Daemon from OFF to ON and webcam_localhost from ON to OFF. If you want to search the file, press CTRL and C.

3. Exit the file by pressing CTRL and X then Y and enter.

4. To allow motion to start, type sudo nano /etc/default/motion. Once in the file, change start_motion_daemon=no to start_motion_daemon=yes.

5. Finally to start the program type, sudo service motion start.

Step 4: Step 4: Viewing the Data

Picture of Step 4: Viewing the Data

To view the stream from the camera, you will need to do the following.

1. In your web browser, type http://"your IP address":8081. (PS. Don't use Chrome. It doesn't work well!)


You will now see the live stream!!


If you have any problems, please leave them in the comments bellow.

Many thanks



陈俊 (author)2017-07-06

which application should I use to find what is my raspberry pi ip address

electrowiz89 (author)陈俊2017-07-09

If you are using a mac, then use LanScan -

For windows use Advanced IP Scanner -

For Linux use Angry IP Scanner -

Shujaa10 (author)2017-06-17

my ip address not working

electrowiz89 (author)Shujaa102017-06-17

Are you using wifi or ethernet?

Shujaa10 (author)2017-06-17

not showing any vedio.

electrowiz89 (author)Shujaa102017-06-17

This is usually a case of a dodgy camera or a loose connector going to the camera

winwickpoultry (author)2017-02-06

is there a way to use a raspberry or otherwise to do the following: I have an eight camera system which is connected to Dvr. The TV which is above the Dvr is connected to it by vga cable. Now what I want is to use two other smart TVs which are over 30 metres away from the Dvr. I want to display the eight camera set up on the distant TVs but by wifi . I also have adapters in the electricity sockets in most rooms which supply Internet. I cannot find anything which will provide the eight camera picture wirelessly on the TVs. It is quite easy to put four cameras on a mobile phone and view your cameras anywhere on the globe but impossible to see the same in an adjacent room to the Dvr. I have tried vga senders and found them to give too much interference especially with distance.

You can try this guide. I'm not quite sure if it is what you are looking for.

You could also connect the cameras to the pi using a USB hub and then have another raspberry pi or computer with the viewing webpage open that is connect to the TVs

RufusL (author)2015-10-01

Hi there!,

so you think you could add a PIR sensor and possibly an alarm (and keypad:)) to sound an alarm with any movement??

electrowiz89 (author)RufusL2016-07-10

I am unsure if you can add a PIR sensor, but you can program the software to take a picture or record a certain amount of video when motion is detected in the video. About the keypad, you would have to either use a different piece of software or look it up on the web.

HazwerN (author)2016-01-14

What if we want to record the video?

electrowiz89 (author)HazwerN2016-07-10

In the software on the raspberry pi there is the settings panel. One of the options is to record videos and images.

RufusL (author)2015-10-01

Hi there!,

so you think you could add a PIR sensor and possibly an alarm (and keypad:)) to sound an alarm with any movement??

coombsy (author)2015-09-11

Could you add cameras and include a date and time stamp?

electrowiz89 (author)coombsy2015-09-27


In the bottiom right hand corner of the display window (on your browser), there should be the time and date mark. About the multiple cameras, there is a great link here of a tutorial explaining how to do this.

newscrash (author)2015-07-07

Which distro are you running on the pi? Download links would help us out :)

electrowiz89 (author)newscrash2015-07-16

I am running raspbian.

To download it, go to this site

About This Instructable




More by electrowiz89:Raspberry Pi Home CCTV System
Add instructable to: