A lightweight web-based file manager for Raspberry Pi Zero 2 W.
- Browse directories
- Upload MP3 and image files
- Move/rename files and folders
- Create folders
- Delete files and folders
- Mobile-friendly web interface
- Single binary deployment
- Rust 1.70+ (for building)
- Raspberry Pi Zero 2 W (or compatible ARM device)
cargo build --releaseThe binary will be at target/release/monkeyarch.
# Install cross
cargo install cross
# Build for ARM
cross build --release --target armv7-unknown-linux-gnueabihfConfiguration can be set via environment variables or a config.toml file.
| Variable | Default | Description |
|---|---|---|
MONKEYARCH_ROOT_DIRECTORY |
/home/pi/media |
Root directory for file operations |
MONKEYARCH_BIND_ADDRESS |
0.0.0.0 |
Listen address |
MONKEYARCH_PORT |
8000 |
Listen port |
MONKEYARCH_MAX_UPLOAD_SIZE |
104857600 |
Max upload size in bytes (100 MB) |
MONKEYARCH_ENABLE_DELETE |
true |
Enable delete operations |
RUST_LOG |
info |
Log level |
Copy config.example.toml to config.toml:
root_directory = "/home/pi/media"
bind_address = "0.0.0.0"
port = 8000
max_upload_size = 104857600
enable_delete = true# Using environment variables
MONKEYARCH_ROOT_DIRECTORY=/path/to/files ./monkeyarch
# Using config file
./monkeyarchAccess the web interface at http://<raspberry-pi-ip>:8000
-
Copy the binary to
/usr/local/bin/:sudo cp monkeyarch /usr/local/bin/ sudo chmod +x /usr/local/bin/monkeyarch
-
Create the media directory:
mkdir -p /home/pi/media
-
Install the systemd service:
sudo cp monkeyarch.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable monkeyarch sudo systemctl start monkeyarch -
Check status:
sudo systemctl status monkeyarch
GET /api/list?path=<relative-path>
Response:
{
"path": "music",
"entries": [
{
"name": "song.mp3",
"type": "file",
"size": 3456789,
"modified": "2025-09-18T12:34:56Z"
},
{
"name": "albums",
"type": "directory"
}
]
}POST /api/upload?path=<relative-path>&overwrite=false
Content-Type: multipart/form-data
Accepted file types: audio/mpeg, image/*
POST /api/move
Content-Type: application/json
{
"from": "music/old.mp3",
"to": "music/new.mp3",
"overwrite": false
}
POST /api/mkdir
Content-Type: application/json
{
"path": "music/new_album"
}
POST /api/delete
Content-Type: application/json
{
"path": "music/old.mp3",
"recursive": false
}
- All file operations are restricted to the configured root directory
- Path traversal attempts are blocked
- Only MP3 and image files can be uploaded
- File size limits are enforced during streaming upload
- Symlinks escaping the root directory are rejected
MIT