Skip to content

Instantly share code, notes, and snippets.

@mhtamun
Created June 4, 2025 20:00
Show Gist options
  • Save mhtamun/d3fb24536de3eebb086ad6d6f7142a26 to your computer and use it in GitHub Desktop.
Save mhtamun/d3fb24536de3eebb086ad6d6f7142a26 to your computer and use it in GitHub Desktop.
πŸš€ Ubuntu 24.04 LTS Setup Script
#!/bin/bash
# === Variables ===
SSH_PORT=22
# === System Update and Basic Tools ===
apt update && apt upgrade -y
apt install -y bash-completion curl wget git nano net-tools telnet ufw ca-certificates gnupg lsb-release
# === Firewall Configuration ===
ufw allow "$SSH_PORT"/tcp
ufw allow 80/tcp # HTTP
ufw allow 443/tcp # HTTPS
ufw allow 81/tcp # Nginx Proxy Manager Admin UI
ufw --force enable
# === Install Docker using the official convenience script ===
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
# === Install Docker Compose Plugin ===
apt install -y docker-compose-plugin
# === Install Node.js via NVM ===
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
export NVM_DIR="$HOME/.nvm"
source "$NVM_DIR/nvm.sh"
nvm install --lts
node -v
npm -v
npm install -g yarn nodemon pm2
# === Deploy Nginx Proxy Manager ===
mkdir -p /opt/nginx-proxy-manager && cd /opt/nginx-proxy-manager
cat <<EOF > docker-compose.yml
version: '3'
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80' # HTTP
- '443:443' # HTTPS
- '81:81' # Admin UI
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
EOF
docker compose up -d
# === Completion Message ===
echo "Setup complete. Access Nginx Proxy Manager at http://<your-server-ip>:81"
echo "Default credentials: [email protected] / changeme"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment