Install
Self-hosted Flex Tracker.
Flex Tracker is designed as a self-hosted project. You run it on your own machine or VPS. This page walks you through setup for Linux (pm2) and Windows.
What you need
- Node.js (LTS)
- A Discord bot token (Discord Developer Portal)
- A Riot API key (if your bot uses Riot endpoints)
- A machine to run it (Linux server/VPS recommended)
Beginner note
Self-hosting means: your bot is one program running on one machine. Every Discord server your bot is in will send events to that same running process.
Recommended
Use Linux + pm2 so the bot stays online and restarts automatically after crashes/reboots.
Where to host
You can run Flex Tracker on a homelab or VPS. For public or always-on usage, a VPS is the most stable option.
Linux setup (pm2)
1) Clone the repo
Run in a folder where you want the bot to live.
git clone https://github.com/knubgod/flextrackerbot.git
cd flextrackerbot
2) Install dependencies
npm install
3) Create your environment file
Create a .env file in the project root. Put your tokens/keys there.
# Example .env (names may differ in your project)
DISCORD_TOKEN=your_discord_bot_token
RIOT_API_KEY=your_riot_api_key
4) Run it once to verify
node .
If it logs in successfully, stop it with CTRL + C.
5) Install pm2 (global) + start
npm install -g pm2
pm2 start . --name flex-tracker
pm2 logs flex-tracker
6) Enable auto-start on reboot
pm2 save
pm2 startup
The last command prints one more command — copy/paste that one too (it sets up your system service).
Windows setup (two options)
Option A: pm2 on Windows (similar workflow)
Works fine on Windows, and keeps your workflow consistent with Linux.
# In PowerShell / Terminal
git clone https://github.com/knubgod/flextrackerbot.git
cd flextrackerbot
npm install
# create .env in the folder (same as Linux)
npm install -g pm2
pm2 start . --name flex-tracker
pm2 logs flex-tracker
Note: Windows auto-start with pm2 is less “native” than Linux. If you want reliable auto-start, use Option B.
Option B: Windows Task Scheduler (native auto-start)
This runs your bot at login or at startup automatically.
- Open Task Scheduler
- Click Create Task
- Triggers → “At startup” (or “At log on”)
- Actions → “Start a program”
- Program/script: node
- Start in: your project folder path
- Arguments: the entry file or . depending on your project
This is the most Windows-reliable way to keep the bot always running.
Windows note
If you close the terminal and you aren’t using pm2 or Task Scheduler, the bot will stop. “Always-on” needs a process manager or scheduled task.