Running BozoBot 24/7 AFK
To maximize your trading opportunities, you'll likely want to run BozoBot continuously in the background. This guide provides detailed instructions for running BozoBot 24/7 on various operating systems.
Preparation
Before setting up continuous operation, ensure:
- Your bot is correctly configured in the
.env
file - You've tested the bot manually to confirm it works as expected
- Your system has a stable internet connection
- You have sufficient SOL in your wallet for trading and transaction fees
Linux Setup
Linux is the recommended platform for running BozoBot 24/7 due to its stability and efficient resource usage.
Using Systemd (Recommended)
Systemd is the modern service manager for most Linux distributions and provides the most reliable way to run BozoBot as a background service.
- Create a systemd service file:
sudo nano /etc/systemd/system/bozobot.service
- Add the following configuration (adjust paths as needed):
[Unit]
Description=BozoBot Trading Bot
After=network.target
[Service]
User=YOUR_USERNAME
WorkingDirectory=/path/to/bozobot
ExecStart=/path/to/bozobot/bozobot
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
-
Save the file (Ctrl+O, Enter, Ctrl+X)
-
Enable and start the service:
sudo systemctl enable bozobot
sudo systemctl start bozobot
- Check status and logs:
# Check service status
sudo systemctl status bozobot
# View logs in real-time
sudo journalctl -fu bozobot --output cat
- To stop the bot:
sudo systemctl stop bozobot
Using Screen
If you prefer not to use systemd, the screen
utility is a good alternative:
- Install screen if not already installed:
sudo apt install screen # For Ubuntu/Debian
sudo yum install screen # For CentOS/RHEL
- Start a new screen session:
screen -S bozobot
- Navigate to your BozoBot directory and start the bot:
cd /path/to/bozobot
./bozobot
-
Detach from the screen session (the bot will continue running):
- Press
Ctrl+A
thenD
- Press
-
To reattach to the screen session later:
screen -r bozobot
Using Nohup
For a simpler approach, you can use nohup
:
cd /path/to/bozobot
nohup ./bozobot > bozobot.log 2>&1 &
This will run BozoBot in the background, writing output to bozobot.log
. To stop the bot, find its process ID and kill it:
ps aux | grep bozobot
kill -9 PROCESS_ID
macOS Setup
Using LaunchAgents
- Create a LaunchAgent plist file:
nano ~/Library/LaunchAgents/com.user.bozobot.plist
- Add the following configuration (adjust paths as needed):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.bozobot</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/bozobot/bozobot</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>WorkingDirectory</key>
<string>/path/to/bozobot</string>
<key>StandardOutPath</key>
<string>/path/to/bozobot/bozobot.log</string>
<key>StandardErrorPath</key>
<string>/path/to/bozobot/bozobot-error.log</string>
</dict>
</plist>
- Load the LaunchAgent:
launchctl load ~/Library/LaunchAgents/com.user.bozobot.plist
- To start/stop the bot:
# Start
launchctl start com.user.bozobot
# Stop
launchctl stop com.user.bozobot
# Unload (remove from auto-start)
launchctl unload ~/Library/LaunchAgents/com.user.bozobot.plist
Using Terminal with Screen
macOS also supports the screen
utility, similar to Linux:
- Install screen via Homebrew if not already installed:
brew install screen
- Then follow the same screen instructions as in the Linux section.
Windows Setup
Using Task Scheduler
-
Open Task Scheduler (search for it in the Start menu)
-
Click "Create Basic Task" in the right panel
-
Enter a name (e.g., "BozoBot") and description, then click "Next"
-
Select "When the computer starts" and click "Next"
-
Select "Start a program" and click "Next"
-
Browse to select your BozoBot executable, and set "Start in" to your BozoBot directory
-
Click "Next" and then "Finish"
-
Right-click on your new task and select "Properties"
-
Check "Run with highest privileges" and set "Configure for:" to your Windows version
-
On the "Settings" tab, uncheck "Stop the task if it runs longer than:"
-
Click "OK" to save changes
Using Windows Terminal
For shorter sessions or testing:
-
Open Command Prompt or PowerShell
-
Navigate to your BozoBot directory:
cd C:\path\to\bozobot
- Start the bot:
start /B bozobot.exe > bozobot.log 2>&1
Cloud Server Setup
For maximum uptime and reliability, consider running BozoBot on a cloud server:
VPS Recommendations
- CPU: 1-2 cores
- RAM: 2GB minimum
- Disk: 20GB SSD
- OS: Ubuntu 20.04/22.04 LTS
Popular VPS providers include DigitalOcean, Linode, AWS Lightsail, and Vultr.
Setup Process
-
Create and configure your VPS
-
Upload BozoBot to the server (using SCP or SFTP):
scp -r /path/to/local/bozobot username@server_ip:~/bozobot
- SSH into your server:
ssh username@server_ip
- Follow the Linux setup instructions above
Monitoring and Maintenance
Log Rotation
For long-running instances, set up log rotation to prevent log files from growing too large:
- Create a logrotate configuration:
sudo nano /etc/logrotate.d/bozobot
- Add the following configuration:
/path/to/bozobot/*.log {
daily
missingok
rotate 7
compress
delaycompress
notifempty
create 0640 YOUR_USERNAME YOUR_USERNAME
}
Remote Monitoring
Consider setting up remote monitoring in addition to Telegram PnL notifications:
- Set up a health check endpoint (if you have web server experience)
- Use a service like UptimeRobot to monitor connectivity
- Configure email alerts for server issues
Troubleshooting
Bot Crashes or Stops Running
If the bot stops unexpectedly:
- Check the logs for error messages
- Ensure your wallet has sufficient SOL
- Verify your RPC endpoints are accessible
- Make sure your system isn't running out of resources
System Reboots
After system reboots:
- For systemd (Linux): The bot should restart automatically
- For LaunchAgents (macOS): The bot should restart automatically
- For Task Scheduler (Windows): Verify the task is set to run at startup
- For manual methods (screen/nohup): You'll need to restart the bot manually
Security Considerations
Running a trading bot 24/7 involves significant security considerations:
- Private Key Security: Never run the bot on shared or untrusted systems
- System Updates: Regularly update your operating system and security packages
- Firewall Configuration: Limit inbound connections to your server
- User Permissions: Run the bot under a dedicated user with limited permissions
- Backup: Regularly backup your configuration files