🛡️ Getting Started with OpenSentry-LVM: Turn Any Linux Device into a Smart Security Camera
By S’Bussiso Dube
🌒 A New Age of Private Security
When you set up a “smart” home camera, you’re usually surrendering two things — privacy and control.
Most modern camera systems, from Ring to Nest, push your footage through corporate servers. They promise safety but demand surveillance. But what if your home security could be entirely yours — no cloud, no subscriptions, no hidden data collection?
That’s exactly what OpenSentry-LVM makes possible.
🔍 What Is OpenSentry-LVM?
OpenSentry-LVM is a lightweight, self-hosted motion-detection and live-video monitoring system for Linux. It transforms any device — a desktop, mini-PC, or Raspberry Pi — into a privacy-first smart security camera.
It’s fast, minimal, and open source. No servers to trust. No APIs to leak data. Just your camera, your network, and your rules.
✨ Features at a Glance
- 🎥 Live streaming via a sleek web dashboard (mobile-friendly).
- 🧠 Motion detection powered by OpenCV’s MOG2 background subtraction.
- 📸 Snapshots — manual or automatic when motion is detected.
- 🔐 Authentication options: local or OAuth2 (for SSO).
- 🌐 mDNS discovery — find cameras automatically on your LAN.
- 🐋 Docker-ready for easy container deployment.
- ⚙️ Fully configurable with a single
config.jsonor environment variables.
👉 GitHub Repository: https://github.com/Sbussiso/OpenSentry-LVM
🧰 What You’ll Need
Before you begin, prepare the essentials:
| Requirement | Description |
|---|---|
| Linux device | Raspberry Pi 4/5, desktop, or server |
| Camera | USB webcam or Pi Camera (shows up as /dev/video0) |
| Python 3.12+ | Required for source deployment |
| Docker (optional) | Simplifies container deployment |
| Network access | So you can reach the web interface |
On Raspberry Pi, enable the camera interface first:
sudo raspi-config
# Interface Options → Camera → Enable
Then check it’s detected:
ls /dev/video*
🚀 Step 1: Clone the Repository
Let’s grab OpenSentry-LVM from GitHub:
git clone https://github.com/Sbussiso/OpenSentry-LVM.git
cd OpenSentry-LVM
🧩 Step 2: Choose Your Setup
You have two ways to deploy OpenSentry-LVM: directly from source, or with Docker.
🐍 Option A — Run from Source
This method gives you full control and visibility.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uv run server.py
Once it starts, visit:
Default login:
Username: admin
Password: admin
(Use your device’s IP instead of 127.0.0.1 if accessing from another machine.)
🐳 Option B — Run via Docker
Prefer a clean container setup? It’s just as easy:
docker compose -f compose.yaml build --pull
docker compose -f compose.yaml up -d
Then open: 👉 http://<device data-preserve-html-node="true"-ip>:5000
🖥️ Step 3: Explore the Dashboard
Once you log in, you’ll see:
- A live video feed from your camera
- Real-time motion detection overlays
- Options for snapshots, settings, and authentication
Wave your hand in front of the camera — you’ll instantly see colored boxes showing detected motion. It’s immediate, visual, and surprisingly smooth even on low-power boards.
⚙️ Step 4: Configure the System
Settings are simple and human-readable, stored in config.json.
Here’s a sample:
{
"auth": { "auth_mode": "local" },
"motion_detection": {
"min_area": 500,
"pad": 10,
"mog2_var_threshold": 16,
"mog2_history": 500
},
"snapshots": {
"enabled": true,
"cooldown": 15,
"directory": "snapshots"
},
"video": { "width": 640, "height": 480, "fps": 15 },
"stream": { "jpeg_quality": 75, "raw_fps": 15 }
}
Tweak these values to match your device’s performance:
- Lower the resolution for a smoother experience on Raspberry Pi.
- Adjust min_area for sensitivity (larger = less sensitive).
- Modify cooldown for snapshot frequency.
🧪 Step 5: Test Motion Detection
Ready to test?
- Keep the dashboard open.
- Move an object in view.
- Watch for motion boxes and snapshot triggers.
You’ll see the system react in real time, highlighting movement and saving images when motion exceeds your threshold.
🔒 Step 6: Secure & Optimize
Before you leave it running 24/7, take a few minutes to lock it down.
🧱 Change Default Credentials
export OPENSENTRY_USER="yourname"
export OPENSENTRY_PASS="strongpassword"
🕸️ Add HTTPS
Use a reverse proxy like Nginx, Caddy, or Traefik for SSL.
📴 Disable Discovery (optional)
If you don’t need LAN auto-discovery:
export OPENSENTRY_MDNS_DISABLE=1
🔑 Integrate OAuth2
Perfect if you’re using OpenSentry in a corporate or multi-user environment.
🧰 Common Fixes
| Issue | Fix |
|---|---|
| Camera not found | Run ls /dev/video*; verify hardware detection. |
| High CPU usage | Lower FPS, reduce resolution, or JPEG quality. |
| Segfaults on ARM | Use opencv-python-headless with gevent. |
| Port already in use | Change OPENSENTRY_PORT. |
| OAuth2 fails | Check redirect URIs and credentials. |
🧱 Optional: Auto-Start on Boot (Raspberry Pi)
If you want OpenSentry-LVM to launch automatically:
sudo nano /etc/systemd/system/opensentry.service
Paste:
[Unit]
Description=OpenSentry-LVM
After=network.target
[Service]
User=pi
WorkingDirectory=/home/pi/OpenSentry-LVM
ExecStart=/usr/bin/python3 server.py
Restart=always
[Install]
WantedBy=multi-user.target
Then:
sudo systemctl enable opensentry
sudo systemctl start opensentry
Now, your Pi becomes a self-booting security camera.
📸 The End Result
You’ve just created a private, self-contained surveillance system that:
- Detects motion in real time
- Captures snapshots of activity
- Streams video securely over your local network
- Stores everything locally, under your full control
No subscriptions. No tracking. No silent uploads.
Just you — and your sentry.
🧭 Summary
| Step | Action |
|---|---|
| 1 | Clone the GitHub repo |
| 2 | Choose source or Docker setup |
| 3 | Run the service and log in |
| 4 | Configure your settings |
| 5 | Test and adjust |
| 6 | Secure and automate |
You can set up a reliable home or lab camera system in under 15 minutes — and keep every frame private.
💡 Final Thoughts
OpenSentry-LVM isn’t just a camera app — it’s a statement. It’s a reminder that open source can give us tools as polished as commercial ones, without the trade-offs of surveillance capitalism.
If you value privacy, autonomy, and a bit of hacker spirit, OpenSentry-LVM is a perfect weekend project.
🔗 Try it now: github.com/Sbussiso/OpenSentry-LVM