May 29, 2025

Building a Dead Simple Raspberry Pi Camera Server

Quick and simple HTML rendered camera feed from a Raspberry Pi

I recently set up a Raspberry Pi camera server that's so minimal and straightforward, I thought it was worth sharing. This isn't one of those over-engineered solutions with fancy features - it's just a basic, reliable camera feed accessible from any browser on my local network.

The Goal

I wanted something that:

  1. Starts automatically when the Pi boots up
  2. Captures images at regular intervals
  3. Shows the latest image in a simple web page accessible from any device
  4. Doesn't require complex setup or dependencies
  5. Uses minimal resources on my old Raspberry Pi

The Hardware

Nothing fancy here:

  • Raspberry Pi 2B (yes, the ancient one from 2015!)
  • Raspberry Pi Camera Module (standard version)
  • Power supply
  • That's it!

The Result

image

The interface is minimal but does the job. It shows the latest image and auto-refreshes every couple of seconds.

How to Get Set Up

Getting this running on your own Pi is super simple:

  1. Make sure your camera module is connected and enabled
sudo raspi-config
# Navigate to Interface Options > Camera and enable it
  1. Install the only dependency, ImageMagick (for rotation)
sudo apt update
sudo apt install imagemagick
  1. Clone the repository, and navigate to the implementation's directory
git clone https://github.com/rewolf/RpiCameraViewer
cd simple
  1. Start the camera server
./start_camera_server.sh
  1. Access the feed from any device on your network
http://your-pi-ip-address:8080

That's it! No complex configuration, no fancy dependencies.

For more details consider reading the README

To make it start automatically on boot:

Add the following, with your specific installation path

crontab -e
# Add this line:
@reboot cd /path/to/RpiCameraViewer/simple && ./start_camera_server.sh

Configuration

There's not much configuration, but you can tweak few variables at the top of the capture.sh file to modify width, height, rotation, quality, etc:

QUALITY=90
WIDTH=720
HEIGHT=1280
ROTATION=90  # Set to 0 to disable rotation

How It Works

The solution is very basic:

  1. A bash script (capture.sh) captures photos every few seconds by running libcamera-still and sending a SIGUSR1 interrupt to signal it to capture a snapshot
  2. The snapshot is rotated as needed with ImageMagick and saved with timestamps
  3. A symbolic link is updated to point to the latest image
  4. A minimal Python HTTP server serves a basic webpage showing the current image (the symlink), rendered to an HTML canvas

Note it does expose that directory to the whole LAN on :8080.


Give it a try if you need something like that quickly.

I have a plan to make a better implementation planned at some point, but for now this will do.