Hetzner Server Operations Guide
Hetzner Server Operations Guide
Section titled “Hetzner Server Operations Guide”Complete guide to managing the iSu Technologies Hetzner VPS server.
🖥️ Server Information
Section titled “🖥️ Server Information”Server Details
Section titled “Server Details”- Provider: Hetzner
- IP Address:
46.224.40.5 - Operating System: Ubuntu 22.04 LTS
- SSH Access:
ssh root@46.224.40.5 - Server Name: iSu Technologies Production Server
Hosted Applications
Section titled “Hosted Applications”Total: 14 Applications
- sansa.isutech.co.za - SANSA Educator Platform (Vision 2030) - Frontend (PM2) + Backend (systemd)
- tumi.isutech.co.za - Tumi Mentorship Platform - Frontend (nginx) + Backend (systemd)
- sace.isutech.co.za - SACE Provider Intelligence System - Frontend (systemd) + Backend (systemd)
- prospectiq - ProspectIQ Lead Management - 5 systemd services (frontend, api, celery, celery-beat, worker)
- thrivesend - ThriveSend B2B2G Platform - Full-stack Next.js (PM2)
- umdoni.gov.za - Umdoni Municipality Website - PHP/nginx
- docs.isutech.co.za - Documentation Hub - MkDocs Material (nginx static)
- isutech.co.za - iSuTech Corporate Site - Frontend + Backend + Web (nginx + PM2)
- nhlanhla.isutech.co.za - Portfolio Website - Static site (nginx)
- monitor.isutech.co.za - iSu Monitor - Monitoring dashboard
- AutoSlip - Receipt Automation Service - Systemd service
- MatchMind - Football Prediction Platform - Development (stopped)
🔐 Access & Authentication
Section titled “🔐 Access & Authentication”SSH Access
Section titled “SSH Access”# Connect to serverssh root@46.224.40.5
# First time connection# You'll be prompted to accept the server's fingerprint# Type "yes" to continueUser Management
Section titled “User Management”# Current userwhoami
# List all userscat /etc/passwd
# Add new user (if needed)sudo useradd -m -s /bin/bash username
# Set password for usersudo passwd username
# Add user to sudo groupsudo usermod -aG sudo username🔑 SSH Key Setup for New Team Members
Section titled “🔑 SSH Key Setup for New Team Members”This section guides new team members through setting up SSH key access to the Hetzner server.
Step 1: Check for Existing SSH Key
Section titled “Step 1: Check for Existing SSH Key”On macOS/Linux:
ls -la ~/.ssh/On Windows (PowerShell):
ls ~/.ssh/- If you see
id_ed25519orid_rsafiles, skip to Step 3 - If you get “No such file” or no key files, continue to Step 2
Step 2: Generate SSH Key (if needed)
Section titled “Step 2: Generate SSH Key (if needed)”On macOS/Linux:
ssh-keygen -t ed25519 -C "your.email@isutech.co.za"On Windows (PowerShell):
ssh-keygen -t ed25519 -C "your.email@isutech.co.za"- Press Enter to accept default location (
~/.ssh/id_ed25519) - Press Enter twice for no passphrase (or set one for extra security)
Step 3: Display Your Public Key
Section titled “Step 3: Display Your Public Key”On macOS/Linux:
cat ~/.ssh/id_ed25519.pubOn Windows (PowerShell):
Get-Content ~/.ssh/id_ed25519.pubCopy the entire output - it starts with ssh-ed25519...
Step 4: Add Key to Server
Section titled “Step 4: Add Key to Server”Option A: Ask a team member with access Send your public key to a team member who already has server access. They will run:
ssh root@46.224.40.5echo 'YOUR_PUBLIC_KEY_HERE' >> ~/.ssh/authorized_keysexitOption B: Use root password (if you have it)
ssh root@46.224.40.5# Enter password when promptedecho 'YOUR_PUBLIC_KEY_HERE' >> ~/.ssh/authorized_keysexitStep 5: Test Connection
Section titled “Step 5: Test Connection”ssh root@46.224.40.5You should connect without being asked for a password.
Resetting Root Password (Admin Only)
Section titled “Resetting Root Password (Admin Only)”If you need the root password and don’t have SSH key access:
- Log into Hetzner Cloud Console
- Select the server (
autoslip-prod-01/46.224.40.5) - Go to Rescue tab
- Click “Reset Root Password” (under ROOT PASSWORD section)
- The new password will be displayed on screen
- Use this password to SSH in and add your SSH key
- Consider resetting the password again after setup for security
Managing Authorized Keys
Section titled “Managing Authorized Keys”View current authorized keys:
cat ~/.ssh/authorized_keysAdd a new key:
echo 'ssh-ed25519 AAAAC3... user@email.com' >> ~/.ssh/authorized_keysRemove a key:
# Edit the file and remove the line containing the keynano ~/.ssh/authorized_keysTroubleshooting SSH Issues
Section titled “Troubleshooting SSH Issues”| Problem | Solution |
|---|---|
| ”Permission denied (publickey)“ | Your public key isn’t on the server - ask a team member to add it |
| ”Connection refused” | Server may be down or SSH service not running |
| ”Connection timed out” | Network issue or firewall blocking port 22 |
| ”Host key verification failed” | Server was reinstalled - remove old key with ssh-keygen -R 46.224.40.5 |
📂 Directory Structure
Section titled “📂 Directory Structure”Application Directories
Section titled “Application Directories”/var/www/├── sansa-frontend/ # SANSA Frontend (Next.js on PM2)│ ├── src/ # Source code│ ├── public/ # Static assets│ ├── .env.production # Production config│ ├── package.json # Node dependencies│ └── .next/ # Built application (712MB)│├── sansa-backend/ # SANSA Backend (FastAPI on systemd)│ ├── app/ # Application code│ │ ├── api/ # API routes│ │ ├── core/ # Core config│ │ ├── models/ # Database models│ │ └── main.py # Entry point│ ├── venv/ # Python virtual environment│ ├── .env # Environment variables│ ├── alembic/ # Database migrations│ └── requirements.txt # Python dependencies (590MB)│├── tumi-frontend/ # Tumi Frontend (Static site)│ ├── build/ # Built static files│ ├── assets/ # Static assets│ └── index.html # Entry point (145MB)│├── tumi-backend/ # Tumi Backend (FastAPI on systemd)│ ├── app/ # Application code│ ├── venv/ # Python virtual environment│ ├── .env # Environment variables│ └── requirements.txt # Python dependencies (94MB)│├── sace-frontend/ # SACE Frontend (systemd)│ ├── src/ # Source code│ ├── public/ # Static assets│ ├── .env.production # Production config│ ├── package.json # Node dependencies│ └── .next/ # Built application│├── sace-backend/ # SACE Backend (FastAPI on systemd)│ ├── app/ # Application code│ │ ├── api/ # API routes│ │ ├── core/ # Core config│ │ ├── models/ # Database models│ │ └── main.py # Entry point│ ├── venv/ # Python virtual environment│ ├── .env # Environment variables│ ├── alembic/ # Database migrations│ └── requirements.txt # Python dependencies│├── thrivesend/ # ThriveSend (Next.js on PM2)│ ├── src/ # Source code│ ├── public/ # Static assets│ ├── .env.production # Production config│ ├── package.json # Node dependencies│ └── .next/ # Built application (1.2GB)│├── prospect-iq/ # ProspectIQ (5 systemd services)│ ├── frontend/ # Frontend application│ ├── backend/ # Backend API│ ├── celery/ # Celery task queue│ └── worker/ # Background workers│├── umdoni/ # Umdoni Municipality Website│ ├── public/ # PHP application│ ├── assets/ # Static assets│ └── index.php # Entry point (284MB)│├── nhlanhla-portfolio/ # Portfolio Website│ ├── build/ # Built static files│ └── assets/ # Static assets (30MB)│├── isutech-frontend/ # iSuTech Corporate Frontend│ └── [application files]│├── isutech-backend/ # iSuTech Corporate Backend (PM2)│ └── [application files]│├── isutech-web/ # iSuTech Corporate Web│ └── [application files]│├── matchmind/ # MatchMind (Development - stopped)│ └── [application files]│└── docs/ # Documentation Hub ├── repo/ # Git repository │ ├── docs/ # Markdown content │ ├── site/ # Built static site │ └── mkdocs.yml # MkDocs configuration └── scripts/ └── update-docs.sh # Auto-update scriptDevelopment Directory
Section titled “Development Directory”/projects/active/├── thrive-send-b2b2g/ # ThriveSend development (2.0GB)├── isutech-prospect-iq/ # ProspectIQ development (696MB)├── umdoni-website/ # Umdoni development (271MB)├── mnyandu-portfolio_from_root/ # Portfolio development (147MB)├── matchmind/ # MatchMind development (19MB)├── iSuMonitor/ # Monitor development (7.6MB)├── autoslip/ # AutoSlip development (1.7MB)└── MyProfile/ # Profile docs (56KB)Note: Development happens at /projects/active/ and is deployed to /var/www/ for production.
System Configuration Directories
Section titled “System Configuration Directories”/etc/├── nginx/│ ├── sites-available/ # Available site configs│ │ ├── api.isutech.co.za│ │ ├── autoslip│ │ ├── docs.isutech.co.za│ │ ├── isutech.co.za│ │ ├── monitor.isutech.co.za│ │ ├── nhlanhla.isutech.co.za│ │ ├── prospectiq│ │ ├── sace.isutech.co.za│ │ ├── sansa.isutech.co.za│ │ ├── thrivesend│ │ ├── tumi.isutech.co.za│ │ ├── umdoni.gov.za│ │ └── (matchmind - not active)│ └── sites-enabled/ # Active site configs (13 symlinks)│├── systemd/system/ # Systemd service files│ ├── sansa-backend.service│ ├── tumi-backend.service│ ├── sace-backend.service│ ├── sace-frontend.service│ ├── autoslip.service│ ├── prospectiq-api.service│ ├── prospectiq-frontend.service│ ├── prospectiq-celery.service│ ├── prospectiq-celery-beat.service│ ├── prospectiq-worker.service│ └── docs-update.timer # Auto-update scheduler│└── letsencrypt/ # SSL certificates ├── live/ │ ├── api.isutech.co.za/ │ ├── docs.isutech.co.za/ │ ├── isutech.co.za/ │ ├── monitor.isutech.co.za/ │ ├── nhlanhla.isutech.co.za/ │ ├── sace.isutech.co.za/ │ ├── sansa.isutech.co.za/ │ ├── tumi.isutech.co.za/ │ └── umdoni.gov.za/ └── renewal/ # Auto-renewal configs🚀 Application Management
Section titled “🚀 Application Management”SACE Backend (FastAPI)
Section titled “SACE Backend (FastAPI)”Service Control:
# Check statussudo systemctl status sace-backend
# Start servicesudo systemctl start sace-backend
# Stop servicesudo systemctl stop sace-backend
# Restart servicesudo systemctl restart sace-backend
# Enable auto-start on bootsudo systemctl enable sace-backend
# View logssudo journalctl -u sace-backend -f
# View last 100 linessudo journalctl -u sace-backend -n 100Manual Operations:
# Navigate to directorycd /var/www/sace-backend
# Activate virtual environmentsource venv/bin/activate
# Check environment variablescat .env
# Run migrationsalembic upgrade head
# Test API directlyuvicorn app.main:app --host 0.0.0.0 --port 8001
# Run Python scriptspython seed_demo_data.pypython seed_activities.pyConfiguration Files:
/var/www/sace-backend/.env- Environment variables/etc/systemd/system/sace-backend.service- Systemd service
SACE Frontend (Next.js)
Section titled “SACE Frontend (Next.js)”Service Control:
# Check statussudo systemctl status sace-frontend
# Start servicesudo systemctl start sace-frontend
# Stop servicesudo systemctl stop sace-frontend
# Restart servicesudo systemctl restart sace-frontend
# Enable auto-start on bootsudo systemctl enable sace-frontend
# View logssudo journalctl -u sace-frontend -fManual Operations:
# Navigate to directorycd /var/www/sace-frontend
# Check environment variablescat .env.production
# Install dependenciesnpm install
# Build applicationnpm run build
# Start manually (for testing)npm start
# Development mode (not for production)npm run devConfiguration Files:
/var/www/sace-frontend/.env.production- Environment variables/etc/systemd/system/sace-frontend.service- Systemd service
SANSA Backend (FastAPI)
Section titled “SANSA Backend (FastAPI)”Service Control:
# Check statussudo systemctl status sansa-backend
# Start servicesudo systemctl start sansa-backend
# Stop servicesudo systemctl stop sansa-backend
# Restart servicesudo systemctl restart sansa-backend
# Enable auto-start on bootsudo systemctl enable sansa-backend
# View logssudo journalctl -u sansa-backend -f
# View last 100 linessudo journalctl -u sansa-backend -n 100Manual Operations:
# Navigate to directorycd /var/www/sansa-backend
# Activate virtual environmentsource venv/bin/activate
# Check environment variablescat .env
# Run migrationsalembic upgrade head
# Test API directlyuvicorn app.main:app --host 0.0.0.0 --port 8003
# Run database seedingpython scripts/seed_database.pyConfiguration Files:
/var/www/sansa-backend/.env- Environment variables/etc/systemd/system/sansa-backend.service- Systemd service
API Endpoints:
- Base URL: https://sansa.isutech.co.za/api/v1
- API Docs: https://sansa.isutech.co.za/api/docs
- Health Check: https://sansa.isutech.co.za/api/v1/health
SANSA Frontend (Next.js/PM2)
Section titled “SANSA Frontend (Next.js/PM2)”Service Control:
# Check statuspm2 status sansa-frontend
# Start servicepm2 start sansa-frontend
# Stop servicepm2 stop sansa-frontend
# Restart servicepm2 restart sansa-frontend
# View logspm2 logs sansa-frontend
# View last 100 linespm2 logs sansa-frontend --lines 100Manual Operations:
# Navigate to directorycd /var/www/sansa-frontend
# Check environment variablescat .env.production
# Install dependenciesnpm install
# Build applicationnpm run build
# Start manually (for testing)npm startConfiguration Files:
/var/www/sansa-frontend/.env.production- Environment variables- PM2 managed (no systemd service)
Test Users:
| Password | Role | |
|---|---|---|
| admin@sansa.gov.za | Admin@2024 | Admin (Superuser) |
| dan.matsapola@sansa.gov.za | Sansa@2024 | Admin |
| facilitator@sansa.gov.za | Sansa@2024 | Facilitator |
| viewer@sansa.gov.za | Sansa@2024 | Viewer |
Tumi Backend (FastAPI)
Section titled “Tumi Backend (FastAPI)”Service Control:
# Check statussudo systemctl status tumi-backend
# Start servicesudo systemctl start tumi-backend
# Stop servicesudo systemctl stop tumi-backend
# Restart servicesudo systemctl restart tumi-backend
# View logssudo journalctl -u tumi-backend -f
# View last 100 linessudo journalctl -u tumi-backend -n 100Manual Operations:
# Navigate to directorycd /var/www/tumi-backend
# Activate virtual environmentsource venv/bin/activate
# Check environment variablescat .env
# Run migrationsalembic upgrade head
# Test API directlyuvicorn app.main:app --host 0.0.0.0 --port 8004Configuration Files:
/var/www/tumi-backend/.env- Environment variables/etc/systemd/system/tumi-backend.service- Systemd service
API Endpoints:
- Base URL: https://tumi.isutech.co.za/api
- Health Check: https://tumi.isutech.co.za/api/health
Tumi Frontend (Static Site)
Section titled “Tumi Frontend (Static Site)”Deployment:
The Tumi frontend is a static site served directly by nginx from /var/www/tumi-frontend/.
Manual Operations:
# Navigate to directorycd /var/www/tumi-frontend
# View filesls -lah
# Check nginx configcat /etc/nginx/sites-available/tumi.isutech.co.zaNo service management needed - nginx serves static files directly.
ThriveSend (Next.js/PM2)
Section titled “ThriveSend (Next.js/PM2)”Service Control:
# Check statuspm2 status thrivesend
# Start servicepm2 start thrivesend
# Stop servicepm2 stop thrivesend
# Restart servicepm2 restart thrivesend
# View logspm2 logs thrivesend
# View last 100 linespm2 logs thrivesend --lines 100Manual Operations:
# Navigate to directorycd /var/www/thrivesend
# Check environment variablescat .env.production
# Install dependenciesnpm install
# Build applicationnpm run build
# Start manuallynpm startConfiguration Files:
/var/www/thrivesend/.env.production- Environment variables- PM2 managed (no systemd service)
ProspectIQ (5 Systemd Services)
Section titled “ProspectIQ (5 Systemd Services)”ProspectIQ runs with 5 separate systemd services for scalability:
Service Control:
# Check all ProspectIQ servicessudo systemctl status prospectiq-api prospectiq-frontend prospectiq-celery prospectiq-celery-beat prospectiq-worker
# Restart all servicessudo systemctl restart prospectiq-api prospectiq-frontend prospectiq-celery prospectiq-celery-beat prospectiq-worker
# Start individual servicessudo systemctl start prospectiq-apisudo systemctl start prospectiq-frontendsudo systemctl start prospectiq-celerysudo systemctl start prospectiq-celery-beatsudo systemctl start prospectiq-worker
# View logs for specific servicesudo journalctl -u prospectiq-api -fsudo journalctl -u prospectiq-celery -fService Descriptions:
- prospectiq-api - Backend API service (FastAPI)
- prospectiq-frontend - Frontend application (Next.js)
- prospectiq-celery - Celery worker for async tasks
- prospectiq-celery-beat - Celery beat scheduler
- prospectiq-worker - Background worker service
Manual Operations:
# Navigate to directorycd /var/www/prospect-iq
# View service configurationsls -lah /etc/systemd/system/prospectiq-*
# Check nginx configcat /etc/nginx/sites-available/prospectiqConfiguration Files:
/var/www/prospect-iq/.env- Environment variables/etc/systemd/system/prospectiq-*.service- Systemd services (5 files)/etc/nginx/sites-available/prospectiq- Nginx configuration
Umdoni Municipality Website
Section titled “Umdoni Municipality Website”Deployment:
The Umdoni website is a PHP-based application served by nginx from /var/www/umdoni/.
Manual Operations:
# Navigate to directorycd /var/www/umdoni
# View filesls -lah
# Check nginx configcat /etc/nginx/sites-available/umdoni.gov.za
# Check PHP-FPM status (if applicable)sudo systemctl status php*-fpmConfiguration Files:
/etc/nginx/sites-available/umdoni.gov.za- Nginx configuration- PHP files served directly by nginx
Nhlanhla Portfolio Website
Section titled “Nhlanhla Portfolio Website”Deployment:
Portfolio website is a static site served by nginx from /var/www/nhlanhla-portfolio/.
Manual Operations:
# Navigate to directorycd /var/www/nhlanhla-portfolio
# View filesls -lah
# Check nginx configcat /etc/nginx/sites-available/nhlanhla.isutech.co.zaNo service management needed - nginx serves static files directly.
iSuTech Corporate Site
Section titled “iSuTech Corporate Site”Service Control:
# Check PM2 backend statuspm2 status isutech-backend
# Restart backendpm2 restart isutech-backend
# View logspm2 logs isutech-backendManual Operations:
# Navigate to directoriescd /var/www/isutech-frontendcd /var/www/isutech-backendcd /var/www/isutech-web
# Check nginx configscat /etc/nginx/sites-available/isutech.co.zacat /etc/nginx/sites-available/api.isutech.co.zaAutoSlip (Receipt Automation)
Section titled “AutoSlip (Receipt Automation)”Service Control:
# Check statussudo systemctl status autoslip
# Start servicesudo systemctl start autoslip
# Stop servicesudo systemctl stop autoslip
# Restart servicesudo systemctl restart autoslip
# View logssudo journalctl -u autoslip -fManual Operations:
# Development code locationcd /projects/active/autoslip
# Check service configurationcat /etc/systemd/system/autoslip.service
# Check nginx configcat /etc/nginx/sites-available/autoslipNote: AutoSlip runs as a systemd service. Development code is at /projects/active/autoslip/.
Documentation Hub (MkDocs)
Section titled “Documentation Hub (MkDocs)”Auto-Update System:
# Check update timer statussudo systemctl status docs-update.timer
# Check update service statussudo systemctl status docs-update.service
# View update logssudo journalctl -u docs-update.service -n 50
# Manual updatesudo /var/www/docs/scripts/update-docs.sh
# View recent update logtail -n 30 /var/log/docs-update.logManual Operations:
# Navigate to repositorycd /var/www/docs/repo
# Pull latest changesgit pull origin main
# Build documentationmkdocs build
# Serve locally (for testing)mkdocs serve
# Deploy to productionmkdocs build# Site built to: /var/www/docs/repo/siteConfiguration Files:
/var/www/docs/repo/mkdocs.yml- MkDocs configuration/var/www/docs/scripts/update-docs.sh- Update script
🌐 Nginx Configuration
Section titled “🌐 Nginx Configuration”Viewing Configurations
Section titled “Viewing Configurations”# List all site configsls -la /etc/nginx/sites-available/
# View docs configcat /etc/nginx/sites-available/docs.isutech.co.za
# View SACE configcat /etc/nginx/sites-available/sace.isutech.co.za
# Check enabled sitesls -la /etc/nginx/sites-enabled/Managing Nginx
Section titled “Managing Nginx”# Test configuration syntaxsudo nginx -t
# Reload configuration (no downtime)sudo systemctl reload nginx
# Restart Nginxsudo systemctl restart nginx
# Check statussudo systemctl status nginx
# View error logssudo tail -f /var/log/nginx/error.log
# View access logssudo tail -f /var/log/nginx/access.logAdding New Site
Section titled “Adding New Site”# 1. Create configuration filesudo nano /etc/nginx/sites-available/newsite.isutech.co.za
# 2. Enable site (create symlink)sudo ln -s /etc/nginx/sites-available/newsite.isutech.co.za /etc/nginx/sites-enabled/
# 3. Test configurationsudo nginx -t
# 4. Reload Nginxsudo systemctl reload nginx
# 5. Install SSL certificatesudo certbot --nginx -d newsite.isutech.co.za🗄️ Database Management
Section titled “🗄️ Database Management”PostgreSQL
Section titled “PostgreSQL”Service Control:
# Check statussudo systemctl status postgresql
# Start servicesudo systemctl start postgresql
# Stop servicesudo systemctl stop postgresql
# Restart servicesudo systemctl restart postgresqlDatabase Operations:
# Connect as postgres usersudo -u postgres psql
# List databasessudo -u postgres psql -c "\l"
# Connect to SACE databasesudo -u postgres psql -d sace_production
# Using SACE user credentialsPGPASSWORD="SaceProd2025Secure" psql -U sace_user -d sace_production -h localhost
# Backup databasesudo -u postgres pg_dump sace_production > /tmp/sace_backup_$(date +%Y%m%d).sql
# Restore databasesudo -u postgres psql sace_production < /tmp/sace_backup_20251111.sql
# Check database sizesudo -u postgres psql -c "SELECT pg_size_pretty(pg_database_size('sace_production'));"Common Queries:
-- Inside psql\l -- List databases\du -- List users\dt -- List tables\d table_name -- Describe table\q -- Quit
-- Sample queriesSELECT COUNT(*) FROM providers;SELECT COUNT(*) FROM educators;SELECT COUNT(*) FROM activities;SELECT COUNT(*) FROM enrollments;Service Control:
# Check statussudo systemctl status redis
# Start servicesudo systemctl start redis
# Stop servicesudo systemctl stop redis
# Restart servicesudo systemctl restart redisRedis Operations:
# Connect to Redis CLIredis-cli
# Inside redis-cli:# ping # Test connection# keys * # List all keys# flushall # Clear all data (DANGER!)# info # Server info# quit # Exit🔒 SSL Certificates
Section titled “🔒 SSL Certificates”Certbot Management
Section titled “Certbot Management”Check Certificate Status:
# List all certificatessudo certbot certificates
# Check specific certificatesudo certbot certificates --cert-name docs.isutech.co.zaRenew Certificates:
# Test renewal (dry run)sudo certbot renew --dry-run
# Manually renewsudo certbot renew
# Renew specific certificatesudo certbot renew --cert-name docs.isutech.co.zaInstall New Certificate:
# For Nginxsudo certbot --nginx -d newdomain.isutech.co.za
# Manual mode (no auto-config)sudo certbot certonly --nginx -d newdomain.isutech.co.zaAuto-Renewal:
# Certbot sets up automatic renewal via systemd timer# Check timer statussudo systemctl status certbot.timer
# View renewal logssudo journalctl -u certbot.service📊 Monitoring & Logs
Section titled “📊 Monitoring & Logs”System Health
Section titled “System Health”Disk Space:
# Check disk usagedf -h
# Check directory sizesdu -sh /var/www/*
# Find large filessudo find / -type f -size +100M -exec ls -lh {} \;Memory & CPU:
# Memory usagefree -h
# CPU usagetop
# Process listhtop # If installed
# Running processesps aux | grep pythonps aux | grep nodeNetwork:
# Check open portssudo netstat -tulpn
# Check listening servicessudo ss -tulpn
# Test port connectivitycurl http://localhost:8001/api/healthcurl http://localhost:3000Application Logs
Section titled “Application Logs”SACE Backend:
# Live logssudo journalctl -u sace-backend -f
# Last 100 linessudo journalctl -u sace-backend -n 100
# Logs from todaysudo journalctl -u sace-backend --since today
# Logs with error levelsudo journalctl -u sace-backend -p errSACE Frontend:
# Live logssudo journalctl -u sace-frontend -f
# Last 100 linessudo journalctl -u sace-frontend -n 100Nginx:
# Access logssudo tail -f /var/log/nginx/access.log
# Error logssudo tail -f /var/log/nginx/error.log
# Search for errorssudo grep "error" /var/log/nginx/error.log
# Site-specific logs (if configured)sudo tail -f /var/log/nginx/sace-access.logsudo tail -f /var/log/nginx/docs-access.log🔧 Maintenance Tasks
Section titled “🔧 Maintenance Tasks”Regular Maintenance (Weekly)
Section titled “Regular Maintenance (Weekly)”# 1. Update system packagessudo apt updatesudo apt upgrade -y
# 2. Check disk spacedf -h
# 3. Clean old logssudo journalctl --vacuum-time=7d
# 4. Check service statussudo systemctl status sansa-backend tumi-backend sace-backend sace-frontend \ autoslip prospectiq-api prospectiq-frontend prospectiq-celery \ prospectiq-celery-beat prospectiq-worker nginx postgresql redispm2 status
# 5. Verify SSL certificate expirysudo certbot certificates
# 6. Backup databasesudo -u postgres pg_dump sace_production > ~/backups/sace_backup_$(date +%Y%m%d).sqlMonthly Tasks
Section titled “Monthly Tasks”# 1. Review and rotate logssudo logrotate -f /etc/logrotate.conf
# 2. Check for security updatessudo apt list --upgradable | grep -i security
# 3. Review disk usage trendsdu -sh /var/www/* /var/log/*
# 4. Test backup restoration# Restore to test database
# 5. Review failed systemd servicessudo systemctl --failed🚨 Troubleshooting
Section titled “🚨 Troubleshooting”Service Won’t Start
Section titled “Service Won’t Start”# 1. Check service statussudo systemctl status service-name
# 2. View detailed logssudo journalctl -u service-name -n 50
# 3. Check configuration syntax# For Nginx:sudo nginx -t
# For Python/FastAPI:cd /var/www/sace-backendsource venv/bin/activatepython -m app.main
# 4. Check port conflictssudo netstat -tulpn | grep :8001Application Not Accessible
Section titled “Application Not Accessible”# 1. Check Nginx statussudo systemctl status nginx
# 2. Check DNS resolutionnslookup sace.isutech.co.za
# 3. Check firewall rulessudo ufw status
# 4. Test local connectivitycurl http://localhost:8001/api/healthcurl http://localhost:3000
# 5. Check SSL certificatesudo certbot certificates
# 6. Review Nginx error logssudo tail -f /var/log/nginx/error.logDatabase Connection Issues
Section titled “Database Connection Issues”# 1. Check PostgreSQL statussudo systemctl status postgresql
# 2. Test connectionsudo -u postgres psql -c "SELECT 1;"
# 3. Check user permissionssudo -u postgres psql -c "\du"
# 4. Test SACE user connectionPGPASSWORD="SaceProd2025Secure" psql -U sace_user -d sace_production -h localhost -c "SELECT 1;"
# 5. Check PostgreSQL logssudo tail -f /var/log/postgresql/postgresql-14-main.logHigh Memory/CPU Usage
Section titled “High Memory/CPU Usage”# 1. Identify resource-hungry processestophtop
# 2. Check specific service resourcessystemctl status sace-backendsystemctl status sace-frontend
# 3. Restart problematic servicesudo systemctl restart service-name
# 4. Check for memory leaks# Review application logs for errors🔒 Security Best Practices
Section titled “🔒 Security Best Practices”User Access
Section titled “User Access”- ✅ Use SSH key authentication (disable password auth)
- ✅ Create separate users for different team members
- ✅ Use
sudoinstead of logging in as root - ✅ Regularly review user accounts and permissions
Firewall
Section titled “Firewall”# Check UFW statussudo ufw status
# Allow specific ports onlysudo ufw allow 80/tcp # HTTPsudo ufw allow 443/tcp # HTTPSsudo ufw allow 22/tcp # SSH
# Enable firewallsudo ufw enableApplication Security
Section titled “Application Security”- ✅ Keep all software updated
- ✅ Use environment variables for secrets (never commit)
- ✅ Enable HTTPS for all applications
- ✅ Use strong passwords and rotate regularly
- ✅ Implement rate limiting on API endpoints
- ✅ Regular security audits
Database Security
Section titled “Database Security”- ✅ Use strong passwords
- ✅ Restrict database access to localhost
- ✅ Regular backups with tested restoration
- ✅ Limit user permissions (principle of least privilege)
📦 Deployment Procedures
Section titled “📦 Deployment Procedures”Deploying SACE Updates
Section titled “Deploying SACE Updates”Backend Updates:
# 1. SSH to serverssh root@46.224.40.5
# 2. Navigate to backendcd /var/www/sace-backend
# 3. Backup current codecp -r app app.backup
# 4. Pull latest changes (if using Git)git pull origin main
# 5. Activate virtual environmentsource venv/bin/activate
# 6. Install new dependenciespip install -r requirements.txt
# 7. Run migrationsalembic upgrade head
# 8. Restart servicesudo systemctl restart sace-backend
# 9. Verifycurl http://localhost:8001/api/healthsudo journalctl -u sace-backend -n 20Frontend Updates:
# 1. Navigate to frontendcd /var/www/sace-frontend
# 2. Backup current buildcp -r .next .next.backup
# 3. Pull latest changesgit pull origin main
# 4. Install dependenciesnpm install
# 5. Build applicationnpm run build
# 6. Restart servicesudo systemctl restart sace-frontend
# 7. Verifycurl http://localhost:3000sudo journalctl -u sace-frontend -n 20Deploying Documentation Updates
Section titled “Deploying Documentation Updates”Automatic Process:
- Documentation auto-updates every 10 minutes via systemd timer
- Pulls from GitHub and rebuilds automatically
Manual Update:
# Run update script manuallysudo /var/www/docs/scripts/update-docs.sh
# View logstail -n 30 /var/log/docs-update.log📝 Quick Reference Commands
Section titled “📝 Quick Reference Commands”Most Used Commands
Section titled “Most Used Commands”# Check all systemd service statusessudo systemctl status sansa-backend tumi-backend sace-backend sace-frontend \ autoslip prospectiq-api prospectiq-frontend prospectiq-celery \ prospectiq-celery-beat prospectiq-worker nginx postgresql redis
# Check all PM2 processespm2 status
# Restart all backend servicessudo systemctl restart sansa-backend tumi-backend sace-backend \ prospectiq-api prospectiq-celery prospectiq-celery-beat prospectiq-worker
# Restart all frontend services (systemd)sudo systemctl restart sace-frontend prospectiq-frontend
# Restart all PM2 applicationspm2 restart all
# View all logs in real-timesudo journalctl -f
# Check disk spacedf -h
# Check memoryfree -h
# Test API health endpointscurl https://sansa.isutech.co.za/api/v1/healthcurl https://tumi.isutech.co.za/api/healthcurl https://sace.isutech.co.za/api/health
# Update documentation manuallysudo /var/www/docs/scripts/update-docs.sh
# Backup all databasessudo -u postgres pg_dump sace_production > ~/backups/sace_$(date +%Y%m%d).sqlsudo -u postgres pg_dump sansa_production > ~/backups/sansa_$(date +%Y%m%d).sqlsudo -u postgres pg_dump tumi_production > ~/backups/tumi_$(date +%Y%m%d).sql
# Check Nginx config and reloadsudo nginx -t && sudo systemctl reload nginx
# View all nginx sitesls -la /etc/nginx/sites-enabled/
# Check all SSL certificatessudo certbot certificates📞 Support & Escalation
Section titled “📞 Support & Escalation”When to Restart Services
Section titled “When to Restart Services”- Application not responding
- High memory usage
- After configuration changes
- After code deployment
When to Contact Support
Section titled “When to Contact Support”- Persistent service failures
- Database corruption
- Security incidents
- SSL certificate issues
- Hardware problems
Emergency Procedures
Section titled “Emergency Procedures”- Service Down: Restart service → Check logs → Verify config
- Database Issue: Stop writes → Backup → Restore from backup
- Security Breach: Isolate server → Review logs → Reset credentials
- Disk Full: Clear old logs → Remove temp files → Expand disk
📚 Additional Resources
Section titled “📚 Additional Resources”Documentation Links
Section titled “Documentation Links”- Nginx Documentation
- FastAPI Documentation
- Next.js Documentation
- PostgreSQL Documentation
- MkDocs Material
Internal Documentation
Section titled “Internal Documentation”Last Updated: 02/01/2026 | Document Owner: Operations Team | Version: 2.0
📋 Application Inventory Summary
Section titled “📋 Application Inventory Summary”| # | Application | Location | Domain | Service Type | Status |
|---|---|---|---|---|---|
| 1 | SANSA Frontend | /var/www/sansa-frontend/ | sansa.isutech.co.za | PM2 (port 3003) | ✅ Running |
| 2 | SANSA Backend | /var/www/sansa-backend/ | sansa.isutech.co.za/api | systemd (port 8003) | ✅ Running |
| 3 | Tumi Frontend | /var/www/tumi-frontend/ | tumi.isutech.co.za | nginx static | ✅ Serving |
| 4 | Tumi Backend | /var/www/tumi-backend/ | tumi.isutech.co.za/api | systemd (port 8004) | ✅ Running |
| 5 | SACE Frontend | /var/www/sace-frontend/ | sace.isutech.co.za | systemd | ✅ Running |
| 6 | SACE Backend | /var/www/sace-backend/ | sace.isutech.co.za/api | systemd (port 8001) | ✅ Running |
| 7 | ThriveSend | /var/www/thrivesend/ | thrivesend | PM2 | ✅ Running |
| 8 | ProspectIQ API | /var/www/prospect-iq/ | prospectiq | systemd | ✅ Running |
| 9 | ProspectIQ Frontend | /var/www/prospect-iq/ | prospectiq | systemd | ✅ Running |
| 10 | ProspectIQ Celery | /var/www/prospect-iq/ | - | systemd | ✅ Running |
| 11 | ProspectIQ Beat | /var/www/prospect-iq/ | - | systemd | ✅ Running |
| 12 | ProspectIQ Worker | /var/www/prospect-iq/ | - | systemd | ✅ Running |
| 13 | DocsHub | /var/www/docs/ | docs.isutech.co.za | nginx static | ✅ Serving |
| 14 | Umdoni | /var/www/umdoni/ | umdoni.gov.za | nginx + PHP | ✅ Serving |
| 15 | iSuTech Corporate | /var/www/isutech-*/ | isutech.co.za | nginx + PM2 | ⚠️ Partial |
| 16 | Portfolio | /var/www/nhlanhla-portfolio/ | nhlanhla.isutech.co.za | nginx static | ⚠️ Unknown |
| 17 | AutoSlip | Service only | autoslip | systemd | ✅ Running |
| 18 | MatchMind | /var/www/matchmind/ | - | - | 🔴 Stopped |
Total: 18 services across 14 applications Running: 14 services Partially Running: 1 (iSuTech) Unknown: 1 (Portfolio) Stopped: 2 (MatchMind services)