{"id":15197077,"url":"https://github.com/reynoldsbd/lunacam","last_synced_at":"2025-10-02T13:30:56.075Z","repository":{"id":37186086,"uuid":"167638528","full_name":"reynoldsbd/lunacam","owner":"reynoldsbd","description":"Camera streaming system for Raspberry Pi","archived":true,"fork":false,"pushed_at":"2022-07-16T16:43:56.000Z","size":8231,"stargazers_count":13,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-29T00:41:10.407Z","etag":null,"topics":["raspberry-pi","raspberry-pi-camera","raspberry-pi-iot","raspberry-pi-zero-w","rust","streaming","video"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reynoldsbd.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-26T01:56:33.000Z","updated_at":"2023-03-08T15:16:41.000Z","dependencies_parsed_at":"2022-08-31T23:20:26.865Z","dependency_job_id":null,"html_url":"https://github.com/reynoldsbd/lunacam","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reynoldsbd%2Flunacam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reynoldsbd%2Flunacam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reynoldsbd%2Flunacam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reynoldsbd%2Flunacam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reynoldsbd","download_url":"https://codeload.github.com/reynoldsbd/lunacam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235000578,"owners_count":18920205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["raspberry-pi","raspberry-pi-camera","raspberry-pi-iot","raspberry-pi-zero-w","rust","streaming","video"],"created_at":"2024-09-28T00:41:18.937Z","updated_at":"2025-10-02T13:30:50.725Z","avatar_url":"https://github.com/reynoldsbd.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LunaCam\n\nLunaCam is a secure and self-hosted video streaming system designed primarily\nfor the Raspberry Pi. With it, you can stream video from one or more cameras\nover the Internet using only a web browser.\n\n*Why \"LunaCam\"?*\n\nI started this project as a way to monitor my dog, Luna, while I'm away from\nhome. My hope is that this project will be used for other purposes, but as of\nyet I haven't found a generic (and unused) name that's quite as catchy!\n\n\n# Overview\n\nA minimal LunaCam setup consists of a single Raspberry Pi with an attached\ncamera module, running a specialized version of Raspbian. The Pi exposes a web\nportal as the primary means of viewing/controlling video streams and\nadministering the overall system.\n\nAdditional video streams can be added to the system by provisioning additional\nPis with a special \"camera-only\" version of LunaCam's OS. These Pis can then be\nadded to the system using the first Pi's web portal. All cameras in the system\ncan be viewed from the web portal.\n\nVideo streams exposed by LunaCam are encrypted. Users must enter a username and\npassword before they are allowed to view any stream. The web portal provides a\nbasic means for administering user accounts.\n\nA LunaCam system is intended to live behind some kind of firewall, such as a\nhome router. As with much other web-based, self-hosted software, accessing\nLunaCam over the Internet requires port forwarding or a reverse-proxy.\n\n\n# Supported Hardware\n\nLunaCam should work on any model of the Raspberry Pi. It is optimized for the\nRaspberry Pi Zero W in particular. The only (currently) supported camera is the\nofficial camera module.\n\nMy personal recommendation is Adafruit's Pi Zero W Camera Pack:\n\nhttps://www.adafruit.com/product/3414\n\n\n# Getting Started\n\nStart by downloading [the latest release](https://github.com/reynoldsbd/lunacam/releases)\nof LunaCam's Raspbian-based OS. There are several variations of this OS image to\nchoose from:\n\n* *lunacam-X.Y.Z.zip* - Contains a full LunaCam stack, including web UI and\n  support for streaming from an attached camera module. **Choose this image if\n  you're just starting out.**\n* *lunacam-camera-X.Y.Z.zip* - No web UI, only support for streaming. Use this\n  image when adding an additional camera to an existing LunaCam system.\n* *lunacam-portal-X.Y.Z.zip* - Web UI only. Does not support streaming from a\n  camera module. This image is useful for offloading the web UI workload to a\n  device that does not have an attached camera.\n\nUnzip the image, flash it to an SD card, and use it to boot your favorite\nRaspberry Pi. Congratulations, LunaCam is now installed and running! However,\nsome additional configuration is needed before you have a usable setup.\n\nLog in to the device using \"admin\" for both the username and password. If you're\nusing a Zero W (or any other model supporting USB OTG), note that an ethernet\ngadget is configured out of the box with an IP address of 192.168.7.3.\n\nOnce connected, run `sudo raspi-config` and configure the following:\n\n1. Change the *admin* user's default password\n2. Connect to a wireless network\n3. Set a new hostname (default is *lunacam*)\n4. Resize the root partition to fit your SD card (optional, LunaCam will run\n  perfectly fine without doing so)\n\nShut down, position the camera as desired, and connect a power source. You\nshould now be able to access the web UI by pointing a browser at the Pi's IP\naddress.\n\nSign in using *lunacam* as the default username and password, then navigate to\nthe */admin/users* page and **change these default credentials**. From this\npage, you may also configure additional usernames and passwords.\n\nNext, navigate to */admin/cameras* and set the name of initial camera feed. This\npage allows you to configure/start/stop camera streams and set up connections to\nadditional *camera-only* LunaCam devices.\n\nFinally, navigate to the site root (*/*) to view all streams.\n\n## Tips and Tricks\n\nTo get the most out of LunaCam, you'll probably want to reconfigure your home\nrouter as follows:\n\n1. Assign a static IP address to each LunaCam device, allowing you to access\n  them remotely using predictable addresses.\n2. Set up port-forwarding for port 80, allowing you to access the web UI and\n  camera streams remotely. Note that you should only perform this configuration\n  **once**, for the initial LunaCam device (the one that hosts the portal). All\n  other cameras can be viewed and controlled via the same portal.\n\nThe process for configuring the above varies wildly by router, so I won't try to\ncapture the details here.\n\nAdvanced users may also wish to configure TLS encryption for the LunaCam web\nportal. Certbot makes this super easy:\n\nhttps://certbot.eff.org/lets-encrypt/debianbuster-nginx\n\n\n# Local Development\n\nDuring active development, LunaCam can be compiled and run on nearly any\nworkstation. This makes it very easy to build and test changes locally, without\nthe hassle of cross-compilation or deploying bits to hardware.\n\nDevelopment generally requires the following tools, which should be easy to\nacquire for any operating system. On Windows, the use of Ubuntu via\n[WSL](https://docs.microsoft.com/en-us/windows/wsl/about) is recommended.\n\n* [Rust](https://rustup.rs/)\n* Clang version 3.9 or higher\n  * *clang* package on Ubuntu\n* [PowerShell 6](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-6)\n* [Yarn](https://yarnpkg.com/lang/en/docs/install/)\n* [Sass](https://sass-lang.com/install)\n* [diesel_cli](https://github.com/diesel-rs/diesel/tree/master/diesel_cli) (if modifying the database schema)\n  * Recommend installing with `--no-default-features` and `--features \"sqlite-bundled\"`\n\nOnce dependencies are installed, simply use Cargo to build and run:\n\n```shell\ncargo run\n```\n\nIf developing code applicable to the camera-only variant, you'll need to toggle\nsome feature flags:\n\n```shell\ncargo run --no-default-features --features \"stream-api\"\n```\n\n## Building an SD Card Image\n\nFor more thorough testing, you can build complete SD card images locally using\n*/tools/scripts/build-image.ps1*. This process is only known to work on Linux\n(including WSL) and requires installing some additional dependencies:\n\n* Basic build tools and 32-bit libc headers\n  * On Ubuntu, install *build-essential* and *libc6-dev-i386*\n* Docker\n  * If on a true Linux host, make sure to add your user account to the *docker*\n    group\n  * If using WSL, follow [these instructions](https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly)\n\n\n# License\n\nLicensed under either of:\n\n* Apache License, Version 2.0\n  ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n* MIT license\n  ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freynoldsbd%2Flunacam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freynoldsbd%2Flunacam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freynoldsbd%2Flunacam/lists"}