Automated Deployment
This directory contains automated deployment scripts that will get imgFlux up and running on a fresh Linux machine with minimal effort.
Available Scripts
Docker Deployment
deploy.sh- Deploy imgFlux using Docker Composeuninstall.sh- Remove Docker-based deployment
Systemd Deployment
deploy-systemd.sh- Deploy imgFlux as a native systemd serviceupgrade-systemd.sh- Upgrade imgFlux to the latest versionuninstall-systemd.sh- Remove systemd-based deployment
Deployment Options
Choose the deployment method that best fits your infrastructure:
Option 1: Docker Deployment (Recommended)
Uses Docker and Docker Compose for containerized deployment. Simplest and most portable.
Option 2: Systemd Deployment
Installs imgFlux as a native systemd service. Best for environments where Docker is not available or not desired.
Docker Deployment (Option 1)
Quick Start
Run the deployment script:
Or download and run locally:
What the Docker Script Does
The Docker deployment script will:
-
Check Prerequisites
- Verify Docker installation
- Install Docker automatically if not present
- Check for available ports
- Validate system requirements
-
Interactive Configuration
- Ask you to choose a caching strategy (Memory, Disk, Hybrid, or None)
- Ask if you want to enable Prometheus + Grafana monitoring
-
Automated Setup
- Pull the latest imgFlux Docker image from
ghcr.io/cloud-media-forge/imgFlux:latest - Generate secure random keys for HMAC signing
- Create configuration files with sane defaults
- Set up monitoring stack (if enabled)
- Download pre-built Grafana dashboard
- Start all services using Docker Compose
- Pull the latest imgFlux Docker image from
-
Health Checks
- Verify services are running correctly
- Check imgFlux responds to status endpoint
- Display access URLs and credentials
What's NOT Included (User Responsibility)
- HTTPS/TLS termination (use reverse proxy)
- Firewall configuration
- Rate limiting at proxy level
- Bearer token authentication
- Network isolation
- Backup automation
Configuration Options
Cache Types
The script offers four caching strategies:
| Type | Description | Default Capacity | Persistence |
|---|---|---|---|
| Memory | Fast in-memory cache | 1000 entries | No |
| Disk | File-based persistent cache | 2 GB | Yes |
| Hybrid | Memory + Disk combined | 1000 + 2 GB | Partial |
| None | No caching | - | - |
Monitoring
If enabled, the script deploys:
| Service | Port | Credentials | Purpose |
|---|---|---|---|
| imgFlux | 3000 | - | Image processing API |
| Metrics | 9000 | - | Prometheus metrics |
| Prometheus | 9090 | - | Metrics storage/queries |
| Grafana | 3001 | admin/admin | Visualization dashboards |
Default Configuration
The script creates a deployment with these defaults:
Deployment Location
All configuration files are stored in ~/.imgFlux/:
Error Handling
The script checks for common issues:
- Port conflicts - Validates all required ports are available
- Docker installation - Installs Docker if missing
- Docker daemon - Starts Docker if not running
- Image pull failures - Reports network/registry issues
- Service startup failures - Shows logs for debugging
Post-Deployment
After successful deployment:
-
Test the service:
-
View logs:
-
Access monitoring (if enabled):
- Prometheus: http://localhost:9090
- Grafana: http://localhost:3001 (admin/admin)
- The imgFlux dashboard is automatically provisioned and ready to use
- Look for "imgFlux Monitoring Dashboard" in the dashboard list
-
Manage the service:
Security Considerations
⚠️ Important Security Notes:
-
HMAC Keys: The script generates secure random keys stored in
~/.imgFlux/.env. Keep this file secure! -
Signed URLs: By default, imgFlux requires HMAC-signed URLs for security. Use the generated
IMGFLUX_KEYandIMGFLUX_SALTin the.envto make signatures. -
Grafana Password: If monitoring is enabled, change the default Grafana password (admin/admin) immediately after the first login.
-
Production Deployment: For production use, consider:
- Using HTTPS with a reverse proxy (nginx, Caddy, Traefik)
- Setting up firewall rules
- Implementing rate limiting at the proxy level
- Backing up the
.envfile securely - Using Docker secrets or environment variable management
Manual Configuration
To customize the deployment, edit the generated files:
Common Customizations
Change the port:
Add rate limiting:
Increase cache size:
Enable unsigned URLs (NOT RECOMMENDED for production):
Troubleshooting
Service won't start
Can't pull Docker image
Cache not working
Monitoring not showing data
Uninstalling
Automated Uninstall
Use the provided uninstall script for easy removal:
Or if you have the script locally:
The script will:
- Stop and remove all imgFlux containers
- Remove Docker volumes
- Remove configuration files
- Remove cache directories
- Optionally remove Docker images
Manual Uninstall
To manually remove imgFlux:
Docker Requirements
- Linux distribution (Ubuntu, Debian, CentOS, RHEL, etc.)
- 2 GB RAM minimum (4 GB recommended)
- 2 GB free disk space (for caching)
- Internet connection (for Docker image download)
curlorwget(for running the script)
Systemd Deployment (Option 2)
For environments where Docker is not available or you prefer native system services, use the systemd deployment method. This downloads pre-compiled imgFlux binaries and installs them as a systemd service.
Quick Start
Run the systemd deployment script:
Or download and run locally:
What the Systemd Script Does
The systemd deployment script will:
-
Check Prerequisites and Install Dependencies
- Detect your Linux distribution and package manager
- Install essential tools (curl, wget, ca-certificates)
- Install graphicsmagick (required for image processing)
- Verify all required ports are available
-
Download imgFlux Binary
- Fetch the latest release information from GitHub
- Detect system architecture (amd64 or arm64)
- Download the pre-compiled binary for your architecture
- Extract and install the binary to
/opt/imgFlux/
-
Interactive Configuration
- Ask you to choose a caching strategy (Memory, Disk, Hybrid, or None)
- Ask if you want to enable Prometheus + Grafana monitoring
-
System Setup
- Create systemd service files for imgFlux
- Generate secure random keys for HMAC signing
- Create configuration files with sane defaults
- Set up proper directory structure and permissions
- Install and configure Prometheus (if monitoring enabled)
- Install and configure Grafana (if monitoring enabled)
-
Service Management
- Enable services to start on boot
- Start all services
- Perform health checks
- Display access URLs and credentials
System Locations
The systemd deployment uses standard Linux filesystem locations:
Service Management
After deployment, manage imgFlux using standard systemd commands:
If monitoring is enabled:
Configuration Changes
To modify the configuration after deployment:
-
Edit the environment file:
-
Restart the service to apply changes:
Common Configuration Changes
Change the port:
Add rate limiting:
Increase cache size:
Enable unsigned URLs (NOT RECOMMENDED for production):
Updating imgFlux
Automated Upgrade (Recommended)
Use the provided upgrade script for safe, automated updates with automatic rollback on failure:
Or if you have the script locally:
The upgrade script will:
- Check for available updates
- Create a backup of the current binary
- Download and install the latest version
- Verify the service starts correctly
- Perform health checks
- Automatically rollback if anything fails
Manual Upgrade
To manually update to the latest version:
Monitoring Setup
When monitoring is enabled, the script:
-
Installs Prometheus
- Downloads and installs the latest Prometheus binary
- Configures it to scrape metrics from imgFlux
- Sets up as a systemd service
- Accessible at http://localhost:9090
-
Installs Grafana
- Installs via official repository (apt/yum/dnf)
- Falls back to binary installation if needed
- Configures Prometheus as datasource
- Attempts to download the imgFlux dashboard
- Accessible at http://localhost:3001 (admin/admin)
Troubleshooting
Service won't start
Port already in use
Download or installation failures
Cache not working
Monitoring not showing data
Uninstalling
Use the provided uninstall script for systemd deployments:
Or if you have it locally:
The script will:
- Stop and disable all services
- Remove systemd service files
- Remove binaries
- Optionally remove configuration files
- Optionally remove data and cache
- Optionally uninstall Grafana package
Manual Uninstall
To manually remove imgFlux:
Systemd Requirements
- Linux distribution with systemd (Ubuntu 16.04+, Debian 8+, CentOS 7+, RHEL 7+, Fedora, etc.)
- Architecture: x86_64 (amd64) or aarch64/arm64
- 2 GB RAM minimum (4 GB recommended)
- 2 GB free disk space minimum (for caching and monitoring data)
- Internet connection (for downloading binaries and dependencies)
curlorwget(for running the script)- Sufficient privileges to use
sudo - graphicsmagick will be installed automatically
Comparison: Docker vs Systemd
| Feature | Docker Deployment | Systemd Deployment |
|---|---|---|
| Installation Time | Fast (~2-5 minutes) | Fast (~3-7 minutes) |
| Disk Space | ~500 MB (images) | ~100 MB (binary + libs) |
| Dependencies | Docker only | graphicsmagick only |
| Updates | docker compose pull | Download new binary |
| Isolation | Container isolation | System process |
| Portability | High (same image everywhere) | Medium (compiled per system) |
| Resource Overhead | Small (container overhead) | None (native process) |
| Log Management | Docker logs | systemd journald |
| Service Management | docker compose | systemctl |
| Best For | Quick deployment, container infrastructure | Bare metal, no Docker environments |