A privacy-focused, intelligent security camera system.
- Multi-camera support w/ minimal configuration. Supports USB cameras and the Raspberry Pi camera module.
- Motion detection that automatically saves videos and lets you view them in the web app.
- Encrypted in transit, both from the cameras to the server and the server to your browser.
- Self-Hosted
- Free and Open Source (GPLv3)
Sec-cam-server is designed to be deployed flexibly. There are 2 core components:
A device capable of capturing video and streaming to the server. Requirements:
- Must be able to run Python
- Must have a device capable of capturing video (e.g. a USB camera, webcam, or raspberry pi camera module)
- Must be able to communicate to the server over a network. During setup, you will point the camera at the server's hostname or IP address.
The server components aggregates feeds from the cameras, performs motion detection, and makes video available in a web UI via an API. The server can be a standalone host, or can run on one of your cameras (e.g. a Raspberry Pi). Requirements:
- Must be able to run Docker.
- Must be accessible to your camera(s) over a network.
Example 1: A standalone server, with the hostname sec-cam-server.local
, and 2 cameras, with hostnames camera1.local
and
camera2.local
.
- On
sec-cam-server.local
, follow the instructions in "Setting up the server". Replace<server-hostname:server-port>
withsec-cam-server.local:8444
. - On each camera, follow the instructions in "Adding a camera". In Step 3,
run.sh
should be updated to contain--server_url sec-cam-server.local
. - The web UI with camera feeds will be available at
https://sec-cam-server.local:3000
Example 2: 2 cameras with hostnames camera1.local
and camera2.local
, with the "server" running camera1.local
- On
camera1.local
, follow the steps to install the server. - On
camera1.local
, follow the steps to install the in "Adding a camera". In Step 3,run.sh
should be updated to contain--server_url localhost
. - On
camera2.local
, follow the steps to install the in "Adding a camera". In Step 3,run.sh
should be updated to contain--server_url camera1.local
. - The web UI with camera feeds will be available at
https://camera1.local:3000
- Install Docker following the instructions on their website.
- Clone this repository
- Generate SSL certificates:
./create-certs.sh
. Alternatively, you may place your own certs in thecerts
dir - Build and run the docker containers:
API_URL=<server-hostname:server-port> docker-compose up -d --build
. For example, if the API was running on the hostsec-cam-server
and port 8444, you should useAPI_URL=sec-cam-server:8444
- You should now be able to view the UI at
https://<server-hostname>:3000
. (NOTE: The web UI will be blank until you add a camera).
NOTE: These instructions assume you are deploying to a Debian-based OS.
- Install the
python3-opencv
package and dependencies:sudo apt-get install python3-opencv libatlas-base-dev
- Clone this repository
- Install the package:
cd backend && python3 -m pip install .[streamer]
. If you are using the Raspberry Pi camera module, runcd backend && python3 -m pip install .[streamer,picam]
. - Update
--server_url
inrun.sh
to point at the host you deployed the server to. - In the Web UI, you should see live video from that camera.