01 Prerequisites & Ubuntu Package Updates
Initial Setup

SSH into your Ubuntu server (DigitalOcean, Hetzner, AWS EC2, or bare-metal), update package indices, and install Git, Curl, Make, and Docker.

bash — terminal
# 1. Update Ubuntu repository lists and install base utilities
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y git curl wget make ufw

# 2. Install official Docker Engine and Docker Compose Plugin
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER

# 3. Reload group session without logging out
newgrp docker
02 Clone Repository & Configure Environment
Configuration

Clone the project into /opt/isight or your user directory, copy the example environment template, and insert your Telegram Bot credentials.

bash — terminal
# 1. Clone repository to your Ubuntu server
git clone https://github.com/your-org/isight.git /opt/isight
cd /opt/isight

# 2. Create your .env file from template
cp .env.example .env

# 3. Edit environment variables (Nano or Vim)
nano .env
💡
Essential Environment Variables: Set TELEGRAM_BOT_TOKEN (from @BotFather), TELEGRAM_CHAT_ID (from @userinfobot), and GEMINI_API_KEY (from Google AI Studio) to enable unified Sensei BotFather auto-provisioning and AI-backed market analysis.
03 One-Command Orchestration (Make & Docker)
Execution

Use the included Makefile to build and start both the Nginx Alpine static web server and the Node.js background bot daemon in detached mode.

bash — terminal
# Build images and start all containers on port 8080
make up

# Verify running status and port bindings
make status

# Send a verification signal to your Telegram channel
make test-telegram

# Tail live bot signals and calculations
make logs-bot
04 Firewall (UFW) & Domain SSL Certificate (Certbot)
Production Security

Lock down unnecessary ports with UFW and provision a free Let's Encrypt TLS/SSL certificate with automatic renewal for your domain (e.g. trade.isight.trade).

bash — terminal
# 1. Configure Ubuntu UFW Firewall
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22/tcp    # SSH
sudo ufw allow 80/tcp    # HTTP
sudo ufw allow 443/tcp   # HTTPS
sudo ufw allow 8080/tcp  # iSight Docker Port (or route via 443 reverse proxy)
sudo ufw enable

# 2. Install Certbot for TLS encryption
sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot --nginx -d trade.yourdomain.com
01 Google Cloud Console OAuth 2.0 Credentials
Google Cloud Setup

Set up an OAuth 2.0 Client ID in the Google Cloud Console scoped exclusively to your organization's Google Workspace domain (e.g. isight.trade).

🔐
Authorized Redirect URI: Set callback URL in Google Cloud Console to: https://trade.yourdomain.com/oauth2/callback
bash — terminal
# Generate a 32-byte Cookie Secret for oauth2-proxy
python3 -c 'import os,base64; print(base64.b64encode(os.urandom(32)).decode())'

# Add to your .env file:
GOOGLE_CLIENT_ID="123456789-abcdef.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET="GOCSPX-xxxxxxxxxxxxxxxx"
OAUTH2_PROXY_COOKIE_SECRET="your-generated-cookie-secret"
GOOGLE_WORKSPACE_HD="isight.trade"
02 Deploy Google OAuth Proxy Container Stack
Automated Deployment

Run the specialized Google OAuth target. This starts Nginx with auth_request proxying against oauth2-proxy, enforcing Google Workspace domain login and Authenticator 2FA.

bash — terminal
# Start the Google OAuth protected stack
make up-google

# Check proxy authentication container logs
docker compose -f docker-compose.google-auth.yml logs -f auth-proxy
01 Automated Bare-Metal Shell Script (`deploy.sh`)
No Docker Required

For environments without Docker, run the included server/deploy.sh script. It automatically provisions Node.js 20 LTS, sets up Nginx at /var/www/isight, installs PM2, and configures reverse proxies.

bash — terminal
# 1. Run the automated Ubuntu bare-metal deployer
cd /opt/isight
chmod +x server/deploy.sh
sudo ./server/deploy.sh

# 2. Start the Telegram Bot Daemon under PM2 (auto-restart on crash)
sudo pm2 start server/bot-daemon.js --name "isight-bot"
sudo pm2 save
sudo pm2 startup
📚 Setup Reference Documents & Configuration Vault
16 Reference Files

All configuration files, blueprint guides, Nginx server blocks, and orchestration templates have been consolidated into docs/setup-reference/ for instant offline access and audit compliance.

⚙️ Interactive Ubuntu Command Generator

Live Reactive Preview
Tailored Deploy Command
# Customized Deployment Command for Ubuntu
sudo mkdir -p /opt/isight && cd /opt/isight
git clone https://github.com/your-org/isight.git .
cp .env.example .env
make up
sudo ufw allow 8080/tcp
echo "✅ Terminal active on http://trade.isight.trade:8080"