Starting the Bot
With your configuration file in place, you are ready to start iHorizon.
Starting iHorizon
Run the following command from the root of the project directory:
The bot should now come online in your Discord server. If you run into any problems at this stage, check the Common Issues page.
Keeping the Bot Running with pm2
By default, the bot will stop running as soon as you close your terminal session. To keep it running in the background continuously, including after system reboots, you can use pm2, a process manager for Node.js applications.
1. Install Node.js
pm2 relies on Node.js, so install it first. On a Debian-based Linux distribution:
Alternative installation methods are available on the official Node.js website.
2. Install pm2
Verify the installation was successful by checking the version:
If a version number is displayed, pm2 is ready to use.
3. Start iHorizon with pm2
# Start the bot
pm2 start . --name "iHorizon" --interpreter ~/.bun/bin/bun
# Save the current pm2 process list
pm2 save
# Enable pm2 to start automatically on system boot
pm2 startup
# Follow the instructions displayed on screen
The
--interpreter ~/.bun/bin/bunflag is required when using Bun. See the Bun documentation and pm2 CLI reference for more details.
Your bot is now running as a background service and will restart automatically if your server reboots.