A API service for managing files and directories, designed for Unraid servers but works on any Linux
10K+
A powerful RESTful API service for managing files and directories, designed for Unraid servers but works on any Linux system. Built with FastAPI and optimized for Docker deployment.
docker run -d \
--name file-manager-api \
-p 8000:8000 \
-v /mnt/user:/mnt/user \
-e BASE_PATH=/mnt/user \
-e API_KEY=your_secret_key \
jandrop/file-manager-api:latest
Access the API documentation at: http://localhost:8000/docs
Create a docker-compose.yml file:
version: '3.8'
services:
file-manager-api:
image: jandrop/file-manager-api:latest
container_name: file-manager-api
ports:
- "8000:8000"
environment:
- BASE_PATH=/mnt/user
- API_KEY=your_secret_key_here
- MAX_UPLOAD_SIZE=10737418240 # 10GB
- ENABLE_FILE_DELETION=true
- ENABLE_RECURSIVE_DELETE=true
volumes:
- /mnt/user:/mnt/user
restart: unless-stopped
Then run:
docker-compose up -d
| Variable | Description | Default |
|---|---|---|
BASE_PATH | Base path for file operations | /mnt/user |
API_KEY | API key for authentication (optional) | - |
MAX_UPLOAD_SIZE | Maximum file upload size in bytes | 10737418240 (10GB) |
ENABLE_FILE_DELETION | Enable file deletion operations | true |
ENABLE_RECURSIVE_DELETE | Enable recursive directory deletion | true |
SHOW_HIDDEN_FILES | Show hidden files by default | false |
DEBUG | Enable debug mode | false |
CORS_ORIGINS | Allowed CORS origins (JSON array) | ["http://localhost"] |
GET /api/v1/files/browse - List directory contentsGET /api/v1/files/info - Get file/directory informationGET /api/v1/files/download - Download a filePOST /api/v1/files/upload - Upload filesDELETE /api/v1/files/file - Delete a filePUT /api/v1/files/rename - Rename a file/directoryPOST /api/v1/files/move - Move a file/directoryPOST /api/v1/files/copy - Copy a file/directoryPOST /api/v1/files/directory - Create a directoryDELETE /api/v1/files/directory - Delete a directoryGET /api/v1/files/search - Search for filesGET /api/v1/files/disk-usage - Get disk usage informationGET /health - Health check endpointcurl "http://localhost:8000/api/v1/files/browse?path=/mnt/user/documents"
curl -X POST \
-H "X-API-Key: your_secret_key" \
-F "file=@/path/to/file.pdf" \
-F "destination_path=/mnt/user/uploads" \
http://localhost:8000/api/v1/files/upload
curl -H "X-API-Key: your_secret_key" \
-O "http://localhost:8000/api/v1/files/download?path=/mnt/user/file.txt"
curl "http://localhost:8000/api/v1/files/search?path=/mnt/user&query=*.pdf"
To enable API key authentication, set the API_KEY environment variable:
docker run -d \
-e API_KEY=your_secret_key \
jandrop/file-manager-api:latest
Then include the key in your requests:
curl -H "X-API-Key: your_secret_key" \
http://localhost:8000/api/v1/files/browse?path=/mnt/user
Mount your file system directories that you want to manage:
# For Unraid
-v /mnt/user:/mnt/user
# For specific directories
-v /path/to/files:/mnt/user
# Multiple volumes
-v /data:/data
-v /media:/media
The API includes a health check endpoint at /health:
curl http://localhost:8000/health
Response:
{
"status": "healthy",
"base_path": "/mnt/user",
"base_path_exists": true
}
This image supports multiple architectures:
linux/amd64 (x86_64)linux/arm64 (ARM 64-bit, Apple Silicon, Raspberry Pi)Docker will automatically pull the correct architecture for your platform.
Looking for a web interface? Use it together with the File Manager UI:
services:
file-manager-api:
image: jandrop/file-manager-api:latest
# ... configuration
file-manager-ui:
image: jandrop/file-manager-ui:latest
ports:
- "8764:8764"
depends_on:
- file-manager-api
If you encounter permission issues:
# Check container logs
docker logs file-manager-api
# Verify mounted paths exist
docker exec file-manager-api ls -la /mnt/user
BASE_PATH is set correctly# Check if the API is responding
docker exec file-manager-api curl http://localhost:8000/health
# View detailed logs
docker logs file-manager-api
http://localhost:8000/docs (Swagger UI)http://localhost:8000/redoc (ReDoc)latest - Latest stable release1.x.x - Specific version tagsmain - Latest development buildBuilt with FastAPI • Powered by Docker • Optimized for Unraid
Content type
Image
Digest
sha256:41ee81d78…
Size
293.9 MB
Last updated
3 months ago
docker pull jandrop/file-manager-api