A modular, enterprise-grade Linux system configuration and hardening framework built for DevOps engineers and system administrators.
- Overview
- Key Features
- Quick Start
- Installation
- Architecture
- Usage
- Workflows
- Modules
- Configuration
- Documentation
- Contributing
- License
Flux Framework is a comprehensive system administration toolkit designed to automate and standardize Linux server configuration. Built with modularity and security at its core, it provides a consistent, reliable interface for system setup, hardening, and maintenance across multiple Linux distributions.
- β‘ Fast Setup - Get a production-ready server in minutes
- π Security Hardened - Industry best practices baked in
- π§© Modular Design - Use only what you need
- π Idempotent - Safe to run multiple times
- π Well Tested - Battle-tested on Ubuntu, Debian, CentOS, RHEL
- π Self-Documenting - Comprehensive logs and help text
Each function is a separate, independent module that can be used standalone or as part of a workflow.
- SSH hardening with modern ciphers and key algorithms
- Automatic firewall configuration (UFW/firewalld)
- Kernel parameter hardening via sysctl
- Fail2ban integration for intrusion prevention
- Certificate management with validation
Pre-defined workflows for common scenarios:
- Essential - Basic server setup
- Security - Comprehensive hardening
- Complete - Full system configuration
- Development - Dev environment setup
- Monitoring - Observability stack
- Detailed operation logging to
/var/log/flux-setup.log - Color-coded console output
- Configurable log levels (debug, info, warn, error)
- Error tracking with line numbers and stack traces
- Interactive wizards for guided setup
- Non-interactive mode for automation
- Help text for every module and option
- Argument validation and helpful error messages
Tested and working on:
- β Ubuntu (18.04, 20.04, 22.04, 24.04)
- β Debian (10, 11, 12)
- β CentOS (7, 8, Stream)
- β RHEL (7, 8, 9)
- β Rocky Linux
- β AlmaLinux
git clone https://github.com/ethanbissbort/flux-framework.git && cd flux-framework && chmod +x *.sh modules/*.sh && sudo ./main.sh workflow essential# 1. Clone the repository
git clone https://github.com/ethanbissbort/flux-framework.git
cd flux-framework
# 2. Make scripts executable
chmod +x *.sh modules/*.sh
# 3. View available commands
./main.sh help
# 4. Run essential setup (interactive)
sudo ./main.sh workflow essential
# 5. Or run complete setup (all modules)
sudo ./main.sh workflow complete- System Update - Updates packages and installs essentials
- Certificate Installation - Installs trusted certificates
- Kernel Hardening - Applies secure sysctl parameters
- SSH Hardening - Secures SSH with modern crypto
β±οΈ Estimated time: 5-10 minutes (depending on system and internet speed)
- OS: Linux (Ubuntu, Debian, CentOS, RHEL, or derivatives)
- Privileges: Root or sudo access
- Tools: git, bash 4+
- Network: Internet connection (for package downloads)
# Clone repository
git clone https://github.com/ethanbissbort/flux-framework.git
# Navigate to directory
cd flux-framework
# Make scripts executable
chmod +x main.sh flux-helpers.sh modules/*.sh
# Verify installation
./main.sh versionWant to keep Flux in /opt or another location?
# Move to preferred location
sudo mv flux-framework /opt/flux
# Create symlink for easy access
sudo ln -s /opt/flux/main.sh /usr/local/bin/flux
# Use from anywhere
flux helpflux-framework/
β
βββ π main.sh # Core orchestrator
βββ π flux-helpers.sh # Shared helper library
β
βββ π modules/ # Functional modules
β βββ flux-certs-module.sh # π Certificate management
β βββ flux-firewall-module.sh # π‘οΈ Firewall configuration
β βββ flux-hostname-module.sh # π·οΈ Hostname management
β βββ flux-motd-module.sh # π¬ MOTD customization
β βββ flux-netdata-module.sh # π Monitoring setup
β βββ flux-network-module.sh # π Network configuration
β βββ flux-ssh-module.sh # π SSH hardening
β βββ flux-sysctl-module.sh # βοΈ Kernel parameters
β βββ flux-update-module.sh # π¦ System updates
β βββ flux-user-module.sh # π€ User management
β βββ flux-zsh-module.sh # π ZSH installation
β
βββ π config/ # Configuration templates
β βββ .zshrc # ZSH configuration
β βββ fluxlab.zsh-theme # Custom theme
β βββ 90-fluxlab.yaml # Netplan template
β βββ 01-fluxlab-vlan.yaml # VLAN template
β
βββ π certs/ # Certificate storage
βββ π docs/ # Documentation
β βββ quick-start.md # Getting started guide
β βββ module-reference.md # Detailed module docs
β βββ configuration-guide.md # Configuration options
β βββ security-guide.md # Security best practices
β βββ troubleshooting.md # Common issues & solutions
β
βββ π LICENSE # MIT License
| Component | Purpose | Type |
|---|---|---|
main.sh |
Framework orchestrator | Core |
flux-helpers.sh |
Reusable functions | Library |
modules/*.sh |
Individual features | Modules |
config/* |
Configuration templates | Templates |
docs/* |
Documentation | Docs |
# Display help
./main.sh help
# Show version and modules
./main.sh version
# List all available modules
./main.sh list
# List all workflows
./main.sh workflows
# Check system status
./main.sh status
# Set configuration value
./main.sh config KEY VALUE# General syntax
./main.sh load MODULE [OPTIONS]
# Get module help
./main.sh load MODULE --help
# Examples
./main.sh load network -l # List interfaces
./main.sh load hostname -i # Interactive hostname setup
./main.sh load user --menu # User management menu
./main.sh load ssh -w # SSH hardening wizard
./main.sh load sysctl --verify # Verify sysctl settings# Module directory (default: ./modules)
export FLUX_MODULES_DIR=/opt/flux/modules
# Configuration directory (default: ~/.config/flux)
export FLUX_CONFIG_DIR=/etc/flux
# Log file (default: /var/log/flux-setup.log)
export LOGFILE=/var/log/flux.log
# Log level (0=debug, 1=info, 2=warn, 3=error)
export LOG_LEVEL=1Workflows are pre-defined sequences of modules for common scenarios.
| Workflow | Modules | Purpose | Time |
|---|---|---|---|
| essential | update, certs, sysctl, ssh | Basic server setup | ~5 min |
| security | update, certs, sysctl, ssh, firewall | Security hardening | ~10 min |
| complete | All modules | Full system configuration | ~20 min |
| development | update, zsh | Dev environment | ~8 min |
| monitoring | update, netdata | Monitoring stack | ~7 min |
# Interactive mode (prompts for each step)
sudo ./main.sh workflow essential
# Non-interactive mode (auto-execute all)
sudo ./main.sh workflow essential -y
# Check what's in a workflow
./main.sh workflowsPerfect for new servers that need basic hardening.
sudo ./main.sh workflow essentialIncludes:
- β System updates and essential packages
- β Trusted certificate installation
- β Kernel security hardening
- β SSH server hardening
Comprehensive security hardening for production servers.
sudo ./main.sh workflow securityIncludes:
- β Everything in Essential
- β Firewall configuration (UFW/firewalld)
- β Fail2ban setup
- β Security auditing
Full server configuration with all modules.
sudo ./main.sh workflow completeIncludes:
- β Everything in Security
- β Hostname and network configuration
- β User and group management
- β ZSH and Oh-My-Zsh
- β Custom MOTD
- β NetData monitoring
System updates and package installation.
# Full system update
./main.sh load update -f
# Security updates only
./main.sh load update -s
# With development packages
./main.sh load update -f -dNetwork configuration and management.
# List interfaces
./main.sh load network -l
# Configure static IP
./main.sh load network --static eth0 192.168.1.100
# Add VLAN
./main.sh load network --add-vlan eth0 100
# Network diagnostics
./main.sh load network -dSystem hostname and FQDN configuration.
# Show current hostname
./main.sh load hostname -s
# Set hostname
./main.sh load hostname -n webserver
# Set FQDN
./main.sh load hostname -f webserver.example.com
# Interactive mode
./main.sh load hostname -iUser and group management with SSH key support.
# Interactive menu
./main.sh load user --menu
# Create admin user
./main.sh load user -a
# Create user with details
./main.sh load user -c john \
--fullname "John Doe" \
--groups "developers,docker"
# Add SSH key
./main.sh load user -k john ~/.ssh/id_rsa.pub
# Import GitHub keys
./main.sh load user -k john https://github.com/johndoe.keysSSH server hardening and security.
# Interactive hardening wizard
./main.sh load ssh -w
# Apply recommended hardening
./main.sh load ssh --harden
# Change SSH port
./main.sh load ssh -p 2222
# Security audit
./main.sh load ssh -a
# Setup fail2ban
./main.sh load ssh --fail2banUnified firewall management (UFW/firewalld).
# Interactive wizard
./main.sh load firewall -w
# Apply preset
./main.sh load firewall -p web-server
# Allow port
./main.sh load firewall -a 8080/tcp
# List rules
./main.sh load firewall -l
# Backup rules
./main.sh load firewall --backupSSL/TLS certificate installation.
# Install from default repo
./main.sh load certs
# Custom repository
./main.sh load certs -c https://github.com/myorg/certs
# List certificates
./main.sh load certs -l
# Verify certificates
./main.sh load certs -vKernel parameter hardening.
# Apply hardening
./main.sh load sysctl --apply
# Force overwrite
./main.sh load sysctl --apply --force
# Verify settings
./main.sh load sysctl --verify
# Show configuration
./main.sh load sysctl --show
# Remove hardening
./main.sh load sysctl --removeZSH and Oh-My-Zsh installation.
# Install with defaults
./main.sh load zsh
# Install with Powerlevel10k
./main.sh load zsh -p
# Update plugins
./main.sh load zsh -uCustom login message (Message of the Day).
# Interactive setup
./main.sh load motd -s
# Specific ASCII art
./main.sh load motd -a flux-large -c blue
# Preview MOTD
./main.sh load motd -pReal-time monitoring system.
# Basic installation
./main.sh load netdata
# With cloud integration
./main.sh load netdata -c YOUR-CLAIM-TOKEN
# With SSL and external access
./main.sh load netdata -s -e --allowed-ips "10.0.0.0/8"Create ~/.config/flux/flux.conf:
# Flux Framework Configuration
# Logging
LOG_LEVEL=1 # 0=debug, 1=info, 2=warn, 3=error
LOGFILE="/var/log/flux-setup.log"
# Modules
AUTO_UPDATE_MODULES=false
MODULE_TIMEOUT=300 # Timeout in seconds
# Network Defaults
DEFAULT_DNS_PRIMARY="1.1.1.1"
DEFAULT_DNS_SECONDARY="8.8.8.8"
# SSH Defaults
DEFAULT_SSH_PORT="22"
# Security
AUTO_SECURITY_UPDATES=trueSet a timeout for long-running modules:
# In flux.conf
MODULE_TIMEOUT=600 # 10 minutes
# Or via environment variable
export MODULE_TIMEOUT=600Comprehensive documentation is available in the docs/ directory:
| Document | Description |
|---|---|
| Quick Start Guide | Get up and running in minutes |
| Module Reference | Detailed module documentation |
| Configuration Guide | All configuration options |
| Security Guide | Security best practices |
| Troubleshooting | Common issues and solutions |
| Contributing | How to contribute |
| Migration Guide | Upgrading from v2.x |
- β Modern ciphers and key algorithms
- β Disable password authentication
- β Disable root login
- β Custom SSH port
- β Fail2ban integration
- β Key-only authentication
- β Default deny policy
- β Service-based rules
- β Port whitelisting
- β Rate limiting
- β Automatic backup
- β SYN flood protection
- β IP spoofing prevention
- β ICMP flood protection
- β Reverse path filtering
- β BBR congestion control
- β Address space randomization
- β Certificate validation
- β Chain verification
- β Automatic installation
- β System-wide trust
# List available modules
./main.sh list
# Check module directory
ls -la modules/# Make scripts executable
chmod +x main.sh modules/*.sh
# Use sudo for system operations
sudo ./main.sh workflow essential# Verify helpers file exists
ls -la flux-helpers.sh
# Check logs for details
cat /var/log/flux-setup.log# Test connectivity
ping -c 4 8.8.8.8
# Check DNS resolution
nslookup google.com
# Review proxy settings if behind firewall
echo $http_proxyFor more detailed troubleshooting, see the Troubleshooting Guide.
We welcome contributions! Here's how you can help:
- Check existing issues
- Create a new issue with:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- System information (OS, version)
- Relevant logs
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Follow the module structure pattern
- Add tests if applicable
- Update documentation
- Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Code Style: Follow existing bash conventions
- Error Handling: Use helper functions
- Testing: Test on multiple distributions
- Documentation: Update docs for new features
- Logging: Use appropriate log levels
See Contributing Guide for details.
This project is licensed under the MIT License - see the LICENSE file for details.
β Commercial use β Modification β Distribution β Private use
β Liability β Warranty
- Built with β€οΈ and bash for Linux system administration
- Inspired by DevOps best practices and security guidelines
- Thanks to all contributors and users
- Special thanks to the open-source community
- Documentation: docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Releases: GitHub Releases
- Version: 3.0.0
- Status: Active Development
- Last Updated: 2025-11-15
- Tested On: Ubuntu 22.04, Debian 12, CentOS Stream 9
- Modules: 11
- Total Lines: ~10,000+
- Ansible playbook integration
- Docker container support
- Kubernetes cluster setup
- Web UI for configuration
- Automated testing suite
- Module marketplace
- Multi-language support
β Star this repo if you find it useful! β
Made with π₯ by Ethan Bissbort