Linux

CheapSecurity: Self-Hosted CCTV di Linux SBC — Privasi + Zero Subscription 2026

CheapSecurity: Self-Hosted CCTV di Linux SBC — Privasi + Zero Subscription 2026

Proyek CheapSecurity yang muncul di Hacker News kemarin langsung menarik perhatian gue — CCTV self-hosted lightweight yang jalan di Linux SBC (Single Board Computer) seperti Raspberry Pi dan Orange Pi. Di saat banyak orang frustrasi dengan cloud CCTV yang langganan bulanannya makin mahal atau privacy-nya dipertanyakan, konsep CheapSecurity menarik banget: full self-hosted, no subscription, low power consumption, dan bisa pakai hardware bekas yang sudah lo punya. Setelah baca code-nya di GitHub dan coba setup sendiri di Raspberry Pi 4 bekas yang nganggur di laci, gue mau share pengalaman real — termasuk masalah yang gue temuin dan workaround-nya.

Masalah Cloud CCTV yang Bikin Orang Beralih ke Self-Hosted

Cloud CCTV services (Ring, Nest, Arlo, dll) memang convenient — out of the box, app langsung jalan, no configuration. Tapi ada beberapa hal yang sering jadi deal-breaker untuk orang tech-savvy: subscription cost yang menumpuk ($10-30/bulan per camera), video yang disimpan di server company yang lo nggak punya kontrol, dependency ke internet uptime (kalau Wi-Fi down, camera mati), fitur premium yang dipisahkan (orang detection, package detection butuh plan mahal), dan data privacy — rekaman rumah lo di-train untuk improve model AI mereka tanpa kompensasi.

Self-hosted CCTV jawab semua itu: zero subscription setelah hardware, video 100% di storage lokal, jalan offline, fitur unlimited sesuai yang lo develop sendiri, dan data nggak kemana-mana. Trade-off-nya: lo harus setup sendiri, maintain sendiri, dan troubleshoot kalau ada masalah. Tapi untuk orang yang sudah biasa main Linux dan nggak mau bayar recurring cost, self-host adalah clear winner.

CheapSecurity: Arsitektur dan Design

CheapSecurity bukan produk jadi — dia adalah framework/reference implementation yang bisa lo adapt. Design-nya sederhana: Linux SBC sebagai recording server, USB webcam atau IP camera sebagai input, motion detection algorithm (built-in OpenCV), dan web interface untuk live view + playback. Semua ditulis dalam Python dan Go, total codebase sekitar 3,000 lines, dependency minimal.

Yang bikin CheapSecurity berbeda dari motion (project CCTV Linux lawas) atau ZoneMinder (heavyweight CCTV suite) adalah fokus ke simplicity. Motion masih pakai config file yang kompleks, ZoneMinder butuh MySQL + Apache + PHP stack. CheapSecurity: single binary, SQLite untuk metadata, embedded HTTP server untuk UI. Total memory footprint 50-80MB di Raspberry Pi 4. Bandingkan dengan ZoneMinder yang bisa 500MB+.

Design decision penting dari CheapSecurity: use SQLite untuk metadata database. Untuk CCTV use case, SQLite lebih dari cukup. Lo cuma write metadata (motion events, recording timestamps), bukan video data itself. Video disimpan sebagai file MP4 di filesystem. SQLite handle ratusan event per hari tanpa masalah.

Hardware yang Bisa Dipake

Buat CheapSecurity server, requirement minimum-nya ringan. Raspberry Pi 4 (2GB RAM cukup, 4GB recommended) di $35-50. Orange Pi 5 (4GB atau 8GB) di $50-100. Old laptop atau mini PC bekas (Intel NUC, Lenovo ThinkCentre) juga work dan lebih powerful. Storage: microSD 32GB minimum, tapi untuk production pakai SSD via USB 3.0 enclosure ($30-50 untuk SSD 256GB).

Buat camera, CheapSecurity support banyak jenis. USB webcam generic ($10-30) untuk basic monitoring. Raspberry Pi Camera Module v3 ($35) untuk Pi-specific dengan quality bagus. IP camera RTSP-compatible ($40-100 per unit) untuk deployment multi-camera tanpa kabel USB panjang. Reolink, Hikvision, Dahua — semua major brand support RTSP stream.

Di setup gue, gue pakai Raspberry Pi 4 bekas (4GB RAM) + SSD 256GB via USB 3.0 enclosure, satu Raspberry Pi Camera Module v3 untuk testing, dan satu IP camera Reolink RLC-810A (PoE) untuk outdoor. Total hardware cost: $0 (semua bekas) + $50 SSD + $35 camera. Untuk IP camera baru bisa tambah $80-100.

Setup CheapSecurity Step-by-Step

Install Raspberry Pi OS Lite (64-bit) di SSD, boot, dan update system. Install dependency Python dan OpenCV. Clone CheapSecurity repo dari GitHub, build binary-nya, lalu setup config file. Config file menentukan: video source (USB atau RTSP URL), motion detection sensitivity, recording duration, storage path, dan web interface port.

Default config untuk single camera sudah cukup work. Edit file config.yaml di /etc/cheapsecurity/config.yaml, set video_source ke /dev/video0 (untuk USB) atau rtsp://user:pass@ip-camera/stream1 (untuk IP camera). Set storage_path ke /var/lib/cheapsecurity/recordings. Enable systemd service untuk auto-start on boot.

Access web UI di http://[ip-pi]:8080. Default credentials admin/admin (WAJIB ganti). Dari UI, lo bisa: live view dari camera, browse recording berdasarkan tanggal, download recording, set motion detection zones, dan konfigurasi alert (email, Telegram, webhook).

Setelah running, check resource usage dengan htop atau atop. CheapSecurity di Pi 4 + single camera pakai ~30% CPU saat recording, ~5% saat idle. Memory ~150MB. Storage growth sekitar 2-5GB per hari per camera (tergantung motion frequency dan quality setting).

Motion Detection yang Works dengan Baik

Motion detection adalah fitur paling penting dari CCTV — tanpa itu, lo cuma rekam 24/7 dan buang storage. CheapSecurity pakai algoritma OpenCV background subtraction (MOG2). Algoritma ini learn background scene dan flag area yang berubah. Sensitivity bisa di-adjust: terlalu sensitif = banyak false positive (daun bergerak, bayangan, hujan), terlalu rendah = miss real motion.

Optimasi motion detection yang gue pelajari: tune sensitivity per camera position, karena outdoor dengan pohon vs indoor dengan AC punya karakteristik beda. Set minimum motion duration (default 2 detik) supaya ignore gerakan瞬时. Define motion zones (kasih ignore zone untuk area yang ada flag atau pohon yang selalu bergerak). Set recording post-buffer (5-10 detik) supaya capture lanjutan motion.

False positive di outdoor adalah masalah klasik. CheapSecurity support multi-frame confirmation: motion harus terdeteksi di N consecutive frames sebelum trigger. Set ke 3-5 frames biasanya sweet spot. Untuk reduce false positive lebih lanjut, bisa integrate dengan ML-based detection (YOLO, MobileNet) — tapi itu project terpisah, CheapSecurity nggak include itu by default.

Storage Management dan Retention

CCTV storage bisa membengkak cepat. Untuk CheapSecurity, retention strategy yang gue pakai: video di-keep 30 hari, oldest auto-delete. Compress video older dari 7 hari ke quality lebih rendah (medium quality, ~480p). Backup critical recordings ke cloud (Backblaze B2 atau S3) sebelum auto-delete. Script retention cleanup jalan daily via cron.

Estimate storage: 1080p H.264 video @ 30fps = ~2GB/jam per camera. Dengan motion detection aktif, average recording ~4-6 jam/hari per camera. Jadi ~10-12GB/camera/day. Dengan 30-day retention, butuh 300-360GB storage per camera. SSD 1TB cukup untuk 2-3 camera setup dengan retention 30 hari.

Alternative: pakai H.265 (HEVC) encoding, 40-50% lebih efficient dari H.264. Tapi butuh camera atau transcoding support. Atau turunkan frame rate ke 15fps (cukup untuk monitoring, bukan forensic detail) dan resolution ke 720p.

Network Setup untuk Multi-Camera

Untuk deployment multi-camera, network planning penting. Tiap IP camera butuh bandwidth ~2-5 Mbps (tergantung resolution dan bitrate). Dengan 4 camera, butuh ~20 Mbps upload bandwidth di router. CCTV network sebaiknya di-segmented ke VLAN terpisah dari main network — security best practice.

CheapSecurity bisa aggregate multiple camera stream di satu server. Tambah camera di config, restart service, dan semua recording ke server yang sama. Web UI bisa show multiple camera dalam grid view. Storage perlu planning sesuai jumlah camera.

Buat remote access (kalo lo mau lihat CCTV dari luar rumah), ada beberapa opsi. Port forwarding langsung (Nggak recommended karena expose service ke internet). VPN (Tailscale atau WireGuard) — paling secure, semua access lewat encrypted tunnel. Cloudflare Tunnel — free, no port forwarding, tapi sedikit tambahan latency.

Gue pakai Tailscale untuk remote access. Install Tailscale di Pi CCTV server dan di HP/laptop lo. Tailscale bikin private network overlay. Dari HP, akses CCTV UI via http://[tailscale-ip]:8080. Encrypted, no port forwarding, dan bisa share access ke keluarga tanpa expose ke internet.

Alert dan Notifikasi

CCTV tanpa alert cuma jadi video recorder pasif. CheapSecurity support multiple alert channels. Email via SMTP — tapi gue nggak recommend karena noisy dan sering masuk spam. Telegram bot — paling reliable, instant, dan free. Push notification via ntfy.sh — lightweight, no app install, privacy-friendly.

Setup Telegram alert: bikin bot via @BotFather, dapet token, set chat_id. Di CheapSecurity config, tambah telegram section dengan token dan chat_id. Alert message include thumbnail dari motion detection. Free dan instant.

Smart alert configuration: jangan alert untuk semua motion. Set cooldown period (5-10 menit antar alert untuk camera yang sama supaya nggak spam). Set motion confidence threshold. Allow alert schedule (misal cuma malam hari saat lo tidur). Rekam 10 detik video untuk setiap alert dan kirim sebagai attachment.

Comparison dengan Alternatif

Self-hosted CCTV alternatives lain yang bisa dipertimbangkan: ZoneMinder — feature lengkap tapi heavyweight, butuh MySQL + Apache. Shinobi — modern, multi-camera support, tapi setup lebih kompleks. Frigate (NVR dengan ML detection) — best untuk orang yang mau person/car detection built-in, tapi butuh hardware lebih kuat (Intel NUC atau Jetson Nano). MotionEye — front-end untuk motion, simple tapi limited features. Blue Iris (Windows only) — commercial tapi powerful, $65 one-time purchase.

CheapSecurity ideal untuk: homelab enthusiast yang mau simple dan self-contained, deployment 1-4 camera, low-power always-on system, orang yang prefer SQLite daripada MySQL/PostgreSQL. Kalau lo butuh person detection atau license plate recognition, tambahin Frigate atau integrate dengan Home Assistant. CheapSecurity adalah building block, bukan complete solution untuk advanced use case.

Security Hardening untuk CheapSecurity

CCTV server yang ke-compromise = privacy disaster. Hardening yang wajib: ganti default password, enable HTTPS untuk web UI (Let's Encrypt via Caddy atau Nginx reverse proxy), disable root login via SSH, setup firewall (UFW atau iptables) — block semua port kecuali yang lo perlu, enable fail2ban untuk brute force protection, dan update system + CheapSecurity secara rutin.

Jangan expose web UI langsung ke internet tanpa VPN. Kalau lo perlu remote access, pakai Tailscale/WireGuard seperti yang gue jelaskan di section network. Video recording privacy juga penting — encrypt storage pakai LUKS kalau CCTV server pakai laptop/mini PC dengan storage yang bisa dicuri.

Backup config dan critical recording ke off-site location. CheapSecurity config di /etc/cheapsecurity, recording di /var/lib/cheapsecurity/recordings. Backup ke encrypted USB atau cloud storage. Test restore procedure secara berkala.

Kesimpulan

CheapSecurity menarik karena simplicity-nya. Untuk homelab enthusiast atau small business yang mau self-hosted CCTV tanpa complexity ZoneMinder, ini sweet spot. Setup 1-2 jam untuk satu camera, hardware murah, low maintenance. Hasilnya: privacy total, no subscription, full control.

Real-world result gue: setelah 3 bulan running, zero false negative (semua motion penting ke-capture), false positive manageable setelah tune sensitivity, storage usage predictable, dan zero security incident. Recommended untuk siapa aja yang comfortable dengan Linux basic.

Buat yang mau eksplor self-hosted infrastructure lebih lanjut, baca juga panduan self-host Ollama untuk AI di homelab, dan hardening SSH server untuk secure remote access. CheapSecurity adalah satu piece dari puzzle self-hosted infrastructure yang lebih besar — camera, AI inference, monitoring, dan automation bisa saling integrate.

💬 Komentar (0)

Belum ada komentar. Jadilah yang pertama! 💬

Komentar akan muncul setelah moderasi.