ESP32 File Server

Turn your ESP32 into a powerful file server with a modern web interface.
Features
File Management
- Upload, download, create, rename, delete, move, copy files & folders
- Folder upload (webkitdirectory)
- Drag & drop with progress bar
- File preview (images, text, audio, video)
- Search & sort (name, size, date)
- File info panel
- File versioning (auto-backup)
- ZIP download (select multiple files)
- Share links (public URLs)
System
- OTA firmware update — update from web UI, no USB needed
- WiFi auto-reconnect — reconnects automatically if connection drops
- Remote reboot — reboot device from web UI
- Health check — public endpoint for monitoring
- SD card monitoring — periodic health checks with history
- Settings page — change WiFi, AP, FTP, port settings from web UI
- Activity log — track all operations with timestamp and user
- Trash system — soft delete with restore and auto-cleanup
- Multi-user — admin/user roles with session management
- PWA support — install as app on phone
- 6 themes — dark, green, purple, warm, midnight + default
- FTP server — standard FTP access
- WiFi + AP mode — connect to network or create hotspot
- Responsive UI — works on desktop, tablet, phone
- Fully offline — no internet/cloud required
- WebSocket live updates — real-time file change notifications
- HMAC-SHA256 auth — hardware-accelerated password hashing
- CSRF protection — token-based form security
- Gzip downloads — compressed transfer for large text files
- Video streaming — range-request support for inline playback
- File locking — prevent concurrent write corruption
- Configurable port — web server port override (default 80)
Default Credentials
| Service |
Username |
Password |
| Web |
admin |
admin123 |
| FTP |
esp32 |
esp32 |
Keyboard Shortcuts
| Key |
Action |
| Delete |
Delete selected files |
| Ctrl+A |
Select all files |
| F2 |
Rename selected file |
| Escape |
Clear selection / close modals |
API Endpoints
| Method |
Endpoint |
Description |
|
| GET |
/health |
Health check (public) |
|
| GET |
/api/list?path=/ |
List files |
|
| GET |
/api/info?path=/file |
File info |
|
| |
GET |
/api/download?path=/file |
Download file (auto content-type) |
| GET |
/api/download-gzip?path=/file |
Download with gzip (text >10KB) |
|
| GET |
/api/video?path=/file |
Stream video (range-request support) |
|
| DELETE |
/api/delete?path=/file |
Move to trash |
|
| POST |
/api/create-dir?path=/dir |
Create directory |
|
| POST |
/api/rename?path=/old&name=new |
Rename |
|
| POST |
/api/move?path=/src&dest=/dst |
Move file |
|
| POST |
/api/copy?path=/src&dest=/dst |
Copy file |
|
| POST |
/api/upload |
Upload file |
|
| POST |
/api/share?path=/file |
Create share link |
|
| POST |
/api/zip |
Download files as ZIP |
|
| GET |
/api/changes?since=ts |
Check for changes |
|
| POST |
/api/ota-upload |
OTA firmware update |
|
| POST |
/api/reboot |
Remote reboot |
|
| GET |
/api/settings |
Get settings |
|
| POST |
/api/settings |
Save settings |
|
Hardware
- ESP32 development board
- Micro SD card (up to 32GB)
- SD card module
Wiring
| SD Card |
ESP32 |
| CS |
GPIO 5 |
| MOSI |
GPIO 23 |
| MISO |
GPIO 19 |
| SCK |
GPIO 18 |
| VCC |
3.3V |
| GND |
GND |
Installation
- Clone this repository
- Open
ESP32_File_Server.ino in Arduino IDE
- Install libraries:
WiFi, WebServer, SimpleFTPServer, ESPmDNS, SD, SPI, FS, ArduinoJson
- Update WiFi credentials in
config.h
- Upload to ESP32
- Access at
http://[IP_ADDRESS]
OTA Updates
- In Arduino IDE: Sketch → Export Compiled Binary
- Open web UI → OTA tab
- Select the
.bin file and upload
- Device reboots automatically
License
MIT License