How to Install and Run the Prime Spot DCA Trading Bot on Any Linux Server

Requirements

Update the system

sudo apt-get update && sudo apt-get upgrade -y

Configure firewall (UFW)

sudo apt-get install -y ufw
sudo ufw allow 22/tcp      # allow SSH
sudo ufw allow 8765/tcp    # allow client-to-bot communication
sudo ufw --force enable
    

Fix ownership and permissions

chmod +x /home/ubuntu/server.bin
sudo chown ubuntu:ubuntu /home/ubuntu/server.bin /home/ubuntu/license.enc
    

Create a systemd service

Create the service file:

sudo nano /etc/systemd/system/trading_bot.service

Paste this:

[Unit]
Description=Prime Trading Bot
After=network.target

[Service]
User=ubuntu
WorkingDirectory=/home/ubuntu
ExecStart=/home/ubuntu/server.bin
Restart=always
RestartSec=10
StandardOutput=append:/home/ubuntu/trading_bot.log
StandardError=append:/home/ubuntu/trading_bot.err

[Install]
WantedBy=multi-user.target
    

Save and exit (Ctrl+O, Enter, Ctrl+X).

Enable and start the service

sudo systemctl daemon-reload
sudo systemctl enable trading_bot.service
sudo systemctl start trading_bot.service
    

Check if the bot is running

systemctl status trading_bot.service

You should see active (running) if it started successfully.

View bot logs

tail -f /home/ubuntu/trading_bot.log
# For errors:
tail -f /home/ubuntu/trading_bot.err
    

Manage the bot service

Connect from the Client