Deploying FileGator
Introduction
FileGator is a free, open-source, lightweight PHP file manager that provides a powerful yet simple solution for managing files through a clean web interface. Built with modern web technologies, FileGator offers a fast, responsive experience for uploading, downloading, organizing, and sharing files without the complexity of heavier file management systems.
FileGator excels at providing essential file management capabilities:
- Lightweight & Fast: Built on PHP with minimal dependencies for quick loading and efficient performance
- Modern Interface: Clean, intuitive UI with drag-and-drop functionality
- Multi-User Support: Create multiple users with customizable permissions and roles
- File Operations: Upload, download, rename, move, copy, and delete files with ease
- Archive Support: Create and extract ZIP archives directly in the browser
- Search Functionality: Quickly find files and folders with built-in search
- File Sharing: Generate shareable links for files and folders
- Markdown Viewer: Built-in viewer for markdown files
- Image Preview: Thumbnail generation and image gallery view
- Code Editor: Edit text and code files directly in the browser
- Responsive Design: Works seamlessly across desktop, tablet, and mobile devices
- Self-Hosted: Complete control over your files and data privacy
Whether you need a simple file manager for personal use, a team collaboration tool, or a lightweight alternative to heavyweight file management systems, FileGator provides the perfect balance of features and simplicity.
This comprehensive guide walks you through deploying FileGator on Klutch.sh using Docker, including detailed installation steps, persistent storage configuration, user management, and production-ready best practices.
What You’ll Learn
- How to deploy FileGator with a Dockerfile on Klutch.sh
- Setting up persistent storage for files and configuration
- Configuring user authentication and permissions
- Implementing environment variables for customization
- Best practices for security, performance, and file management
Prerequisites
Before you begin, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your FileGator project
- Basic familiarity with Docker and file management concepts
- (Optional) Docker installed locally for testing
Understanding FileGator Architecture
FileGator consists of several key components:
- PHP Backend: Lightweight PHP application handling file operations
- Web Interface: Modern JavaScript-based UI for file management
- Storage Layer: File system storage for user files and application data
- User Management: Built-in authentication and role-based permissions
- Configuration: JSON-based configuration for customization
The application runs on port 80 by default (Apache/PHP), making it straightforward to deploy on Klutch.sh with automatic HTTPS.
Step 1: Prepare Your GitHub Repository
-
Create a new GitHub repository for your FileGator deployment.
-
Create a
Dockerfilein the root of your repository with the following content: - (Optional) Create an advanced Dockerfile with custom configuration:
- (Optional) Create a
.dockerignorefile: - Create a
README.mdfile with setup information: - Commit and push your changes to GitHub:
FROM filegator/filegator:latest
# Expose the default HTTP portEXPOSE 80
# The application stores files in /var/www/filegator/repository# and configuration in /var/www/filegator/privateVOLUME ["/var/www/filegator/repository", "/var/www/filegator/private"]
# Apache is configured to run FileGator# No additional CMD needed - uses base image entrypointNote: This Dockerfile uses the official FileGator image which includes PHP, Apache, and all dependencies pre-configured.
FROM filegator/filegator:latest
# Install additional PHP extensions if neededRUN apt-get update && apt-get install -y \ php-imagick \ php-redis \ && rm -rf /var/lib/apt/lists/*
# Create necessary directoriesRUN mkdir -p /var/www/filegator/repository /var/www/filegator/private
# Set proper permissionsRUN chown -R www-data:www-data /var/www/filegator/repository /var/www/filegator/private
# Expose HTTP portEXPOSE 80
# Health checkHEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \ CMD curl -f http://localhost/ || exit 1
# Use default entrypoint from base image.git.github*.mdREADME.md.env.env.localdocker-compose.ymlnode_modules# FileGator Deployment on Klutch.sh
This repository contains the Docker configuration for deploying FileGator on Klutch.sh.
## About FileGator
FileGator is a lightweight, free, and open-source PHP file manager.
## Features
- Multi-user support with role-based permissions- Drag-and-drop file uploads- ZIP archive creation and extraction- Built-in code editor and markdown viewer- File sharing with generated links- Search functionality- Responsive mobile-friendly interface
## Initial Setup
1. Deploy on Klutch.sh2. Attach persistent volumes for files and configuration3. Access the web interface4. Complete initial setup and create admin user5. Configure users and permissions
## Default Credentials
On first deployment, FileGator creates a default admin user:- Username: `admin`- Password: `admin123`
**Important**: Change this password immediately after first login!
## Documentation
- FileGator: https://docs.filegator.io- Klutch.sh: https://docs.klutch.shgit add Dockerfile .dockerignore README.mdgit commit -m "Add FileGator Dockerfile for Klutch.sh deployment"git push origin mainStep 2: Create Your App on Klutch.sh
-
Log in to Klutch.sh and navigate to the dashboard.
-
Create a new project (if you don’t have one already) by clicking “New Project” and providing a project name like “File Management”.
-
Create a new app within your project by clicking “New App”.
-
Connect your GitHub repository by selecting it from the list of available repositories.
-
Configure the build settings:
- Klutch.sh will automatically detect the Dockerfile in your repository root
- The build will use this Dockerfile automatically
-
Set the internal port to
80(FileGator’s default HTTP port). This is the port that traffic will be routed to within the container. -
Select HTTP traffic for the app’s traffic type.
Step 3: Configure Persistent Storage
FileGator requires persistent storage to retain user files and configuration across deployments.
-
In your app settings, navigate to the “Volumes” section.
-
Add the first persistent volume for file storage:
- Mount Path:
/var/www/filegator/repository - Size: Choose based on your file storage needs (start with 10 GB, scale as needed)
- Mount Path:
-
Add a second persistent volume for configuration and private data:
- Mount Path:
/var/www/filegator/private - Size: 1 GB is typically sufficient for configuration and user data
- Mount Path:
-
Save the volume configuration. This ensures all your files, user data, and settings persist even when the container is restarted or redeployed.
The persistent volumes store:
/var/www/filegator/repository: All user-uploaded files and folders/var/www/filegator/private: Configuration files, user database, sessions, and logs
For more details on managing persistent storage, see the Volumes Guide.
Step 4: Configure Environment Variables
FileGator can be customized using environment variables. Configure these in the Klutch.sh dashboard:
-
In your app settings, navigate to the “Environment Variables” section.
-
Add basic configuration variables:
- Optional security and feature variables:
- Mark sensitive values as secrets in the Klutch.sh UI to prevent them from appearing in logs.
# Application settingsAPP_ENV=productionAPP_DEBUG=false
# Public URL (set to your actual app URL)APP_URL=https://example-app.klutch.sh
# Timezone configurationTZ=America/New_York
# PHP ConfigurationPHP_MEMORY_LIMIT=256MPHP_UPLOAD_MAX_FILESIZE=100MPHP_POST_MAX_SIZE=100MPHP_MAX_EXECUTION_TIME=300# Session configurationSESSION_LIFETIME=120
# File upload restrictionsALLOWED_FILE_EXTENSIONS=jpg,jpeg,png,gif,pdf,doc,docx,xls,xlsx,zip,txt
# Maximum file size (in bytes)MAX_FILE_SIZE=104857600
# Enable/disable guest accessGUEST_ACCESS=false
# Enable/disable user registrationUSER_REGISTRATION=falseImportant Security Notes:
- Never commit secrets or passwords to your repository
- Always use Klutch.sh environment variables for configuration
- Change default admin credentials immediately after first login
- Disable guest access unless specifically needed
Step 5: Deploy Your Application
-
Review your configuration to ensure all settings are correct:
- Dockerfile is detected
- Internal port is set to
80 - Persistent volumes are mounted to
/var/www/filegator/repositoryand/var/www/filegator/private - Environment variables are configured
- Traffic type is set to HTTP
-
Click “Deploy” to start the build and deployment process.
-
Monitor the build logs to ensure the deployment completes successfully. The build typically takes 2-4 minutes.
-
Wait for the deployment to complete. Once done, you’ll see your app URL (e.g.,
https://example-app.klutch.sh).
Step 6: Initial Setup and Configuration
-
Access your FileGator instance by navigating to your app URL (e.g.,
https://example-app.klutch.sh). -
Log in with default credentials:
- Username:
admin - Password:
admin123
- Username:
-
Change the admin password immediately:
- Click on the user icon in the top right
- Select “Change Password”
- Enter a strong, unique password
- Save the changes
-
Configure application settings:
- Navigate to the settings menu (gear icon)
- Review and update general settings
- Configure upload limits
- Set allowed file types
- Enable or disable features
-
Create additional users:
- Go to the Users section
- Click “Add User”
- Set username, password, and permissions
- Assign appropriate home directory
-
Test file operations:
- Upload a test file
- Create folders
- Test download and preview features
- Verify permissions work correctly
Getting Started: Sample Usage
Here are common tasks you can perform with FileGator:
Basic File Operations
Upload Files:
- Drag and drop files directly into the browser
- Click the upload button to select files
- Upload progress shows in real-time
- Supports multiple file uploads
Create Folders:
1. Click the "New Folder" button2. Enter folder name3. Press Enter or click CreateDownload Files:
- Right-click on a file and select “Download”
- Or select multiple files and use the download button
- Files are downloaded directly to your browser
Working with Archives
Create ZIP Archive:
1. Select files and folders2. Right-click and choose "Compress"3. Enter archive name4. Click Create5. ZIP file is created in current directoryExtract ZIP Archive:
1. Right-click on a ZIP file2. Select "Extract"3. Choose extraction location4. Files are extracted to specified folderFile Sharing
Generate Share Link:
1. Right-click on a file or folder2. Select "Get Link"3. Configure link settings: - Expiration date - Password protection - Download limit4. Copy the generated link5. Share with othersSearch and Navigation
Quick Search:
- Use the search bar at the top
- Search by filename
- Results update in real-time
- Click result to navigate to file
Editing Files
Text File Editing:
1. Double-click a text file2. Built-in editor opens3. Make changes4. Click Save5. File is updated on serverSupported file types for editing:
- Text files (.txt)
- Markdown files (.md)
- Code files (.js, .php, .html, .css, etc.)
- Configuration files (.json, .yml, .xml)
User Management
Creating Users
-
Access User Management:
- Log in as admin
- Navigate to Settings > Users
-
Add New User:
- Click “Add User” button
- Enter user details:
- Username (required)
- Password (required)
- Email (optional)
- Home directory path
-
Set Permissions:
- Choose user role (admin or user)
- Set file operation permissions:
- Read: View and download files
- Write: Upload and modify files
- Delete: Remove files and folders
- Create: Create new files and folders
-
Configure Restrictions:
- Set upload size limits
- Restrict file types
- Set disk quota
- Define allowed directories
Role-Based Permissions
FileGator supports flexible permission systems:
Admin Role:
- Full access to all files and folders
- User management capabilities
- System configuration access
- View all user activities
- Manage shared links
User Role:
- Access to assigned home directory
- File operations based on permissions
- Create and manage own shared links
- Limited to assigned storage quota
Guest Access:
- Read-only access to public folders
- No upload or modification rights
- Can download allowed file types
- Time-limited sessions
Advanced Configuration
Custom Branding
Customize FileGator’s appearance:
-
Update Logo:
- Replace logo files in the public assets directory
- Upload custom logo through settings
-
Custom CSS:
- Add custom CSS in the theme settings
- Override default styles
- Match your brand colors
-
Custom Title:
- Set in configuration file
- Update browser title
- Add custom footer text
File Type Restrictions
Configure allowed file types in environment variables:
# Allow only specific file typesALLOWED_FILE_EXTENSIONS=jpg,jpeg,png,gif,pdf,doc,docx,xls,xlsx,txt,zip
# Or block specific typesBLOCKED_FILE_EXTENSIONS=exe,bat,sh,php,jsUpload Size Limits
Configure maximum upload sizes:
# PHP settings for file uploadsPHP_UPLOAD_MAX_FILESIZE=500MPHP_POST_MAX_SIZE=500MPHP_MEMORY_LIMIT=512MPHP_MAX_EXECUTION_TIME=600Storage Quotas
Set per-user storage limits:
- Edit user profile in admin panel
- Set disk quota in MB or GB
- Users see remaining quota in interface
- Upload blocked when quota exceeded
Integration Examples
Embedding FileGator
Embed FileGator in your website using an iframe:
<!DOCTYPE html><html><head> <title>File Manager</title> <style> #filegator-frame { width: 100%; height: 800px; border: none; } </style></head><body> <h1>File Manager</h1> <iframe id="filegator-frame" src="https://example-app.klutch.sh" allow="clipboard-write"> </iframe></body></html>API Access
FileGator provides API endpoints for programmatic access:
# List files in directorycurl -X GET "https://example-app.klutch.sh/api/files?path=/folder" \ -H "Authorization: Bearer YOUR_API_TOKEN"
# Upload filecurl -X POST "https://example-app.klutch.sh/api/upload" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -F "file=@/path/to/file.pdf" \ -F "path=/destination/folder"
# Download filecurl -X GET "https://example-app.klutch.sh/api/download?path=/file.pdf" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -o downloaded-file.pdfJavaScript Integration
// FileGator API client exampleclass FileGatorClient { constructor(baseUrl, apiToken) { this.baseUrl = baseUrl; this.apiToken = apiToken; }
async listFiles(path = '/') { const response = await fetch(`${this.baseUrl}/api/files?path=${path}`, { headers: { 'Authorization': `Bearer ${this.apiToken}` } }); return response.json(); }
async uploadFile(file, destinationPath) { const formData = new FormData(); formData.append('file', file); formData.append('path', destinationPath);
const response = await fetch(`${this.baseUrl}/api/upload`, { method: 'POST', headers: { 'Authorization': `Bearer ${this.apiToken}` }, body: formData }); return response.json(); }
async deleteFile(path) { const response = await fetch(`${this.baseUrl}/api/delete`, { method: 'DELETE', headers: { 'Authorization': `Bearer ${this.apiToken}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ path }) }); return response.json(); }}
// Usageconst client = new FileGatorClient('https://example-app.klutch.sh', 'your-api-token');
// List filesclient.listFiles('/documents') .then(files => console.log('Files:', files)) .catch(error => console.error('Error:', error));
// Upload fileconst fileInput = document.querySelector('#file-input');fileInput.addEventListener('change', async (e) => { const file = e.target.files[0]; const result = await client.uploadFile(file, '/uploads'); console.log('Upload result:', result);});Production Best Practices
Security
- Change Default Credentials: Immediately change the default admin password
- Strong Passwords: Enforce strong password policies for all users
- HTTPS Only: Always use HTTPS (automatic on Klutch.sh)
- Regular Updates: Keep FileGator updated to the latest version
- File Type Restrictions: Limit allowed file types to reduce security risks
- Disable Unnecessary Features: Disable guest access if not needed
- Session Security: Configure appropriate session timeouts
- Backup Regularly: Implement automated backup procedures
Performance
-
Resource Allocation: Allocate sufficient CPU and memory based on user count
- Small deployments (< 10 users): 512MB RAM, 1 CPU
- Medium deployments (10-50 users): 1GB RAM, 2 CPUs
- Large deployments (50+ users): 2GB+ RAM, 4+ CPUs
-
PHP Optimization: Configure PHP settings for performance
Terminal window PHP_MEMORY_LIMIT=512MPHP_OPCACHE_ENABLE=1PHP_REALPATH_CACHE_SIZE=4096K -
Storage Performance: Use SSD-backed volumes for better I/O performance
-
Caching: Enable opcode caching for faster PHP execution
Data Management
-
Regular Backups: Create daily backups of both volumes
/var/www/filegator/repository(files)/var/www/filegator/private(configuration)
-
Backup Strategy:
- Daily automated backups
- Weekly full backups
- Monthly long-term retention
- Off-site backup storage
-
Storage Monitoring: Monitor disk usage and set alerts
- Check volume capacity regularly
- Plan for growth
- Implement data retention policies
-
File Cleanup: Implement policies for old file removal
- Archive old files
- Delete temporary files
- Clean up user trash folders
Monitoring
Monitor these key metrics:
- Application Health: Response times, error rates
- Resource Usage: CPU, memory, disk I/O
- Storage Capacity: Available disk space
- User Activity: Active users, upload/download volumes
- Error Logs: Monitor for application errors
Troubleshooting
Application Won’t Start
Issue: Container starts but application doesn’t respond
Solutions:
- Verify internal port is set to 80
- Check application logs in Klutch.sh dashboard
- Ensure persistent volumes are properly mounted
- Verify sufficient disk space in volumes
- Check for PHP errors in logs
Cannot Upload Files
Issue: File uploads fail or timeout
Solutions:
- Check
PHP_UPLOAD_MAX_FILESIZEsetting - Verify
PHP_POST_MAX_SIZEis larger than upload size - Ensure volume has sufficient free space
- Check user has write permissions
- Review upload directory permissions
- Verify
PHP_MAX_EXECUTION_TIMEfor large files
Permission Denied Errors
Issue: Cannot read, write, or delete files
Solutions:
- Verify user has appropriate permissions
- Check file system permissions in volumes
- Ensure
www-datauser owns files - Review user role assignments
- Check directory permissions
Slow Performance
Issue: Application is slow or unresponsive
Solutions:
- Increase instance CPU and memory
- Optimize PHP settings (increase memory limit)
- Check volume I/O performance
- Review number of concurrent users
- Enable PHP opcode caching
- Reduce file thumbnailing for large folders
Login Issues
Issue: Cannot log in or session expires quickly
Solutions:
- Verify credentials are correct
- Check session configuration in environment variables
- Clear browser cookies and cache
- Verify
SESSION_LIFETIMEsetting - Check for timezone issues
- Review authentication logs
File Preview Not Working
Issue: Cannot preview images or documents
Solutions:
- Verify required PHP extensions are installed
- Check file type is supported
- Ensure sufficient memory for preview generation
- Review browser console for errors
- Check file permissions
- Verify file is not corrupted
Upgrading FileGator
To upgrade FileGator to a new version:
Method 1: Update Dockerfile
-
Update the version tag in your Dockerfile:
FROM filegator/filegator:v7.8.0 -
Commit and push the changes to your repository:
Terminal window git add Dockerfilegit commit -m "Upgrade FileGator to version 7.8.0"git push origin main -
Redeploy the application through Klutch.sh dashboard.
-
Verify the upgrade was successful:
- Check version in footer
- Test file operations
- Verify user access
Method 2: Use Latest Tag
To always use the latest stable version:
FROM filegator/filegator:latestThis automatically pulls the latest release on each rebuild.
Pre-Upgrade Checklist
- ✅ Backup both persistent volumes
- ✅ Review FileGator changelog for breaking changes
- ✅ Test upgrade in a development environment
- ✅ Notify users of scheduled maintenance
- ✅ Document current configuration
- ✅ Monitor logs after upgrade
Migration Strategies
Migrating from Other File Managers
To migrate from another file management system:
-
Export User Data:
- Export user lists and credentials
- Document permission structures
- Export file organization
-
Transfer Files:
- Use FTP, SFTP, or rsync to transfer files
- Maintain directory structure
- Preserve file timestamps
-
Configure FileGator:
- Create users in FileGator
- Set up permissions
- Configure home directories
-
Validate Migration:
- Verify all files transferred
- Test user access
- Confirm permissions work correctly
-
Switch Over:
- Update DNS or URLs
- Notify users of new system
- Provide training if needed
Migrating from Existing FileGator Instance
To migrate an existing FileGator deployment:
-
Backup Current Instance:
Terminal window tar -czf filegator-backup.tar.gz /path/to/repository /path/to/private -
Deploy New Instance on Klutch.sh following this guide.
-
Transfer Data:
- Extract backup to new persistent volumes
- Verify file permissions
- Test database connections
-
Update Configuration:
- Update
APP_URLenvironment variable - Adjust any path-specific settings
- Verify email settings if used
- Update
-
Test Thoroughly:
- Test user logins
- Verify file access
- Check all features work
-
Switch DNS: Point domain to new Klutch.sh instance.
Cost Optimization
Resource Efficiency
- Start with minimal resources and scale based on actual usage
- Monitor resource utilization regularly
- Right-size instances based on user count and file operations
- Use auto-scaling if available
Storage Optimization
- Implement file retention policies
- Compress old files when appropriate
- Delete duplicate files
- Archive infrequently accessed files
- Monitor and clean temporary files
Bandwidth Optimization
- Optimize image thumbnails size
- Enable compression for text files
- Implement caching headers
- Use CDN for frequently accessed files
Use Cases
Personal Cloud Storage
Deploy FileGator as a personal cloud:
- Store personal documents and photos
- Access files from anywhere
- Share files with family and friends
- Full control over your data
Team Collaboration
Use FileGator for team file sharing:
- Shared project folders
- Role-based access control
- File versioning through manual backups
- Secure file sharing with clients
Educational Institutions
Deploy for students and faculty:
- Student assignment submissions
- Course material distribution
- Faculty file sharing
- Secure document storage
Small Business
Implement as a business file server:
- Department-specific folders
- Client file sharing
- Document management
- Secure internal file storage
Resources
- FileGator Official Website
- FileGator GitHub Repository
- FileGator Documentation
- FileGator Docker Hub
- Klutch.sh Quick Start Guide
- Klutch.sh Volumes Guide
- Klutch.sh Builds Guide
- Klutch.sh Deployments Guide
Conclusion
You now have a fully functional FileGator file manager running on Klutch.sh with persistent storage, configured users and permissions, and production-ready settings. This setup allows you to:
- Manage files through a clean, modern web interface
- Support multiple users with customizable permissions
- Upload, download, and organize files efficiently
- Share files securely with generated links
- Edit text files directly in the browser
- Access your files from anywhere with internet access
FileGator on Klutch.sh provides a lightweight, self-hosted file management solution that’s perfect for personal use, team collaboration, or small to medium-sized organizations. With automatic HTTPS, persistent storage, and easy scalability, you have a robust platform for all your file management needs.
For questions or community support, refer to the FileGator GitHub Issues or the official documentation.