Skip to content

Elite Auto Server Setup is an enterprise-grade automation tool that provisions complete MERN infrastructure with zero human intervention. Deploy production-ready servers in minutes, not hours.

License

Notifications You must be signed in to change notification settings

naveed-gung/Auto-Server-Script

Repository files navigation

Elite Auto Server Setup Logo Elite Auto Server Setup

Elite Auto Server Setup

Zero-Touch Production Server Provisioning for MERN Stack

Created by naveed-gung | Portfolio: naveed-gung.dev

License: MIT Bash Platform Status

Created by naveed-gung • Star • Issues • Discussions


Node.js
Node.js
20.x LTS
MongoDB
MongoDB
7.0+
Nginx
Nginx
Latest
Docker
Docker
Optional
Linux
Linux
Multi-OS

Table of Contents

Click to expand/collapse

Overview

Elite Auto Server Setup is an enterprise-grade automation tool that provisions complete MERN infrastructure with zero human intervention. Deploy production-ready servers in minutes, not hours.

graph LR
A[Fresh Server] -->|One Command| B[Elite Setup]
B --> C[Production Ready]

style A fill:#ff6b6b,stroke:#c92a2a,stroke-width:2px,color:#fff
style B fill:#4dabf7,stroke:#1971c2,stroke-width:3px,color:#fff
style C fill:#51cf66,stroke:#2f9e44,stroke-width:2px,color:#fff
Loading
Component Version Purpose
Node.js 20.x LTS JavaScript runtime (via NodeSource)
MongoDB 7.0+ NoSQL database (Community Edition)
Nginx Latest Reverse proxy + SSL termination
PM2 Latest Process manager with clustering
Docker Latest Container runtime (optional)
Certbot Latest Let's Encrypt SSL automation

What This Tool Does

Server Infrastructure

 Node.js 20.x LTS + npm/npx
 MongoDB 7.0+ (authenticated)
 Nginx (reverse proxy + SSL)
 PM2 (process manager)
 Docker + Compose (optional)
 Certbot (Let's Encrypt SSL)

Security Hardening

 UFW Firewall configuration
 Fail2ban brute-force protection
 SSH hardening (key-only auth)
 Automatic security updates
 MongoDB authentication
 Nginx security headers

What You Deploy After

Frontend Backend Database DevOps
Your React/Vue app Your Express API Connected DB Configured proxy

Features

Intelligent Automation
Pre-flight System Checks
Validates OS compatibility, disk space, ports, and services before installation
Interactive CLI Wizard
Beautiful color-coded interface with real-time progress tracking
Non-Interactive Mode
JSON configuration support for CI/CD pipelines and automation
Idempotent Operations
Safe to run multiple times without conflicts or duplicates
Automatic Rollback
Reverts changes on failure with detailed logging and recovery
Technology Stack
Component Version Purpose Status
Node.js 20.x LTS JavaScript runtime via NodeSource
MongoDB 7.0+ NoSQL database (Community Edition)
Nginx Latest Reverse proxy + SSL termination
PM2 Latest Process manager with clustering
Docker Latest Container runtime (optional)
Certbot Latest Let's Encrypt SSL automation
Security Hardening
graph TD
A[ Security Layers] --> B[ UFW Firewall]
A --> C[ Fail2ban]
A --> D[ SSH Hardening]
A --> E[ Auto Updates]
A --> F[ MongoDB Auth]
A --> G[ Nginx Headers]

B --> H[ Production Ready]
C --> H
D --> H
E --> H
F --> H
G --> H

style A fill:#339af0,stroke:#1971c2,stroke-width:3px,color:#fff
style H fill:#51cf66,stroke:#2f9e44,stroke-width:3px,color:#fff
Loading
  • UFW Firewall - Strict rules (22, 80, 443, 27017)
  • Fail2ban - Brute-force protection
  • SSH Hardening - Key-only authentication
  • Auto Updates - Unattended security patches
  • MongoDB Auth - Required authentication
  • Nginx Headers - X-Frame-Options, CSP, HSTS
  • System Limits - Optimized file descriptors
  • Audit Logging - Complete installation tracking
Enterprise Features
┌─────────────────────────────────────────────────────────────┐
│ DEPLOYMENT REPORTS │ NOTIFICATIONS │
│ ├─ HTML dashboard │ ├─ Slack integration │
│ ├─ Text summaries │ ├─ Discord webhooks │
│ └─ System information │ └─ Email alerts │
├─────────────────────────────────────────────────────────────┤
│ CONFIGURATION │ BACKUP & ROLLBACK │
│ ├─ Pre-defined profiles │ ├─ Snapshot creation │
│ ├─ Custom JSON configs │ ├─ One-click restoration │
│ └─ Multi-environment │ └─ Version control │
└─────────────────────────────────────────────────────────────┘

Quick Start

Prerequisites

Requirement Specification
OS Ubuntu 20.04/22.04 LTS
Debian 11/12
CentOS 8+ / RHEL 8+
Access Root or sudo privileges
Network Internet connection for downloads
Resources Min 10GB disk, 1GB RAM

Installation Methods

Method 1

Interactive Mode
Recommended for first-time users

git clone https://github.com/\
naveed-gung/elite-server-setup.git

cd elite-server-setup
sudo ./setup.sh

Method 2

Quick Production
Fast deployment with SSL

sudo ./setup.sh \
--profile=production \
--domain=api.yourdomain.com \
--ssl-email=admin@example.com

Method 3

CI/CD Pipeline
Automated deployment

sudo ./setup.sh \
--config=config/production.json \
--silent

Installation Demo

sequenceDiagram
participant U as User
participant S as Setup Script
participant SYS as System

U->>S: Run ./setup.sh
S->>SYS: Pre-flight checks 
S->>SYS: Install Node.js 
S->>SYS: Install MongoDB 
S->>SYS: Install Nginx 
S->>SYS: Apply Security 
S->>U: Setup Complete!
Loading

Configuration

Command-Line Options

Core Options
Usage: ./setup.sh [OPTIONS]

Core Options:
--profile=PROFILE Use predefined profile (development|staging|production)
--config=FILE Load configuration from JSON file
--mode=MODE Installation mode (interactive|silent|unattended)
--silent Suppress all prompts (requires --config)

Component Selection:
--with-nodejs Install Node.js (default: enabled)
--with-mongodb Install MongoDB (default: enabled)
--with-nginx Install Nginx (default: enabled)
--with-pm2 Install PM2 (default: enabled)
--with-docker Install Docker (default: disabled)
--skip-security Skip security hardening (not recommended)

Network Configuration:
--domain=DOMAIN Domain name for SSL configuration
--ssl-email=EMAIL Email for Let's Encrypt certificates
--enable-ssl Enable SSL/TLS with Let's Encrypt

Version Selection:
--node-version=VERSION Node.js version (18|20|22, default: 20)
--mongodb-version=VERSION MongoDB version (6.0|7.0, default: 7.0)

Security Options:
--enable-firewall Configure UFW firewall (default: production only)
--enable-fail2ban Install Fail2ban protection (default: production only)
--harden-ssh Harden SSH configuration (default: production only)

Notifications:
--slack-webhook=URL Slack webhook for notifications
--discord-webhook=URL Discord webhook for notifications
--email=ADDRESS Email address for notifications

Advanced Options:
--mongodb-auth Enable MongoDB authentication (default: production only)
--mongodb-user=USERNAME MongoDB admin username (default: admin)
--mongodb-pass=PASSWORD MongoDB admin password (auto-generated if not set)
--backup-dir=PATH Backup directory (default: /var/backups/elite-setup)
--log-level=LEVEL Logging level (debug|info|warning|error)

Utility Options:
--dry-run Show what would be installed without making changes
--force Force installation even if services exist
--cleanup Remove installation artifacts after completion
-h, --help Show this help message
-v, --version Show version information
Component Selection
--with-nodejs # Install Node.js (default: enabled)
--with-mongodb # Install MongoDB (default: enabled)
--with-nginx # Install Nginx (default: enabled)
--with-pm2 # Install PM2 (default: enabled)
--with-docker # Install Docker (default: disabled)
--skip-security # Skip security hardening (not recommended)
Network Configuration
--domain=DOMAIN # Domain name for SSL configuration
--ssl-email=EMAIL # Email for Let's Encrypt certificates
--enable-ssl # Enable SSL/TLS with Let's Encrypt
Version Selection
--node-version=VERSION # 18|20|22 (default: 20)
--mongodb-version=VERSION # 6.0|7.0 (default: 7.0)
Security Options
--enable-firewall # Configure UFW firewall
--enable-fail2ban # Install Fail2ban protection
--harden-ssh # Harden SSH configuration
Notifications
--slack-webhook=URL # Slack webhook for notifications
--discord-webhook=URL # Discord webhook for notifications
--email=ADDRESS # Email address for notifications

Configuration Profiles

Development

sudo ./setup.sh \
--profile=development

Includes:

  • Node.js 20 + npm
  • MongoDB without authentication
  • Nginx without SSL
  • PM2 in single-instance mode
  • Minimal security (for local testing)

Perfect for local testing

Production

sudo ./setup.sh \
--profile=production \
--domain=yourapp.com \
--ssl-email=admin@yourapp.com

Includes:

  • Node.js 20 + npm
  • MongoDB with authentication enabled
  • Nginx with Let's Encrypt SSL
  • PM2 in cluster mode
  • Full security hardening
  • Automatic updates enabled
  • Notifications enabled

Production-ready setup

Custom JSON

sudo ./setup.sh \
--config=config/custom.json

Includes:

  • Custom versions
  • Selective components
  • Advanced options
  • Fine-tuned security

Maximum flexibility

Example: Custom JSON Configuration
{
"profile": "production",
"nodejs": {
"enabled": true,
"version": "20"
},
"mongodb": {
"enabled": true,
"version": "7.0",
"auth": true,
"username": "admin",
"port": 27017
},
"nginx": {
"enabled": true,
"ssl": true,
"domain": "api.example.com",
"ssl_email": "admin@example.com"
},
"pm2": {
"enabled": true,
"instances": "max"
},
"docker": {
"enabled": false
},
"security": {
"firewall": true,
"fail2ban": true,
"ssh_hardening": true,
"auto_updates": true
},
"notifications": {
"slack_webhook": "https://hooks.slack.com/services/YOUR/WEBHOOK"
}
}

Post-Installation: Deploy Your MERN Application

graph LR
A[ Installation<br/>Complete] --> B[ Upload<br/>Code]
B --> C[ Install<br/>Dependencies]
C --> D[ Configure<br/>Environment]
D --> E[ Start with<br/>PM2]
E --> F[ Setup<br/>Nginx]
F --> G[ Live!]

style A fill:#51cf66,stroke:#2f9e44,stroke-width:2px,color:#fff
style G fill:#4dabf7,stroke:#1971c2,stroke-width:2px,color:#fff
Loading

Step-by-Step Deployment Guide

1. Verify Installation

# Run health check
sudo ./scripts/health-check.sh

# Check services
systemctl status nginx mongodb pm2

# View report
cat /var/log/elite-setup/report.html

2. Upload Your Code

# Via Git (recommended)
cd /var/www
git clone https://github.com/user/app.git

# Via SCP
scp -r my-app/ user@server:/var/www/

3. Install Dependencies

cd /var/www/your-app
npm install --production
npm run build # If using frontend

4. Configure Environment

# Create .env file
cat > .env << EOF
NODE_ENV=production
PORT=3000
MONGODB_URI=mongodb://admin:pass@\
localhost:27017/myapp?authSource=admin
EOF

# Get MongoDB credentials
cat /root/.mongodb_credentials

5. Start with PM2

# Start application
pm2 start server.js --name my-app -i max

# Save configuration
pm2 save
pm2 startup

6. Configure Nginx

# Create site configuration
sudo nano /etc/nginx/sites-available/app
Example Nginx Configuration
server {
server_name yourdomain.com www.yourdomain.com;

# Proxy to Node.js app
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}

listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

server {
if ($host = www.yourdomain.com) {
return 301 https://$host$request_uri;
}
if ($host = yourdomain.com) {
return 301 https://$host$request_uri;
}
listen 80;
server_name yourdomain.com www.yourdomain.com;
return 404;
}

Enable and reload:

sudo ln -s /etc/nginx/sites-available/app /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
MongoDB Connection Setup
# Get credentials
cat /root/.mongodb_credentials

# Connect to MongoDB
mongosh "mongodb://admin:YOUR_PASSWORD@localhost:27017/?authSource=admin"

# Create application database
use myapp
db.createUser({
user: "myappuser",
pwd: "secure_password",
roles: [{ role: "readWrite", db: "myapp" }]
})

Update connection string in your app:

// In your Node.js app
const MONGODB_URI = "mongodb://myappuser:secure_password@localhost:27017/myapp?authSource=myapp";

Maintenance & Operations

Daily Operations Dashboard

Task Command Frequency
Health Check Daily
View Logs As needed
Restart Services As needed
Backup Data Weekly
SSL Renewal Auto (90 days)
Health Monitoring
# Comprehensive health check
sudo ./scripts/health-check.sh

# Quick status check
systemctl status nginx mongodb pm2

# Resource monitoring
htop
pm2 monit
Log Management

Elite Setup Logs

tail -f /var/log/elite-setup/setup.log

Nginx Logs

tail -f /var/log/nginx/access.log
tail -f /var/log/nginx/error.log

MongoDB Logs

tail -f /var/log/mongodb/mongod.log

PM2 Logs

pm2 logs
pm2 logs app-name
Backup & Restore

Create Backup:

# Backup MongoDB
mongodump --uri="mongodb://admin:password@localhost:27017" \
--out=/backup/mongo-$(date +%Y%m%d)

# Backup configurations
sudo tar -czf /backup/configs-$(date +%Y%m%d).tar.gz \
/etc/nginx \
/etc/mongod.conf \
/etc/systemd/system/pm2-*.service

Rollback Installation:

# Revert to pre-installation state
sudo ./scripts/rollback.sh
SSL Certificate Management
# Certificates auto-renew via certbot
# Check renewal status
sudo certbot renew --dry-run

# Force renewal
sudo certbot renew --force-renewal

# Reload Nginx after renewal
sudo systemctl reload nginx

Testing & Validation

Comprehensive Validation Suite

# Run quick validation (no installation required)
./quick-test.sh

# Verbose output with detailed analysis
./quick-test.sh --verbose

Test Coverage:

  • File structure validation (20+ tests)
  • Bash syntax checking
  • JSON configuration validation
  • Security analysis (credentials, unsafe commands)
  • Code quality metrics (LOC, functions, modularity)
  • Documentation quality assessment
  • Integration & compatibility tests
  • Compliance & standards verification
Test Coverage Matrix
Category Tests Status
File Structure 20+
Syntax Checking 15+
JSON Validation 10+
Security Analysis 25+
Code Quality 12+
Documentation 8+
Integration 10+
Compliance 5+
Example Test Output
╔═══════════════════════════════════════════════════╗
║ ELITE AUTO SETUP - VALIDATION SUITE ║
║ Enterprise-Grade Testing Framework ║
║ Created by: naveed-gung ║
╚═══════════════════════════════════════════════════╝

Platform: Linux
Directory: /opt/elite-server-setup

═══════════════════════════════════════════════
1. FILE STRUCTURE VALIDATION
═══════════════════════════════════════════════

[] Main script: setup.sh
[] Documentation: README.md
[] License file: LICENSE
[] Library: lib/colors.sh (298 lines)
[] Library: lib/logger.sh (377 lines)

═══════════════════════════════════════════════
TEST SUMMARY
═══════════════════════════════════════════════

Total Tests: 85
 Passed: 82
 Failed: 0
 Warnings: 3

Success Rate: 96.5%
[██████████████████████████████████████████████░░░]

╔═══════════════════════════════════════════════╗
║ ALL TESTS PASSED! ║
║ Project is production-ready ║
╚═══════════════════════════════════════════════╝

Troubleshooting

Common Issues & Solutions

MongoDB Connection Failed
# Check MongoDB status
sudo systemctl status mongodb

# Check logs
sudo tail -f /var/log/mongodb/mongod.log

# Verify authentication
mongosh --username admin --password --authenticationDatabase admin

# Restart MongoDB
sudo systemctl restart mongodb

Common causes:

  • Wrong credentials
  • Authentication database mismatch
  • Port 27017 blocked
  • MongoDB not started
Nginx Configuration Error
# Test configuration
sudo nginx -t

# Check error logs
sudo tail -f /var/log/nginx/error.log

# Reload configuration
sudo systemctl reload nginx

Common causes:

  • Syntax errors in config
  • Certificate path issues
  • Port already in use
  • Incorrect server_name
PM2 Process Crashes
# View PM2 logs
pm2 logs

# Check process status
pm2 list

# Restart app
pm2 restart app-name

# Monitor in real-time
pm2 monit

Common causes:

  • Uncaught exceptions
  • Memory leaks
  • Port conflicts
  • Missing dependencies
Firewall Blocking Connections
# Check UFW status
sudo ufw status verbose

# Allow specific port
sudo ufw allow 3000/tcp

# Reload firewall
sudo ufw reload

Common causes:

  • Port not allowed in UFW
  • Wrong protocol (TCP/UDP)
  • Application not listening
  • SELinux restrictions

Getting Help


GitHub Issues
Report a bug

Documentation
README + inline comments

Community
Join discussions

Before requesting help:

  1. Check logs: /var/log/elite-setup/setup.log
  2. Run health check: sudo ./scripts/health-check.sh
  3. Review report: /var/log/elite-setup/report.html
  4. Include error messages in your issue

Project Architecture

graph TB
subgraph " Elite Server Setup"
A[setup.sh<br/>336 lines]
B[quick-test.sh<br/>Validation]
end

subgraph " Core Libraries - 3,850+ LOC"
C[colors.sh<br/>298 lines]
D[logger.sh<br/>377 lines]
E[utils.sh<br/>507 lines]
F[preflight.sh<br/>276 lines]
G[config.sh<br/>352 lines]
H[installer.sh<br/>586 lines]
I[security.sh<br/>380 lines]
J[reporting.sh<br/>465 lines]
K[notifications.sh<br/>420 lines]
end

subgraph " Configuration"
L[production.json]
M[development.json]
N[custom.json]
end

subgraph " Templates"
O[nginx.conf]
P[mongod.conf]
Q[ecosystem.config.js]
end

A --> C & D & E & F & G & H & I & J & K
A --> L & M & N
H --> O & P & Q

style A fill:#4dabf7,stroke:#1971c2,stroke-width:3px,color:#fff
style B fill:#51cf66,stroke:#2f9e44,stroke-width:2px,color:#fff
Loading

Directory Structure

Click to view complete structure
elite-server-setup/
│
├── setup.sh # Main entry point (336 lines)
├── quick-test.sh # Professional validation suite
├── LICENSE # MIT License
├── README.md # This documentation
│
├── lib/ # Core library modules (3,850+ LOC)
│ ├── colors.sh # Terminal UI & formatting (298 lines)
│ ├── logger.sh # Structured logging system (377 lines)
│ ├── utils.sh # 50+ utility functions (507 lines)
│ ├── preflight.sh # Pre-flight system checks (276 lines)
│ ├── config.sh # Configuration management (352 lines)
│ ├── installer.sh # Component installers (586 lines)
│ ├── security.sh # Security hardening (380 lines)
│ ├── reporting.sh # Report generation (465 lines)
│ └── notifications.sh # Alert system (420 lines)
│
├── config/ # Configuration profiles
│ ├── production.json # Production settings
│ ├── development.json # Development settings
│ └── custom.json # Custom configuration template
│
├── templates/ # Service configuration templates
│ ├── nginx.conf # Nginx main configuration
│ ├── site.conf # Nginx site template
│ ├── mongod.conf # MongoDB configuration
│ └── ecosystem.config.js # PM2 configuration
│
├── scripts/ # Utility scripts
│ ├── health-check.sh # System verification (200+ lines)
│ ├── rollback.sh # Installation reversal (150+ lines)
│ └── backup.sh # Backup automation
│
├── tests/ # Test suite
│ ├── run-tests.sh # Automated tests
│ └── integration/ # Integration tests
│
└── assets/ # Media assets
├── hero-dark.png # Dark mode banner
├── hero-light.png # Light mode banner
└── diagrams/ # Architecture diagrams

Installation Flow

stateDiagram-v2
[*] --> PreFlight: Start Setup

PreFlight --> Validation: System Check
Validation --> LoadConfig: Valid
Validation --> Error: Invalid

LoadConfig --> Backup: Load Settings
Backup --> InstallNode: Create Snapshot

InstallNode --> InstallMongo: Node.js 
InstallMongo --> InstallNginx: MongoDB 
InstallNginx --> InstallPM2: Nginx 
InstallPM2 --> Docker: PM2 

Docker --> Security: Skip Docker
Docker --> InstallDocker: Install Docker
InstallDocker --> Security: Docker 

Security --> HealthCheck: Apply Hardening
HealthCheck --> Report: Verify Services
Report --> Notify: Generate Report
Notify --> Complete: Send Alerts

Complete --> [*]: Success
Error --> [*]: Failed
Loading

Component Architecture

Presentation Layer

colors.sh
├── Color definitions
├── Text formatting
├── Progress bars
├── Status indicators
└── UI components

Features:

  • 16 color palette
  • Bold/dim/underline styles
  • Spinner animations
  • Box drawing characters

Logging Layer

logger.sh
├── Log levels (DEBUG|INFO|WARN|ERROR)
├── Timestamp formatting
├── File rotation
├── Console output
└── Error tracking

Features:

  • Structured JSON logs
  • Automatic rotation
  • Log compression
  • Error aggregation

Utility Layer

utils.sh
├── System detection
├── Package management
├── File operations
├── Network utilities
└── Validation functions

50+ Functions:

  • OS detection
  • Version comparison
  • Port checking
  • Service management

Configuration Layer

config.sh
├── Profile loading
├── JSON parsing
├── Environment setup
├── Validation
└── Defaults

Features:

  • Multi-profile support
  • JSON schema validation
  • Environment detection
  • Override system

Security

Multi-Layer Security Architecture

graph TB
subgraph " Network Layer"
A[UFW Firewall]
B[Fail2ban]
end

subgraph " Application Layer"
C[MongoDB Auth]
D[SSH Hardening]
E[Nginx Headers]
end

subgraph " System Layer"
F[Auto Updates]
G[System Limits]
H[Audit Logs]
end

A & B --> C & D & E
C & D & E --> F & G & H
F & G & H --> I[ Secured Server]

style I fill:#51cf66,stroke:#2f9e44,stroke-width:3px,color:#fff
Loading

Security Hardening Applied

Network Security

UFW Firewall Configuration:

# Default policies
ufw default deny incoming
ufw default allow outgoing

# Allowed ports
ufw allow 22/tcp # SSH
ufw allow 80/tcp # HTTP
ufw allow 443/tcp # HTTPS
ufw allow 27017/tcp # MongoDB (localhost only)

# Rate limiting
ufw limit 22/tcp

Fail2ban Protection:

[sshd]
enabled = true
maxretry = 3
findtime = 600
bantime = 3600
Authentication & Access

SSH Hardening:

# /etc/ssh/sshd_config
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
X11Forwarding no
MaxAuthTries 3

MongoDB Authentication:

// Required authentication
security:
authorization: enabled

// Admin user
db.createUser({
user: "admin",
pwd: "[secure-random-password]",
roles: ["userAdminAnyDatabase", "readWriteAnyDatabase"]
})
Web Security Headers

Nginx Security Headers:

# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always;

# HSTS (only with SSL)
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
System Security

Automatic Updates:

# Unattended security updates
apt-get install -y unattended-upgrades
dpkg-reconfigure -plow unattended-upgrades

System Limits:

# /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 32768
* hard nproc 32768

Post-Installation Security Checklist

Task Priority Status
Change default MongoDB password Critical
Setup SSH key authentication Critical
Configure automatic backups High
Enable monitoring & alerting High
Review firewall rules Medium
Test disaster recovery Medium
Setup SSL certificates Critical
Enable audit logging High
View complete security checklist
# Generated at: /var/log/elite-setup/security-checklist.txt
cat /var/log/elite-setup/security-checklist.txt

Recommended Actions:

  1. Change default MongoDB admin password immediately
  2. Setup SSH keys and disable password authentication
  3. Configure automated backups (daily recommended)
  4. Enable monitoring and alerting (Prometheus, Grafana, or similar)
  5. Review firewall rules for your specific needs
  6. Test disaster recovery procedures
  7. Setup email alerts for critical events
  8. Review SSL configuration and certificate renewal

Contributing

Help Us Improve Elite Server Setup!

We welcome contributions from the community!

Getting Started

1. Fork & Clone

# Fork on GitHub, then clone
git clone https://github.com/\
YOUR_USERNAME/elite-server-setup.git

cd elite-server-setup

2. Create Branch

# Create feature branch
git checkout -b feature/amazing-feature

3. Make Changes

# Edit files
nano lib/installer.sh

# Test changes
./quick-test.sh --verbose

4. Commit Changes

# Stage changes
git add .

# Commit with message
git commit -m "Add: Amazing feature"

5. Push & PR

# Push to your fork
git push origin feature/amazing-feature

# Open Pull Request on GitHub

6. Code Review

  • Wait for maintainer review
  • Address feedback
  • Merge when approved!

Contribution Guidelines

Code Standards

Follow existing code style

  • Use 4-space indentation
  • Add comments for complex logic
  • Keep functions under 50 lines
  • Use meaningful variable names

Write tests

  • Add tests for new features
  • Ensure all tests pass
  • Maintain test coverage

Update documentation

  • Update README for new features
  • Add inline code comments
  • Include usage examples

Commit message format

Type: Short description

Longer description if needed

- Bullet points for details
- Reference issues: #123

Types: Add, Fix, Update, Remove, Refactor, Docs, Test

What to Contribute

Bug Fixes

  • Fix reported issues
  • Improve error handling
  • Edge case coverage

New Features

  • Additional installers
  • New configuration options
  • Enhanced security features

Documentation

  • Improve README
  • Add tutorials
  • Fix typos

Tests

  • Add test coverage
  • Integration tests
  • Performance tests

UI/UX

  • Better terminal output
  • Progress indicators
  • Error messages
Development Setup
# Install development dependencies
sudo apt-get install -y shellcheck

# Run linter
shellcheck setup.sh lib/*.sh

# Run validation suite
./quick-test.sh --verbose

# Test in container (recommended)
docker run -it --rm -v $(pwd):/app ubuntu:22.04 bash
cd /app && ./setup.sh --profile=development

License

MIT License

License: MIT

MIT License

Copyright (c) 2025 naveed-gung

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Credits & Acknowledgments

Created by: naveed-gung | Portfolio: naveed-gung.dev

Built With Amazing Open Source Tools


Node.js
JavaScript Runtime

MongoDB
NoSQL Database

Nginx
Web Server

Docker
Containers

Linux
Operating System

Special thanks to:

  • Node.js Foundation - JavaScript runtime excellence
  • MongoDB Inc. - Powerful NoSQL database platform
  • Nginx Team - High-performance web server
  • Unitech - PM2 process management
  • Let's Encrypt / Certbot - Free SSL certificates for everyone
  • Linux Community - Foundation of open source
  • Skill Icons - Beautiful technology icons
  • Open Source Community - For making this possible

Changelog

v1.0.0 (2025-10-12)

Initial Release

  • Full MERN infrastructure automation
  • Multi-OS support (Ubuntu, Debian, CentOS, RHEL)
  • Configuration profiles (development/staging/production)
  • Security hardening suite
  • Health monitoring & reporting
  • Multi-channel notifications (Slack, Discord, Email)
  • Backup & rollback system
  • Professional validation suite
  • Comprehensive documentation
  • Enterprise-grade code quality (3,850+ LOC)
Additional Features Detail

Features

Core Functionality:

  • Full MERN infrastructure automation
  • Multi-OS support (Ubuntu, Debian, CentOS, RHEL)
  • Interactive + non-interactive modes
  • Configuration profiles (dev/staging/prod)

Components:

  • Node.js 20.x LTS installation
  • MongoDB 7.0+ with authentication
  • Nginx with SSL/TLS support
  • PM2 process manager
  • Optional Docker installation

Security:

  • UFW firewall configuration
  • Fail2ban brute-force protection
  • SSH hardening
  • Automatic security updates
  • MongoDB authentication
  • Nginx security headers

Operations:

  • Health monitoring & reporting
  • Multi-channel notifications
  • Backup & rollback system
  • Professional validation suite

Documentation:

  • Comprehensive README
  • Inline code comments
  • Usage examples
  • Troubleshooting guide

Quality:

  • 3,850+ lines of code
  • 85+ validation tests
  • Enterprise-grade architecture
  • Production-ready

Support

Need Help? We're Here!



GitHub Issues
Report bugs or request features

Issues


Documentation
Complete guides & tutorials

Docs


Community
Join our discussions

Discussions


Updates
Follow for latest news

Follow

Show Your Support

If this project helped you, please:

Stars Forks Watchers

Ready to Deploy?

Start with one simple command:

sudo ./setup.sh

Made with passion by naveed-gung | Portfolio: naveed-gung.dev




Project Stats

Repo Size Top Language Last Commit License

Star us on GitHub — it motivates us a lot!

⬆ Back to top

About

Elite Auto Server Setup is an enterprise-grade automation tool that provisions complete MERN infrastructure with zero human intervention. Deploy production-ready servers in minutes, not hours.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •