With security becoming a top priority in homes, having a CCTV setup is no longer a luxury. But commercial solutions can be expensive. In this blog post, I’ll walk you through how to build a low-cost, DIY CCTV system using:
- A Raspberry Pi 3 Model B+
- ONVIF-compatible IP Cameras
- Shinobi CCTV software for recording
- Jellyfin media server for playback
- Twingate for secure remote access
Cost
Component | Details | Price |
---|---|---|
Raspberry Pi 3 Model B+ | Quartz Components | ₹3599 |
ONVIF-compatible IP Camera | Amazon India | ₹1300 |
32GB MicroSD Card | Amazon India | ₹499 |
Total cost: | ₹5398 |
What You Need
- Raspberry Pi 3 Model B+ (with built-in WiFi)
- Raspberry Pi OS Lite (64-bit, no GUI)
- SD card (minimum 16GB)
- ONVIF-compatible IP camera
- Power supply for Raspberry Pi
- Internet connectivity
- PC for setup
Step 1: Flash Raspberry Pi OS Lite (64-bit)
Download the Raspberry Pi Imager from: https://www.raspberrypi.com/software
While flashing, enable advanced options:
- Set hostname as raspberrypi
- Set pi as username and pi123 as password
- Configure WiFi credentials
- Enable SSH
Watch how to flash Raspberry Pi OS: https://youtu.be/YmmThbZmNIw
Boot your Pi and connect via SSH:
ssh pi@raspberrypi.local
It will ask password give pi@123, so you will be connected
NB: having hostname as 'raspberrypi' we dont needed to set a static LAN ip for it
Step 2: Install Shinobi CCTV Software
Switch to root:
sudo su
Run Shinobi installer:
sh <(curl -s https://cdn.shinobi.video/installers/shinobi-install.sh)
This will install SHinobi
Access Shinobi dashboard:
Use the default credentials provided during install. You can add ONVIF/IP cameras from here.
Watch how to install Shinobi: https://youtu.be/uQ_Egb37rmY
Step 3: Install Jellyfin Media Server
Update packages and install dependencies:
sudo apt update
sudo apt install apt-transport-https gnupg curl -y
Add the Jellyfin repository:
curl -fsSL https://repo.jellyfin.org/debian/jellyfin_team.gpg.key | \
sudo gpg --dearmor -o /usr/share/keyrings/jellyfin-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/jellyfin-archive-keyring.gpg] \
https://repo.jellyfin.org/debian bookworm main" | \
sudo tee /etc/apt/sources.list.d/jellyfin.list
Install Jellyfin:
sudo apt update
sudo apt install jellyfin -y
Enable and start the Jellyfin server:
sudo systemctl start jellyfin
sudo systemctl enable jellyfin
Access Jellyfin at:
Watch how to install Jellyfin: https://youtu.be/RNKk7m27BrM
Step 4: Link Shinobi Recordings to Jellyfin
Shinobi saves recordings (by default) in:
/home/Shinobi/videos/<group>/<monitor>/
To locate the recordings in Shinobi, run the following command:
ls /home/Shinobi/videos/
You will see a group folder. Enter the group folder (e.g., ACWJZJMYzs), and inside it, you will find folder for camera you added in shinobi (e.g., EMYZv1T11w). Once inside the camera folder, running ls will display all the recorded video files.
ls /home/Shinobi/videos/ACWJZJMYzs/EMYZv1T11w
Provide necessory permissions
sudo usermod -aG video jellyfin
sudo chown -R jellyfin:jellyfin /home/Shinobi
sudo chmod -R 755 /home/Shinobi
In the Jellyfin dashboard: http://raspberrypi.local:8096
- Go to Dashboard > Libraries > Add Media Library
- Choose Videos
- Set the folder path to the Shinobi recordings directory
Install Jellyfin Android App in your phone, set server url with http://raspberrypi.local:8096 and login with your credentials.
Now you can watch your CCTV footage on the app just like a regular media file!
Step 5: Access Remotely with Twingate
- Sign up for free at https://www.twingate.com (free for 1 device).
- Install the Twingate client on your Raspberry Pi and mobile device.
- Set up a connector and access your Jellyfin installed in Raspberry Pi securely from anywhere.