Created
November 16, 2025 10:18
-
-
Save drhema/307162343628c50dcbaf531d2652bfd9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Colors | |
| GREEN='\033[0;32m' | |
| YELLOW='\033[1;33m' | |
| NC='\033[0m' | |
| echo -e "${GREEN}=== Starting Proxmox Installation on Debian 12 ===${NC}" | |
| # Set hostname | |
| echo -e "${YELLOW}Setting hostname...${NC}" | |
| hostnamectl set-hostname prox.yourdomain.com | |
| echo "94.130.137.39 prox.yourdomain.com prox" >> /etc/hosts | |
| # Add Proxmox repository | |
| echo -e "${YELLOW}Adding Proxmox repositories...${NC}" | |
| wget https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg \ | |
| -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg | |
| echo "deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription" \ | |
| > /etc/apt/sources.list.d/pve-install-repo.list | |
| # Update and install Proxmox | |
| echo -e "${YELLOW}Installing Proxmox VE...${NC}" | |
| apt update && apt full-upgrade -y | |
| DEBIAN_FRONTEND=noninteractive apt install -y proxmox-ve postfix open-iscsi chrony | |
| # Remove Debian kernel | |
| apt remove -y linux-image-amd64 'linux-image-6.1*' | |
| update-grub | |
| # Remove enterprise repository | |
| rm -f /etc/apt/sources.list.d/pve-enterprise.list | |
| # Optimize for NVMe Gen 4 | |
| echo -e "${YELLOW}Optimizing for NVMe Gen 4...${NC}" | |
| cat >> /etc/sysctl.conf << EOF | |
| # NVMe Optimization | |
| vm.swappiness=10 | |
| vm.dirty_ratio=15 | |
| vm.dirty_background_ratio=5 | |
| vm.vfs_cache_pressure=50 | |
| EOF | |
| sysctl -p | |
| # Configure firewall | |
| echo -e "${YELLOW}Configuring firewall...${NC}" | |
| ufw allow 22/tcp | |
| ufw allow 8006/tcp | |
| ufw allow 6789/tcp | |
| echo "y" | ufw enable | |
| echo -e "${GREEN}=== Installation Complete! ===${NC}" | |
| echo -e "${GREEN}Rebooting in 10 seconds...${NC}" | |
| echo -e "${GREEN}Access Proxmox at: https://94.130.137.39:8006${NC}" | |
| echo -e "${YELLOW}Username: root${NC}" | |
| echo -e "${YELLOW}Password: Your NEW root password${NC}" | |
| sleep 10 | |
| reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment