Set Up a Live IP Camera on Raspberry Pi Using Motion – Step‑by‑Step Guide
Raspberry Pi is a compact, powerful, low‑power computer beloved by hobbyists and professionals alike. Its versatility makes it ideal for on‑the‑go projects such as an IP camera that streams live video to any device worldwide.
What You’ll Need
- Raspberry Pi (any model with a camera interface)
- Micro‑SD card with a Raspberry Pi OS installed
- Camera module compatible with your Pi (e.g., Raspberry Pi Camera v2)
- Power supply, network connection (wired or Wi‑Fi)
Installation Steps
1. Prepare Your Pi
Download the latest Raspberry Pi OS from the official site, flash it to a micro‑SD card, and insert the card into your Pi. Power on the device.
Secure the default pi account with a new password:
sudo passwd pi sudo apt update
2. Attach the Camera Module
Connect the camera to the dedicated CSI port on the Pi. Run the configuration utility to enable the camera:
sudo raspi-config # Navigate to Interface Options → Camera → Enable # Reboot if prompted
Verify detection by checking for a videox entry in /dev/. If missing, update the kernel and load the driver:
sudo raspi-update sudo reboot sudo modprobe bcm2835-v4l2
3. Install Motion
Motion is an open‑source motion detection and video streaming daemon. Install it with:
sudo apt install motion
4. Configure Motion
Edit the main configuration file:
sudo nano /etc/motion/motion.conf
Adjust these key parameters to suit live streaming:
- daemon on
- stream_localhost off
- stream_maxrate 50
- framerate 50
- width 640
- height 480
Enable the daemon at boot:
sudo nano /etc/default/motion # Set start_motion_daemon=yes
5. Launch the Stream
Start the Motion service:
sudo service motion start
Open a web browser on any device within the same network and navigate to:
https://<YOUR_PI_IP>:8081
Replace <YOUR_PI_IP> with the Pi’s actual IP address. You should now see a live video feed from your camera.
6. Access from Anywhere
To view the stream outside your local network, configure port forwarding on your router for TCP port 8081 or set up a VPN for secure remote access. For advanced security, consider adding authentication or HTTPS support.
Enjoy your custom, low‑cost IP camera—perfect for home monitoring, wildlife observation, or DIY projects.
Manufacturing process
- Secure Home Monitoring with Home Assistant on Raspberry Pi: Motion, Alarm, and Video Capture
- Build a DIY Infrared Motion Sensor for Raspberry Pi – Step‑by‑Step Guide
- Control an LED with a PIR Motion Sensor on Raspberry Pi
- Master Raspberry Pi GPIO: Interfacing a PIR Motion Sensor on B+/Model 2
- How to Connect, Calibrate, and Program the HC‑SR501 PIR Motion Sensor with a Raspberry Pi
- Installing a Raspberry Pi Camera in a Birdhouse – Step‑by‑Step Guide
- Build a Raspberry Pi Webcam Robot – Step‑by‑Step Video Streaming Guide
- Setting Up a Raspberry Pi 3B, Camera Module, and iRobot Create: A Complete CS424 Guide
- Automated Motion‑Tracking Camera Base with Arduino and Servo Control
- How Cameras Revolutionize Workpiece Setup in CNC Machining