/opt/Prime-Spot-Grid-Trading-Bot.
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
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
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
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
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
Grid Bot uses port 8764 for WebSocket communication.
sudo ufw allow 22/tcp
sudo ufw allow 8764/tcp
sudo ufw enable
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).
sudo systemctl daemon-reload
sudo systemctl enable primespotgrid
sudo systemctl restart primespotgrid
Check if the bot is running properly:
sudo systemctl status primespotgrid
tail -f /opt/Prime-Spot-Grid-Trading-Bot/server/server.log