View GitHub Repository (optional)
Browse the full source code, issues, and updates on GitHub
🚀 Prerequisites
Before you begin, make sure you have the following installed and ready:- Node.js (version 18 or newer) – Download Node.js
- A valid FNLB API Token – required to authenticate with FNLB services. Learn more.
- (Optional) Bun – A fast JavaScript runtime that can be used as an alternative to Node.js
📦 Installation Steps
Follow these steps to get your FNLB cluster up and running:1
Clone the Repository
Download or clone the FNLB self-hosting project to your local machine:
Alternatively, you can manually copy the files into a folder or download the source code as a ZIP.
2
Install Dependencies
Install required packages with your preferred runtime:
-
Using Node.js:
-
Using Bun:
3
Configure Environment Variables
Rename the Edit the
.env.example file to .env:.env file with your actual values:API Token: Get this from your FNLB Account under “API Tokens”.
Category IDs: Visit the FNLB Bots Page, select a bot, and locate the “Category ID” in the “About this bot” section.
▶️ Running the FNLB Cluster
Once configured, start your FNLB instance:-
With Node.js:
-
With Bun:
🌐 Environment Variable Reference
Below is a breakdown of each environment variable used in the setup:| Variable | Description | Default |
|---|---|---|
API_TOKEN | Your personal FNLB API token | Required |
CATEGORIES | Comma-separated list of bot category IDs | Required |
NUMBER_OF_SHARDS | Number of individual shards (instances) to spawn | 2 |
BOTS_PER_SHARD | Maximum number of bots assigned to each shard | 32 |
RESTART_INTERVAL | Cluster restart interval in seconds (for stability/maintenance) | 3600 |
CLUSTER_NAME | The name of the cluster that will appear in the app | Self Hosted Cluster |
🔄 Keeping FNLB Up to Date
Ensure you’re always using the latest and most stable version of FNLB:1
Pull the latest changes from the Git repository
2
Update dependencies
-
With Node.js:
-
With Bun:
3
Restart the cluster to apply changes
Regular updates provide access to new features, performance boosts, and essential bug fixes.
⚙️ What the Script Does
Once started, the script performs the following:- Initializes FNLB using your API credentials and environment settings
- Configures:
- Number of shards (isolated bot processes)
- Maximum bots per shard
- Allowed category IDs
- Implements automatic restarts for resilience, using the configured time interval
📎 Additional Resources
🗨️ Join the Community
Need help, support, or just want to chat with other developers? Come hang out with us on Discord! 👇Join Discord
Get help, support, or chat with other developers

