selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

GitHub
CheapSecurity logo

Self-host CheapSecurity

v1.2.0

Lightweight self-hosted CCTV for USB webcams on Linux SBCs

ReleaseOpen SourceAGPL-3.0
Updatedlast month
LanguagePython
Setup difficultyModerate
Stars
221
Ports
5000 (Web dashboard and MJPEG stream), 8554 (RTSP stream (optional, disabled by default))
Install with Python

What is CheapSecurity?

CheapSecurity is a privacy-focused, self-hosted CCTV application designed to run on low-power Linux single-board computers (SBCs) such as Raspberry Pi or Odroid with standard USB webcams. It provides a web dashboard with live MJPEG streaming, motion detection using frame differencing, and automatic recording that includes footage from before motion was detected. Recordings can be managed through an interactive calendar interface with bulk actions for download, deletion, and Telegram upload. The system integrates with Telegram for bot commands (snapshot, video recording, encryption toggles) and supports email alerts with snapshots. Optional cloud uploads to Google Drive and OneDrive are available, with per-channel AES-256 ZIP encryption for Telegram, Google Drive, and OneDrive. Night mode offers software low-light enhancement (CLAHE) or hardware switching to a second IR camera. An optional RTSP stream can be published via MediaMTX and FFmpeg for integration with NVRs, Home Assistant, or VLC. Storage cleanup policies include age, size, and emergency low-disk thresholds. The app runs as a Python Flask/Gunicorn service managed by systemd, with configuration via a JSON file and secrets via environment variables. It is licensed under GNU AGPLv3.

Should you self-host CheapSecurity?

CheapSecurity scores 45/100 on selfhost.directory (how scoring works) and ranks #20 of 24 in Video Surveillance. It has 221 GitHub stars.

It shipped 3 stable releases in the past year. The latest, v1.2.0, came out on 20 September 2026. New versions land roughly every 4 weeks.

Setup is moderate: expect some configuration beyond a single command. It is AGPL-3.0-licensed and written mostly in Python.

Its closest alternative on selfhost.directory is Frigate (84/100, 37 023 stars). It scores higher overall, so compare the two before you pick. See CheapSecurity vs Frigate side by side.

Features

  • AES-256 ZIP encryption
  • Automatic recording with pre-buffer
  • Cloud storage upload (Google Drive, OneDrive)
  • Email alerts with snapshots
  • HTTP Basic Auth
  • Live MJPEG streaming
  • Motion Detection
  • Night mode (software and dual-camera)
  • Recordings calendar and bulk actions
  • REST API with Swagger UI
  • Secrets via environment variables
  • Storage cleanup policies
  • Systemd Service
  • Telegram Bot Integration

CheapSecurity README

How to install CheapSecurity

Install CheapSecurity with Python

Environment variables
CHEAPSECURITY_TELEGRAM_BOT_TOKEN, CHEAPSECURITY_TELEGRAM_CHAT_ID, CHEAPSECURITY_SMTP_PASSWORD, CHEAPSECURITY_GDRIVE_CLIENT_ID, CHEAPSECURITY_GDRIVE_CLIENT_SECRET, CHEAPSECURITY_GDRIVE_REFRESH_TOKEN, CHEAPSECURITY_ONEDRIVE_CLIENT_ID, CHEAPSECURITY_ONEDRIVE_CLIENT_SECRET, CHEAPSECURITY_ONEDRIVE_REFRESH_TOKEN, CHEAPSECURITY_ENCRYPTION_PASSPHRASE, CHEAPSECURITY_WEB_AUTH_PASSWORD
  1. Verify OpenCV is available:

    python3 -c "import cv2; print(cv2.__version__)"
    

    If OpenCV is not installed, you have two options:

    • Option A — use a system OpenCV package (recommended on ARM boards such as the Odroid XU4, where a pre-built system package is usually optimized for the board).
    • Option B — install OpenCV via pip (convenient on x86/amd64 machines or when no system package is available). Use opencv-python-headless because the app does not need a GUI.
  2. Create and activate the virtual environment and install the app:

    Option A: system OpenCV (recommended for ARM)

    This creates a venv that can see the system site-packages, so the system cv2 is available inside the venv.

    cd $HOME/CheapSecurity
    python3 -m venv venv --system-site-packages
    source venv/bin/activate
    pip install -e .
    
    Option B: install everything via pip

    Use this if you do not have a system OpenCV or prefer a self-contained venv.

    cd $HOME/CheapSecurity
    python3 -m venv venv
    source venv/bin/activate
    pip install opencv-python-headless
    pip install -e .
    

    Note: On some older ARM boards the pip opencv-python-headless wheel may not be available or may be slow. If that happens, install OpenCV from your distribution's package manager instead and use Option A.

  3. Find your webcam device (usually /dev/video0):

    v4l2-ctl --list-devices
    
  4. Copy config.json.example to config.json and edit it:

    cp config.json.example config.json
    nano config.json
    
    • Set camera device, resolution, and frame rate
    • Fill in SMTP credentials if you want email alerts
    • Fill in Telegram bot token and chat ID if you want Telegram uploads

    Security: config.json is listed in .gitignore and must never be committed. It contains passwords and tokens. Always edit config.json, not config.json.example. If you add a new setting, update both files so the example stays in sync.

  5. Run the app:

    ./venv/bin/python -m cheapsecurity.app
    
  6. Open the dashboard in a browser:

    http://<odroid-ip>:5000
    

Two installation options: system OpenCV (recommended for ARM) or pip install. Requires Python 3.10+, OpenCV with V4L2, USB webcam.

CheapSecurity releases & version history

More in Video Surveillance

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…