Choose Your Language
- Node.js
- Python
1
Install Node.js
Add the NodeSource repository and install Node.js 20:
2
Upload or clone your bot files
You can upload files using the File Manager in the Opus Host panel, transfer them with SCP, or clone directly from GitHub:
3
Install dependencies
4
Test the bot
Run the bot once to make sure it connects and responds correctly before setting it up as a background service:Press Ctrl + C to stop it when you’re ready to move on.
Keep Your Bot Running with PM2 (Node.js)
PM2 is a process manager for Node.js applications. It restarts your bot automatically if it crashes and can start it on system boot.1
Install PM2 globally
2
Start your bot with PM2
3
Enable auto-start on reboot
Generate and apply the startup hook so PM2 and your bot survive a server restart:Run the command that
pm2 startup prints (it will look like sudo env PATH=... pm2 startup systemd -u root --hp /root).4
Monitor your bot
Check the current status of all PM2 processes:Tail the live logs for your bot:
Keep Your Bot Running with systemd (Python or Node.js)
systemd is built into every modern Linux system and is a great choice if you prefer not to install PM2, or if your bot is written in Python. Create a service unit file at/etc/systemd/system/mybot.service:
ExecStart to /usr/bin/node /root/mybot/index.js.
Then enable and start the service:
