Production-ready server initialization with enterprise-grade security hardening.
Fresh Server Init is a comprehensive bash script designed for rapid, secure, and professional server deployment on Debian 12/13 systems. It transforms a bare-metal server into a production-ready fortress with a single command.
- Automates server initialization from fresh install to production-ready.
- Implements security best practices (firewall, fail2ban, SSH hardening).
- Deploys modern development stacks (Docker, Node.js, auto-SSL).
- Optimizes system performance (kernel, network, swap).
- Provides visual feedback with a hacker-style terminal UI.
Run the following command on your fresh Debian 12/13 server:
curl -sSL https://raw.githubusercontent.com/administrakt0r/new-server-init/main/setup.sh | sudo bashThe script will launch an interactive menu where you can choose your deployment path:
- Initialize GitHub repository & deploy (Full Stack)
- Server optimization only (Hardening & Base Tools)
- Exit
- UFW Firewall: Deny-by-default policy with rate limiting.
- Fail2Ban: Brute-force protection for SSH and other services.
- SSH Hardening: Disables root login, enforces key auth (optional), and secures configs.
- Kernel Tuning: Sysctl optimizations for security and network performance.
- Intrusion Detection: Native auditd rules and log monitoring.
- Docker & Compose: Latest stable versions.
- Reverse Proxy: Nginx-proxy with automated Let's Encrypt SSL.
- Database/Cache: Option to include PostgreSQL and Redis with generated secrets.
- Git Integration: Auto-deploy from public or private repositories.
- Dockhand: Optional simple Docker management UI.
- Memory: Optimized swap configurations (zram/swapfile).
- Network: BBR congestion control and increased connection limits.
- Tools: Pre-installs essential tools (
htop,iotop,cur,git,vim, etc.).
- OS: Debian 12 or 13 (Fresh installation recommended).
- User: Root privileges (use
sudoif not running as root). - Network: Internet access for package downloads.
The script will prompt you for:
- System Updates: Automatically performs
apt update && apt upgrade. - User Creation: Creates a secure sudo user (default:
adminor custom). - SSH Keys: Option to add your public SSH key.
- Stack Options: (If deploying an app) Domain names, repo URLs, and service selections.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Created and maintained by administrakt0r