Skip to content

Instantly share code, notes, and snippets.

@yuuslokrobjakkroval
Last active February 12, 2026 04:13
Show Gist options
  • Select an option

  • Save yuuslokrobjakkroval/29b7eaba3ddc88333b877ff0160a217c to your computer and use it in GitHub Desktop.

Select an option

Save yuuslokrobjakkroval/29b7eaba3ddc88333b877ff0160a217c to your computer and use it in GitHub Desktop.

πŸš€ Peachy Gang Deployment Guide

This guide explains how to deploy the PeachyGang website and dashboard on a Linux VPS using Node.js v20, MongoDB, PM2, Nginx, Nano and SSL via Let's Encrypt.


🌐 Domain Setup

Make sure peachyganggg.com and api.peachyganggg.com both point to your VPS IP via A records.


βš™οΈ 1. Initial Setup

sudo apt update && sudo apt upgrade -y
sudo apt install -y git curl build-essential ufw nginx nano

🟒 2. Install Node.js v20 and PM2

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
npm install -g pm2

πŸƒ 3. Install MongoDB (local)

curl -fsSL https://pgp.mongodb.com/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor
echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -sc)/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
sudo apt update
sudo apt install -y mongodb-org
sudo systemctl start mongod
sudo systemctl enable mongod

πŸ”₯ 4. Clone and Deploy Backend (NestJS)

cd /var/www
git clone https://github.com/yuuslokrobjakkroval/peachy-dashboard-backend.git
cd peachy-dashboard-backend
nano .env

Paste:

BOT_TOKEN=...
BOT_CLIENT_ID=1342317947573633077
BOT_CLIENT_SECRET=...
MONGODB_URI=mongodb://localhost:27017/peachy
PORT=8080
PRODUCTION=true
WEB_URL=https://peachyganggg.com
API_ENDPOINT=https://discord.com/api/v10
npm install
npm run build
pm2 start dist/main.js --name peachy-backend
pm2 save

πŸ’– 5. Clone and Deploy Frontend (Next.js)

cd /var/www
git clone https://github.com/yuuslokrobjakkroval/peachy-gang.git
cd peachy-gang
nano .env

Paste:

APP_URL=https://peachyganggg.com
NEXT_PUBLIC_API_ENDPOINT=https://api.peachyganggg.com
BOT_CLIENT_ID=1342317947573633077
BOT_CLIENT_SECRET=...
npm install
npm run build
pm2 start "npm run start" --name peachy-frontend
pm2 save

🌐 6. Configure Nginx Reverse Proxy

sudo nano /etc/nginx/sites-available/peachygang

Paste:

server {
    listen 80;
    server_name peachyganggg.com;

    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_cache_bypass $http_upgrade;
    }
}

server {
    listen 80;
    server_name api.peachyganggg.com;

    location / {
        proxy_pass http://localhost:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}
sudo ln -s /etc/nginx/sites-available/peachygang /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx

πŸ” 7. Install SSL with Let's Encrypt

sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d peachyganggg.com -d api.peachyganggg.com

πŸ” 8. Auto Renew SSL

sudo certbot renew --dry-run

βœ… 9. Check Everything

pm2 ls
sudo systemctl status nginx
sudo ufw status

βœ… 10. Open Firewall Ports

sudo ufw allow OpenSSH
sudo ufw allow 80
sudo ufw allow 443
sudo ufw enable

πŸŽ‰ Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment