Manual Linux Installation (Advanced)

Note: This guide replicates what our Auto-Installer does manually. We use the standard path /opt/Prime-Spot-DCA-Trading-Bot.

1. Update System & Install Dependencies

The bot requires tar and xz-utils for extraction, and psmisc to manage port conflicts.

sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y ufw curl tar xz-utils psmisc
    

2. Prepare Directory & Clean Old Processes

Create the base directory, stop any existing service, and ensure port 8765 is completely free before installation.

sudo mkdir -p /opt/Prime-Spot-DCA-Trading-Bot
sudo systemctl stop primespotdca 2>/dev/null || true
sudo fuser -k -9 8765/tcp >/dev/null 2>&1 || true
    

3. Download & Extract Bot Files

Download the latest standalone archive (e.g., server_v5.tar.xz), extract it into a server sub-folder, and clean up the archive.

cd /opt/Prime-Spot-DCA-Trading-Bot
sudo curl -L -o server_v5.tar.xz "YOUR_DOWNLOAD_LINK_HERE"

# Remove any old version and create a fresh directory
sudo rm -rf server
sudo mkdir -p server

# Extract and strip the first container folder
sudo tar -xf server_v5.tar.xz -C server --strip-components=1

# Clean up the compressed file
sudo rm -f server_v5.tar.xz
    

4. Set Permissions

Ensure the extracted binary is executable and ownership is correctly assigned (replace ubuntu with your actual username if different).

sudo chmod +x /opt/Prime-Spot-DCA-Trading-Bot/server/server.bin
sudo chown -R ubuntu:ubuntu /opt/Prime-Spot-DCA-Trading-Bot
    

5. Configure Firewall (UFW)

sudo ufw allow 22/tcp
sudo ufw allow 8765/tcp
sudo ufw enable
    

6. Create Systemd Service

Create the service file to keep the bot running in the background:

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

Paste this content (ensure it points directly to the server folder):

[Unit]
Description=Prime Spot DCA Trading Bot Server
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
# Change User= to your specific non-root user (e.g., ubuntu)
User=ubuntu
WorkingDirectory=/opt/Prime-Spot-DCA-Trading-Bot/server
ExecStart=/opt/Prime-Spot-DCA-Trading-Bot/server/server.bin
Restart=always
RestartSec=5
StandardOutput=append:/opt/Prime-Spot-DCA-Trading-Bot/server/server.log
StandardError=append:/opt/Prime-Spot-DCA-Trading-Bot/server/server.error.log
NoNewPrivileges=true

[Install]
WantedBy=multi-user.target
    

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

7. Start the Service

sudo systemctl daemon-reload
sudo systemctl enable primespotdca
sudo systemctl restart primespotdca
    

8. Verify

Check if the bot is running properly:

sudo systemctl status primespotdca
Tip: To view the live output of your bot, you can tail the log file:
tail -f /opt/Prime-Spot-DCA-Trading-Bot/server/server.log