A self-hosted LAN media server built for home and small-office networks. Run it on any machine, point your phone or laptop to http://share.local, and instantly browse, stream, and upload files — no cloud, no accounts, no configuration.
LocalShare runs a lightweight Flask server on your host machine and exposes itself on the local network using mDNS (Zeroconf), so every device on the same Wi-Fi can reach it by name rather than memorising an IP address. The host machine is automatically treated as admin; remote devices join as guests and can request elevated access via a password.
Browse the host filesystem (or any directory you point the server at) through a folder-based interface. Navigation is breadcrumb-tracked, and folders containing only images automatically offer a dedicated reader view.
Drag and drop files or entire folder trees directly into the directory you are currently browsing. Upload progress is shown in real time with transfer speed and estimated time remaining. Upload access is restricted to admin users.
Native browser formats (MP4, WebM, MP3, FLAC, AAC, and others) open in an inline player. MPEG-TS streams are handled via mpegts.js. All streams support byte-range requests for accurate seeking.
Multiple users on the same network can open a shared watch session for any streamable file. Playback is synchronised in real time via WebSocket — play, pause, and seek events are broadcast to all participants. Latency between clients is measured and displayed.
A lightweight real-time chat room available to everyone on the network. No accounts required.
Folders containing image files (manga, comics, scans) can be opened in a dedicated full-screen reader with vertical scroll and single-page horizontal modes, keyboard navigation, and per-folder mode persistence.
The host machine (localhost) is elevated to admin automatically with no password required. Remote devices can authenticate at /login using a master password. Admin sessions persist for 30 days via a signed cookie. Admins can upload, delete, and rename files inline. Guests can browse, stream, download, and chat.
The server registers itself as http://share.local on the local subnet using Zeroconf, so no one needs to look up or remember an IP address.
Image files display previews generated by Pillow. Video thumbnails are extracted via ffmpeg if available, with results cached to avoid redundant processing.
Python 3.10+
Flask
Flask-SocketIO
Flask-SQLAlchemy
APScheduler
Pillow
zeroconf
werkzeug
Install all dependencies:
pip install -r requirements.txtffmpeg is optional but required for video thumbnail generation.
Share the default uploads/ folder:
python app.pyShare a specific directory:
python app.py "C:\Users\you\Videos"
python app.py /home/you/mediaThe server starts on port 80 and is reachable at http://share.local from any device on the same network. The terminal will print a warning if the default admin password has not been changed.
Both values are read from environment variables at startup.
| Variable | Default | Description |
|---|---|---|
SECRET_KEY |
Auto-generated | Signs session cookies. Set a persistent value to survive restarts. |
ADMIN_PASSWORD |
admin123 |
Master password for remote admin login. Change this. |
Windows (PowerShell):
$env:ADMIN_PASSWORD = "yourpassword"
$env:SECRET_KEY = "a-long-random-string"
python app.pyLinux / macOS:
ADMIN_PASSWORD=yourpassword SECRET_KEY=a-long-random-string python app.py| Context | Role | Capabilities |
|---|---|---|
| Host machine (localhost) | Admin | Full access, no password required |
| LAN device, authenticated | Admin | Full access after /login |
| LAN device, unauthenticated | Guest | Browse, stream, download, chat |
Admin sessions last 30 days. Log out at any time via the header button.
When running in default mode (no directory argument), files older than 24 hours are removed automatically on an hourly schedule. Chat messages follow the same policy. When a custom directory is passed as an argument, no automatic deletion occurs — the server treats the directory as read/write storage only.
| Layer | Technology |
|---|---|
| Backend | Python, Flask, Flask-SocketIO |
| Database | SQLite via Flask-SQLAlchemy |
| Real-time | WebSocket (threading mode) |
| Network discovery | Zeroconf / mDNS |
| Frontend | Vanilla JS, Chart.js (watch latency) |
| Thumbnails | Pillow, ffmpeg |
LocalShare utilizes an event-driven synchronization engine to keep media playback perfectly aligned across all local network clients. the exact lifecycle of client actions, state transitions, rate-limiting rules, and WebSocket broadcasts can be seen in the sequence diagram below:
