Manual Linux Installation (Advanced)

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

Auto Installation (Recommended)

The fastest and safest way to install or upgrade the bot on a Linux VPS (Ubuntu/Debian, CentOS) is using our auto-installer script. Just copy and paste this single command into your SSH terminal. It automatically handles backups, dependencies, and firewall configuration.

curl -sL https://raw.githubusercontent.com/prime-trading-bot/prime-spot-grid-trading-bot/main/Grid_install.sh | sudo bash

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 8764 is completely free before installation.

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

3. Download & Extract Bot Files

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

cd /opt/Prime-Spot-Grid-Trading-Bot
sudo curl -L -o Grid_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 Grid_server_v5.tar.xz -C server --strip-components=1

# Clean up the compressed file
sudo rm -f Grid_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-Grid-Trading-Bot/server/GridServer.bin
sudo chown -R ubuntu:ubuntu /opt/Prime-Spot-Grid-Trading-Bot
    

5. Configure Firewall (UFW)

Grid Bot uses port 8764 for WebSocket communication.

sudo ufw allow 22/tcp
sudo ufw allow 8764/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/primespotgrid.service

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

[Unit]
Description=Prime Spot Grid 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-Grid-Trading-Bot/server
ExecStart=/opt/Prime-Spot-Grid-Trading-Bot/server/GridServer.bin
Restart=always
RestartSec=5
StandardOutput=append:/opt/Prime-Spot-Grid-Trading-Bot/server/server.log
StandardError=append:/opt/Prime-Spot-Grid-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 primespotgrid
sudo systemctl restart primespotgrid
    

8. Verify

Check if the bot is running properly:

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