A web-based platform for remote script execution suitable for personal and small server environments
Practical, secure, and easy to manage.
Create Bash or Python scripts to automate routine tasks, store them as templates,
and sync changes to a Git repository for easy tracking.
| Dashboard overview | AI Troubleshooter modal |
|---|---|
![]() |
![]() |
| Templates overview | AI Troubleshooter modal |
| 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 |
| 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 |
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).
| 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 |
# Pull and run in one command
docker run -d \
--name bashtower \
-p 1008:1008 \
-v bashtower_data:/app/instance \
ftsiadimos/bashtower
# Access at http://localhost:1008Default Credentials: Username:
admin/ Password:admin
version: '3.8'
services:
bashtower:
image: ftsiadimos/bashtower
container_name: bashtower
ports:
- "1008:1008"
volumes:
- ./instance:/app/instance
restart: unless-stoppeddocker-compose up -d- Python 3.9+ (for local installation)
- Docker Engine (for containerized deployment)
- SSH access to target hosts
# 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# 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| 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` |
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())")- 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
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")
Navigate to Templates and create reusable scripts:
Basic Bash Script Example:
#!/bin/bash
echo "System Info for \$(hostname)"
echo "=========================="
uname -a
df -h
free -mDynamic 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
- 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
- Navigate to Cron Jobs
- Click Create Cron Job
- Configure:
- Name: Job identifier
- Template: Script to run
- Schedule: Cron expression (e.g., `0 2 * * *` for daily at 2 AM)
- Targets: Hosts or groups
- SSH Key: Authentication key
- Enable and save
Common Cron Expressions:
| Expression | Schedule |
|---|---|
| `* * * * *` | Every minute |
| `0 * * * *` | Every hour |
| `0 0 * * *` | Daily at midnight |
| `0 2 * * *` | Daily at 2:00 AM |
| `0 0 * * 0` | Weekly on Sunday |
| `0 0 1 * *` | Monthly on the 1st |
Configure AI in Settings for:
- Error Analysis: Get intelligent troubleshooting suggestions
- Script Generation: Describe what you need, AI writes the script
Supported Providers:
- OpenAI (GPT-3.5, GPT-4)
- Google Gemini
- Ollama (self-hosted, free)
If you have a Satellite instance:
- Go to Satellite page
- Enter Satellite URL and credentials
- Click Sync Hosts
- Hosts are automatically imported with their details
BashTower provides a RESTful API for automation:
POST /api/auth/login
Content-Type: application/json
{"username": "admin", "password": "secret"}# List all templates
GET /api/templates
# Create template with arguments
POST /api/templates
{
"name": "My Dynamic Script",
"script": "#!/bin/bash\necho \"Hello {{name}}!\"\necho \"Environment: {{env}}\"",
"script_type": "bash",
"arguments": "[{\"name\":\"name\",\"label\":\"Your Name\",\"type\":\"text\",\"required\":true},{\"name\":\"env\",\"label\":\"Environment\",\"type\":\"text\",\"default_value\":\"production\"}]"
}
# Run template with arguments
POST /api/run
{
"template_id": 1,
"host_ids": [1, 2],
"key_id": 1,
"arguments": {"name": "John", "env": "staging"}
}# List hosts
GET /api/hosts
# Create host
POST /api/hosts
{"name": "Server1", "hostname": "192.168.1.10", "username": "root", "port": 22}# Get job history
GET /api/jobs
# Get job details
GET /api/jobs/{id}┌─────────────────────────────────────────────────────────────┐
│ Browser │
│ (Vue.js 3 + Tailwind) │
└─────────────────────────┬───────────────────────────────────┘
│ HTTP/REST
▼
┌─────────────────────────────────────────────────────────────┐
│ Flask Application │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Routes │ │ Services │ │ APScheduler │ │
│ │ /api/* │ │ SSH Exec │ │ (Cron Jobs) │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
│ │ │
│ ┌───────────────────────────────────────────────────────┐ │
│ │ SQLAlchemy ORM │ │
│ │ (SQLite / PostgreSQL) │ │
│ └───────────────────────────────────────────────────────┘ │
└─────────────────────────┬───────────────────────────────────┘
│ SSH (Paramiko)
▼
┌─────────────────────────────────────────────────────────────┐
│ Remote Hosts │
│ (Linux servers, VMs, containers, etc.) │
└─────────────────────────────────────────────────────────────┘
| Layer | Technology |
|---|---|
| Frontend | Vue.js 3, Tailwind CSS, Font Awesome |
| Backend | Flask 2.x, SQLAlchemy, APScheduler |
| SSH | Paramiko |
| Database | SQLite (default), PostgreSQL (optional) |
| Encryption | Cryptography (Fernet/AES-256) |
| Container | Docker, Gunicorn |
Contributions are welcome! Here's how to get started:
- Fork the repository
- Create a feature branch
git checkout -b feat/amazing-feature
- Make your changes
- Test your changes
pytest flake8 . - Commit with a clear message
git commit -m "feat: add amazing feature" - Push and open a Pull Request
- Follow PEP 8 for Python code
- Use meaningful commit messages (conventional commits preferred)
- Add tests for new features
- Update documentation as needed
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.
- Flask - Web framework
- Vue.js - Frontend framework
- Tailwind CSS - CSS framework
- Paramiko - SSH library
- APScheduler - Job scheduling
Made with ❤️ by ftsiadimos


