BashTower
Bash Tower is a streamlined web interface for executing Bash/Python scripts across multiple remote servers via SSH. It simplifies day-to-day sysadmin tasks by providing a centralized dashboard for templates, scheduling (Cron), and host management without the overhead of heavy configuration management tools.
Install / Use
/learn @ftsiadimos/BashTowerREADME
📸 Screenshots
| Dashboard overview | AI Troubleshooter modal | | --- | --- | | <a href="mis/image1.webp" target="_blank"><img src="mis/image1.webp" width="420" alt="Dashboard View"></a> | <a href="mis/image2.webp" target="_blank"><img src="mis/image2.webp" width="420" alt="AI Troubleshooter modal"></a> | | Templates overview | AI Troubleshooter modal |
🚀 Features
Core Functionality
| Feature | Description | |---------|-------------| | 🖥️ Multi-Host Execution | Run scripts on multiple hosts simultaneously via SSH | | 📝 Template Library | Save reusable Bash & Python script templates with syntax highlighting | | 🎯 Dynamic Arguments | Create parameterized templates with runtime arguments for flexible script execution | | 🐍 Python Support | Execute Python 3 scripts alongside traditional Bash scripts | | 👥 Host & Group Management | Organize hosts into logical groups for bulk operations | | 🔑 Secure SSH Key Storage | Store private keys with AES-256 encryption | | 📊 Real-time Job Monitoring | View live stdout/stderr output with status tracking | | ⏰ Cron Job Scheduler | Schedule recurring script execution with cron expressions | | 📜 Execution History | Complete audit trail with configurable auto-cleanup |
Integrations
| Feature | Description | |---------|-------------| | 🔄 Git Repository Sync | Sync your script templates to a Git repository for version control and easy sharing | | 🤖 AI-Powered Troubleshooting | Analyze job errors and get solutions with OpenAI, Google Gemini, or Ollama | | ✨ AI Script Assistant | Generate, improve, and debug scripts using AI directly in the editor | | 🛰️ Red Hat Satellite Sync | Auto-import host inventory from Satellite API |
Full Backup (Git) 🔁
BashTower can create a full backup of your instance and store it in a Git repository. The backup is written to a dedicated backup branch and includes:
- Templates (scripts in
scripts/), plus abashtower_backup.jsonmanifest and aREADME.mdwith statistics - Hosts and Host Groups
- Cron jobs (with template and key mapping)
- SSH keys (private keys are excluded by default; can be included if you opt in)
- Users (password hashes excluded by default; can be included if you opt in)
- Application settings (AI config,
auth_disabled,cron_history_limit); API keys included only when sensitive data option is enabled
Security note: sensitive data (SSH private keys, user passwords, API keys, Satellite passwords) are excluded by default. Enable the Include Sensitive Data option in the UI to include them (only do this for private repositories you fully control).
You can also restore a full backup from the backup branch via the Git Sync UI. When restoring you may choose to overwrite existing data (be cautious; this can modify current hosts, templates, cron jobs, SSH keys and users).
User Experience
| Feature | Description | |---------|-------------| | 🎨 Modern UI | Clean, responsive interface with Tailwind CSS | | 🔐 User Authentication | Multi-user support with admin roles | | 📱 Mobile Friendly | Responsive design works on any device | | 🐳 Docker Ready | One-command deployment with Docker |
📋 Table of Contents
⚡ Quick Start
Using Docker (Recommended)
Docker Hub
# pull and run from Docker Hub
docker run -d \
--name bashtower \
-p 1008:1008 \
-v bashtower_data:/app/instance \
ftsiadimos/bashtower
# access at http://localhost:1008
GitHub Container Registry (GHCR)
# pull and run from GHCR
docker run -d \
--name bashtower \
-p 1008:1008 \
-v bashtower_data:/app/instance \
ghcr.io/ftsiadimos/bashtower:latest
# access at http://localhost:1008
Note: both the Docker Hub and GHCR images are built from the same codebase and are published/synced at the same time. You can safely use either registry interchangeably.
⚠️ Default Login:
Username:admin
Password:adminImportant: You will be prompted to change the password on first login.
Using Docker Compose
version: '3.8'
services:
bashtower:
# You can use either image from Docker Hub or GitHub Container Registry (GHCR):
# image: ftsiadimos/bashtower
# or
# image: ghcr.io/ftsiadimos/bashtower:latest
image: ftsiadimos/bashtower
container_name: bashtower
ports:
- "1008:1008"
volumes:
- ./instance:/app/instance
restart: unless-stopped
docker-compose up -d
📦 Installation
Prerequisites
- Python 3.9+ (for local installation)
- Docker Engine (for containerized deployment)
- SSH access to target hosts
Option 1: Local Installation
# Clone the repository
git clone https://github.com/ftsiadimos/BashTower.git
cd BashTower
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the application
flask run --host=0.0.0.0 --port=1008
Option 2: Development Setup
# Clone and setup
git clone https://github.com/ftsiadimos/BashTower.git
cd BashTower
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Run in debug mode
FLASK_DEBUG=1 flask run --host=0.0.0.0 --port=5000
⚙️ Configuration
Environment Variables
| Variable | Description | Default | |----------|-------------|---------| | `FLASK_SECRET_KEY` | Flask session secret key | Auto-generated | | `BASHTOWER_SECRET_KEY` | Encryption key for SSH keys & API keys | Built-in default | | `DATABASE_URL` | Database connection string | `sqlite:///instance/bashtower.db` |
Security Recommendations
For production deployments:
# Generate secure keys
export FLASK_SECRET_KEY=\$(python -c "import secrets; print(secrets.token_hex(32))")
export BASHTOWER_SECRET_KEY=\$(python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())")
📖 Usage Guide
1. Initial Setup
- Access the UI at `http://localhost:1008`
- Create an admin account on first login
- Add SSH Keys in the Keys section (RSA, Ed25519, or ECDSA)
- Add Hosts with their connection details
2. Managing Hosts
Hosts → Add Host
├── Name: friendly display name
├── Hostname: IP address or FQDN
├── Username: SSH user
└── Port: SSH port (default: 22)
Host Groups: Organize hosts into groups for bulk operations (e.g., "Web Servers", "Databases")
3. Creating Templates
Navigate to Templates and create reusable scripts:
Basic Bash Script Example:
#!/bin/bash
echo "System Info for \$(hostname)"
echo "=========================="
uname -a
df -h
free -m
Dynamic Script with Arguments:
#!/bin/bash
echo "Server: {{server_name}}"
echo "Environment: {{environment}}"
echo "Testing port {{port}}..."
nc -z localhost {{port}} && echo "Port {{port}} is open" || echo "Port {{port}} is closed"
Python Script Example:
#!/usr/bin/env python3
import platform
import psutil
print(f"System: {platform.system()}")
print(f"CPU Usage: {psutil.cpu_percent()}%")
print(f"Memory: {psutil.virtual_memory().percent}%")
Creating Dynamic Templates:
- Click "Add Argument" to define script parameters
- Configure each argument:
- Variable Name: Used as
{{variable_name}}in your script - Label: User-friendly display name
- Type: text, password, number, or select
- Required: Whether the argument is mandatory
- Default Value: Pre-filled value for convenience
- Description: Help text for users
- Variable Name: Used as
- Use
{{argument_name}}placeholders anywhere in your script - Arguments will be prompted for when executing the template
4. Running Scripts
- Go to Dashboard
- Select a Template (with Bash/Python indicator)
- Fill in Script Arguments (if the template has dynamic parameters)
- Choose Target: Host Groups or Individual Hosts
- Select an SSH Key
- Click Launch Script
- Monitor real-time output in the terminal view
Script Arguments: Templates with dynamic arguments will display an arguments section where you can:
- Fill in required parameters (marked with *)
- Override default values
- See descriptions for each argument
- Use different values for different environments
5. Scheduling Cron Jobs
- Navig
