This guide covers how to set up the R2D2 SWGOH Discord Bot on a Linux server as a systemd service.
-
Transfer files to your Linux server
-
Make scripts executable
chmod +x setup_linux.sh install_service.sh status.sh
-
Run the setup script
./setup_linux.sh
-
Install as a systemd service
sudo ./install_service.sh
That's it! Your bot should now be running as a systemd service.
- Installs required system packages
- Creates directory structure
- Sets up Python virtual environment
- Installs Python dependencies from requirements.txt
- Configures systemd service file with your username
- Installs the service
- Enables it to start on boot
- Starts the service
- Shows if the bot is running
- Displays basic system resource usage
- Shows recent errors (if any)
sudo systemctl status r2d2botsudo journalctl -u r2d2bot -fsudo systemctl restart r2d2botsudo systemctl stop r2d2botCheck the logs for errors:
sudo journalctl -u r2d2bot -eIf you need to update your bot files:
- Copy new files to ~/R2D2_Bot/
- Restart the service:
sudo systemctl restart r2d2bot
If you need to update Python packages:
cd ~/R2D2_Bot
source venv/bin/activate
pip install -r requirements.txt
sudo systemctl restart r2d2bot- Bot files: ~/R2D2_Bot/
- Virtual environment: ~/R2D2_Bot/venv/
- Service file: /etc/systemd/system/r2d2bot.service
- Logs: Access with
sudo journalctl -u r2d2bot
Created on June 15, 2025