A lightweight photo & video album viewer for your home network. Drop your folders of images/videos, start the server, and anyone on your WiFi can browse them from any device.
- Auto-discovers albums — scans your photos folder recursively; each leaf folder with images/videos becomes an album
- Thumbnails — auto-generated and cached for fast loading
- Video support — plays MP4, MKV, MOV, WebM and more right in the browser
- Full-screen lightbox — keyboard arrows, swipe on mobile, click outside to close
- LAN accessible — binds to
0.0.0.0so any device on your WiFi can view - Responsive — works on phones, tablets, and desktops
- Config file — change port and photos folder without touching code
cd D:\Workbench\LANHub
npm installCopy .env.example to .env and edit it:
PHOTOS_FOLDER=E:\YOUR_FOLDER| Setting | Description |
|---|---|
PHOTOS_FOLDER |
Absolute path to your root photos/videos folder |
npm startOpen http://localhost (or your LAN IP) in a browser.
PM2 keeps LANPics running in the background and auto-starts it when your PC boots.
npm install -g pm2
npm install -g pm2-windows-startupcd D:\Workbench\LANHub
pm2 start server.js --name lanpics
pm2 savepm2-startup install| Command | What it does |
|---|---|
pm2 list |
Show running processes |
pm2 logs lanpics |
View live logs |
pm2 restart lanpics |
Restart (after config changes) |
pm2 stop lanpics |
Stop the server |
pm2 start lanpics |
Start it again |
pm2 monit |
Real-time monitoring dashboard |
pm2 stop lanpics
pm2 delete lanpics
pm2 savepm2-startup uninstallnpm uninstall -g pm2
npm uninstall -g pm2-windows-startupRun this in a terminal to find the URL to share:
ipconfig | findstr "IPv4"Share the IP with people on your WiFi, e.g. http://192.168.29.65
Since port 80 is the default HTTP port, no :port is needed in the URL.
LANHub/
├── config.json # Port & folder settings
├── server.js # Express server
├── package.json
├── public/
│ └── index.html # Frontend (single-page app)
└── thumbcache/ # Auto-generated thumbnails (gitignored)
MIT