🐧 Ubuntu VPS (22.04) Setup – Full Guide

This guide will help you set up the old Strange Bot on a fresh Ubuntu 22.04 VPS. It covers installing Node.js, configuring your firewall, and keeping the bot running with PM2.

  1. Update and install required packages
    sudo apt update && sudo apt upgrade -y sudo apt install curl git ufw -y
  2. Install Node.js (LTS) & npm
    curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - sudo apt install -y nodejs
  3. Install Git & Clone the Bot
    sudo apt install git -y git clone https://github.com/saiteja-madha/discord-js-bot.git cd discord-js-bot
  4. Install dependencies
    npm install
  5. Configure Environment

    Rename .env.example to .env and configure:

    • BOT_TOKEN=your_discord_bot_token
    • PREFIX=!
    • OWNER_IDS=your_discord_id
  6. Open Required Ports (Firewall)
    sudo ufw allow OpenSSH sudo ufw allow 80 sudo ufw allow 443 sudo ufw enable

    ✅ This ensures HTTP and HTTPS traffic work if needed.

  7. Run the Bot
    node index.js
  8. Use PM2 to keep the bot online
    sudo npm install -g pm2 pm2 start index.js pm2 save pm2 startup

    🔁 Bot will restart automatically if your VPS reboots.

🔥 Recommended VPS Host

Need a fast, affordable, and beginner-friendly VPS to host your bot? We recommend using:

🌐 Breeze Host – Get Started Now

Affiliate Disclosure: We may earn a small commission if you use our link — it helps support this project!
Disclaimer: This is based off of the US! Others may experience lag etc.

Need help? Join our Discord: https://discord.gg/8zUfpJTst6