One-command VPS & AWS server setup automation β LEMP Β· LAMP Β· Node.js Β· Docker Β· Redis Β· SSL Β· Firewall
βββββββ βββ ββββββ ββββββββββββββββ
βββββββββββ ββββββ ββββββββββββββββ
βββββββββββ ββββββ ββββββββββββββ
βββββββ βββ ββββββ ββββββββββββββ
βββ βββββββββββββββββββββββββββββββββ
βββ βββββββ ββββββββββββββββββββββββ
βββββββ βββββββββββββββ βββ βββββββ βββ βββ
βββββββββββββββββββββββββββ βββββββββββββ ββββ
βββ βββββββββ βββββββββββ βββ βββ βββββββ
βββ βββββββββ βββββββ βββ βββ βββ βββββ
βββββββββββββββββββ βββββββββββββββββ βββ
βββββββ βββββββββββ ββββββββ βββββββ βββ
VPS & AWS Server Automation Β· by @Xbot-me
PulseDeploy is a modular Bash automation toolkit for spinning up production-ready Linux servers in minutes β whether you're on a Hetzner VPS, DigitalOcean Droplet, Linode, Vultr, or AWS EC2.
No Ansible. No Terraform. No YAML hell. Just clean, readable Bash with an interactive wizard that auto-detects your OS, adapts to your RAM, asks what you need β then gets out of the way.
Built by a developer who personally recovered from 502 storms, 8GB database bloat, Redis misconfigurations, and live payment skimmer incidents on a WooCommerce store with 130k+ customers. This script exists because I needed it to exist.
| Category | What's included |
|---|---|
| Stacks | LEMP (Nginx + PHP-FPM + MySQL), LAMP (Apache + PHP + MySQL), Node.js + PM2 + Nginx reverse proxy |
| PHP | Version selector (8.1 / 8.2 / 8.3), OPcache JIT, PHP-FPM pool auto-tuning based on RAM |
| Security | UFW / firewalld, fail2ban (SSH + Nginx + Apache rules), secure file blocking in web configs |
| SSL | Certbot (Let's Encrypt) with auto-renewal cron |
| Caching | Redis with Unix socket or TCP, maxmemory auto-calculated, allkeys-lru policy |
| Containers | Docker Engine + Docker Compose v2, log rotation, weekly prune cron |
| Swap | Auto-sized swap file based on detected RAM, swappiness=10 tuning |
| Logging | Full install log saved to /var/log/pulsedeploy.log |
| Distro | Package Manager | Notes |
|---|---|---|
| Ubuntu 20.04 / 22.04 / 24.04 | apt | Full support |
| Debian 11 (Bullseye) / 12 (Bookworm) | apt | Full support |
| Amazon Linux 2 / 2023 | dnf | AWS-aware: Security Group hints, IMDSv2 detection |
| CentOS 8 / Rocky Linux 8 & 9 | dnf | SELinux awareness, Remi repo for PHP |
# 1. Clone the repo
git clone https://github.com/Xbot-me/PulseDeploy.git
cd PulseDeploy
# 2. Make executable
chmod +x bootstrap.sh scripts/**/*.sh
# 3. Run as root
sudo bash bootstrap.shThe interactive wizard walks you through:
- OS detection β automatic, no input needed
- Stack selection β LEMP / LAMP / Node.js / core only
- Services toggle β Redis Β· Docker Β· Firewall Β· SSL Β· Swap Β· PHP tuning
- Summary + confirmation β review everything before a single package is installed
PulseDeploy/
βββ bootstrap.sh # Main entry point & interactive wizard
βββ scripts/
β βββ os/ # OS-specific package management
β β βββ ubuntu.sh
β β βββ debian.sh
β β βββ amazon_linux.sh # AWS-aware (IMDSv2, Security Group hints)
β β βββ centos_rocky.sh # SELinux-aware
β βββ stacks/ # Web stack installers
β β βββ lemp.sh # Nginx + PHP-FPM + MySQL
β β βββ lamp.sh # Apache + PHP + MySQL
β β βββ node.sh # Node.js + PM2 + Nginx proxy
β βββ services/ # Optional service installers
β βββ firewall.sh # UFW / firewalld + fail2ban
β βββ redis.sh # Redis with socket/TCP option
β βββ docker.sh # Docker Engine + Compose v2
β βββ certbot.sh # Let's Encrypt SSL + auto-renewal
β βββ swap.sh # Auto-sized swap file
β βββ php_tune.sh # PHP-FPM + OPcache + php.ini tuning
βββ config/
β βββ nginx/default.conf # Production Nginx template
β βββ apache/vhost.conf # Production Apache vhost template
βββ .github/workflows/ci.yml # ShellCheck lint + config validation
When running on Amazon Linux 2 / 2023, PulseDeploy automatically:
- Detects the EC2 instance via IMDSv2
- Warns you to open ports 80/443/22 in your Security Group (OS-level firewall rules alone are not enough on AWS)
- Uses
firewalldinstead ofufw - Falls back to MariaDB if the MySQL repo is unavailable
Recommended EC2 setup before running:
# Open required ports via AWS CLI
aws ec2 authorize-security-group-ingress \
--group-id sg-xxxxxxxx \
--protocol tcp --port 80 --cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress \
--group-id sg-xxxxxxxx \
--protocol tcp --port 443 --cidr 0.0.0.0/0Every stack is deployed with hardened defaults out of the box:
server_tokens offβ hides Nginx/Apache version from response headers- Blocked access to
.env,.git,.sql,.log,.bak,.shfiles - HTTP security headers:
X-Frame-Options,X-Content-Type-Options,X-XSS-Protection,Referrer-Policy - fail2ban: 24-hour SSH ban after 3 failed attempts, Nginx + Apache jail rules included
- MySQL root password auto-generated and saved to
/root/.my.cnf(chmod 600) - PHP:
expose_php = Off, memory and upload limits set for production
Every module is independently sourceable β no need to run the full wizard:
# Install only Redis on an existing server
source scripts/os/ubuntu.sh
source scripts/services/redis.sh
install_redis
# Tune PHP-FPM on a live server
source scripts/os/ubuntu.sh
source scripts/services/php_tune.sh
tune_php_fpm
# Set up Docker only
source scripts/os/debian.sh
source scripts/services/docker.sh
install_docker- Delete
/var/www/html/info.phpafter verifying PHP works - Run
certbot --nginx -d yourdomain.comto issue SSL certificate - Point your domain DNS A record to your server IP
- Review fail2ban:
fail2ban-client status sshd - Check firewall rules:
ufw statusorfirewall-cmd --list-all - Test Redis:
redis-cli pingβ should returnPONG - On AWS: verify Security Group rules in the AWS Console
-
--non-interactiveflag mode for cloud-init / user-data bootstrapping - WordPress fast-deploy module (on top of LEMP)
-
healthcheck.shβ audit an existing server's config and services - PostgreSQL stack option
- Slack / email notification on install complete
PRs welcome. If you add support for a new distro or service, follow the existing module pattern β one file per concern, source-able standalone, OS functions via the os_* abstraction layer.
git checkout -b feat/your-feature
# make changes
git commit -m "feat: description"
git push origin feat/your-featureMIT β free to use, fork, and adapt for your own infrastructure.
Built by @Xbot-me Β·
build it Β· break it Β· fix it Β· automate it