A comprehensive, automated setup script for configuring a fresh Debian installation with developer tools, security enhancements, and productivity applications.
This bootstrap script transforms a fresh Debian installation into a fully-configured development workstation with:
- Package Management: APT, Flatpak, Snap, and Homebrew integration
- Security: UFW firewall, fail2ban, and AppArmor configuration
- Developer Tools: Git, build tools, package managers, and custom scripts
- System Customization: Terminal emulation, fonts, themes, and keyboard remapping
- Error Handling: Robust installation with detailed failure reporting
wget https://raw.githubusercontent.com/stefan-hacks/dotfiles/refs/heads/main/custom_tools_and_scripts/bash/bootstrap.sh
chmod +x bootstrap.sh
./bootstrap.sh- Fresh Debian installation (tested on Debian 12/13)
sudoprivileges- Internet connection
- At least 2GB of free disk space
- Updates System: Updates APT repositories and upgrades existing packages
- Installs Core Tools: Git, curl, wget, build-essential, and development headers
- Removes Bloatware: Uninstalls unnecessary applications (Audacity, GIMP, LibreOffice)
- Security Hardening: Configures fail2ban for SSH protection and UFW firewall
- Homebrew Setup: Installs Homebrew for Linux and adds to shell environment
- Dotfiles Configuration: Clones and applies personal dotfiles repository
- APT Package Management: Installs packages from
apt_list.bakwith intelligent filtering - Universal Packages: Sets up Flatpak and Snap with package installations
- Custom Scripts: Installs personal productivity scripts to
/usr/local/bin - Shell Enhancement: Configures
ble.shfor advanced Bash features - Font Installation: Installs Nerd Fonts for terminal and development use
- Kanata Keyboard: Sets up keyboard remapping service
- Terminal Configuration: Sets Kitty as default terminal emulator
- GRUB Theme: Applies custom GRUB bootloader theme
- Driver Installation: Installs Realtek wireless adapter drivers
- GNOME Settings: Restores personalized desktop configuration
The script implements sophisticated error handling:
- Individual Package Installation: Each package is installed separately
- Failure Tracking: Failed packages are logged and displayed at the end
- Continue On Error: Script proceeds even if some packages fail
- Detailed Reporting: Clear success/failure indicators with package names
| Manager | Error Handling | Recovery |
|---|---|---|
| APT | Individual package attempts | Continues on failure |
| Flatpak | Per-package installation | Tracks failures |
| Snap | One-by-one installation | Logs missing packages |
| Homebrew | Brewfile line parsing | Individual formula attempts |
At completion, the script displays:
=== INSTALLATION SUMMARY ===
β APT - All packages installed successfully
β Flatpak - Packages requiring manual installation:
- package-name-1
- package-name-2
β Snap - All packages installed successfully
β Homebrew - All packages installed successfully
=== END SUMMARY ===
The script uses these configuration files from the dotfiles repository:
| File | Purpose | Location |
|---|---|---|
apt_list.bak |
APT packages | dotfiles/backups/ |
flatpak_list.bak |
Flatpak applications | dotfiles/backups/ |
snap_list.bak |
Snap packages | dotfiles/backups/ |
Brewfile |
Homebrew formulae | dotfiles/backups/ |
Personal scripts installed to /usr/local/bin/:
fza- Fuzzy apt package manager with tui interfacefzm- Fuzzy manpager - search manual pages toolgspb- Gnome settings & package backupsidh- A beautiful organized & colorized detailed version of the id commanduma- Professional tool to analyze umask values and their effects on file/directory permissionslsgroups- Display detailed group information for users in a beautifully formatted output.
- Default Terminal: Kitty (replaces GNOME Terminal)
- Shell Enhancement:
ble.shfor advanced Bash features - Prompt Customization: Lock icon in sudo password prompt
- Fonts: Nerd Fonts (Hack, Source Code Pro, JetBrains Mono)
- GRUB Theme: WhiteSur theme with custom background
- Icon Theme: Tela-circle-icons (commented in script)
- GNOME Settings: Full desktop configuration restore
- Firewall: UFW with default deny incoming, allow outgoing
- SSH Protection: fail2ban with systemd backend
- Service Hardening: AppArmor profiles (commented)
- Port Configuration: Open only 22 (SSH), 80 (HTTP), 443 (HTTPS)
Some changes require a system restart:
sudo rebootCheck the installation summary for any packages that need manual installation.
Verify these services are running:
systemctl status fail2ban
sudo ufw status
systemctl --user status kanata.service-
Package Installation Failures
# Check the installation summary # Manually install listed packages sudo apt install <package-name>
-
Homebrew Issues
# Update Homebrew brew update # Fix Homebrew permissions sudo chown -R $(whoami) /home/linuxbrew/.linuxbrew
-
Permission Problems
# Reset script permissions chmod +x bootstrap.sh # Run with sudo for system-wide changes sudo ./bootstrap.sh
Run the script with debug output:
bash -x bootstrap.shdotfiles/
βββ backups/
β βββ apt_list.bak # APT packages
β βββ flatpak_list.bak # Flatpak applications
β βββ snap_list.bak # Snap packages
β βββ Brewfile # Homebrew formulae
β βββ gnome_settings.bak # GNOME configuration
βββ custom_tools_and_scripts/
β βββ bash/ # Custom bash scripts
βββ bootstrap.sh # This installation script
- Fork the repository
- Create a feature branch
- Make your changes
- Test the bootstrap script
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Use at your own risk! This script makes significant changes to your system:
- Modifies system configuration files
- Installs/uninstalls packages
- Changes default applications
- Modifies security settings
Always review the script before running it on production systems.
- Homebrew - Package manager for Linux
- Nerd Fonts - Iconic font aggregator
- Kanata - Keyboard remapping tool
- ble.sh - Bash line editor
Made with β€οΈ by stefan-hacks