Phase 2 Deployment Guide
Phase 2 Deployment Guide
Section titled “Phase 2 Deployment Guide”Self-Hosted Documentation Website at docs.isutech.co.za
Section titled “Self-Hosted Documentation Website at docs.isutech.co.za”Last Updated: 08/11/2025 Version: 1.0 Estimated Time: 2-4 hours Difficulty: Intermediate (step-by-step guidance provided)
🎯 What We’re Deploying
Section titled “🎯 What We’re Deploying”Before Phase 2:
- Documentation in Git repository
- Team navigates markdown files in folders
- Good organization, but requires Git/file system knowledge
After Phase 2:
- Beautiful website at
docs.isutech.co.za - Searchable, mobile-friendly interface
- Auto-updates when you push to Git
- Professional appearance
- Zero ongoing cost (using your Hetzner server)
Technology: MkDocs Material (free, open source, looks like this: https://squidfunk.github.io/mkdocs-material/)
📋 Prerequisites Checklist
Section titled “📋 Prerequisites Checklist”Before starting, ensure you have:
- SSH access to Hetzner server (46.224.40.5)
- Root or sudo access on the server
- Domain access (ability to add DNS record for docs.isutech.co.za)
- 30 minutes of uninterrupted time for initial setup
- Basic comfort with command line (we’ll guide you through every step)
Test your SSH access:
ssh root@46.224.40.5# orssh your-username@46.224.40.5If this works, you’re ready! ✅
🗺️ Deployment Overview
Section titled “🗺️ Deployment Overview”Phase 2 Steps:
Section titled “Phase 2 Steps:”Step 1: Server Preparation (15 min) ↓Step 2: Install MkDocs Material (10 min) ↓Step 3: Configure Documentation Site (20 min) ↓Step 4: Set Up Web Server (Nginx) (20 min) ↓Step 5: Configure Domain (docs.isutech.co.za) (15 min) ↓Step 6: Set Up Auto-Updates (20 min) ↓Step 7: Enable HTTPS (SSL) (15 min) ↓Step 8: Test & Verify (15 min)Total: ~2.5 hours
📝 Step-by-Step Instructions
Section titled “📝 Step-by-Step Instructions”Step 1: Server Preparation (15 minutes)
Section titled “Step 1: Server Preparation (15 minutes)”1.1 Connect to Your Hetzner Server
Section titled “1.1 Connect to Your Hetzner Server”# Replace with your actual SSH credentialsssh root@46.224.40.51.2 Update System Packages
Section titled “1.2 Update System Packages”# Update package listsapt update
# Upgrade existing packagesapt upgrade -y1.3 Install Required Dependencies
Section titled “1.3 Install Required Dependencies”# Install Python 3, pip, and other essentialsapt install -y python3 python3-pip python3-venv git nginx certbot python3-certbot-nginx
# Verify installationspython3 --version # Should show Python 3.xpip3 --version # Should show pip versionnginx -v # Should show nginx versiongit --version # Should show git version✅ Checkpoint: All commands should complete without errors
Step 2: Install MkDocs Material (10 minutes)
Section titled “Step 2: Install MkDocs Material (10 minutes)”2.1 Create Dedicated User for Documentation (Security Best Practice)
Section titled “2.1 Create Dedicated User for Documentation (Security Best Practice)”# Create docs useradduser --system --group --home /home/docs docs
# Create directory for documentationmkdir -p /var/www/docschown docs:docs /var/www/docs2.2 Set Up Python Virtual Environment
Section titled “2.2 Set Up Python Virtual Environment”# Switch to docs directorycd /var/www/docs
# Create virtual environmentpython3 -m venv venv
# Activate virtual environmentsource venv/bin/activate
# Upgrade pippip install --upgrade pip2.3 Install MkDocs Material
Section titled “2.3 Install MkDocs Material”# Install MkDocs Material (includes MkDocs core)pip install mkdocs-material
# Install additional useful pluginspip install mkdocs-git-revision-date-localized-pluginpip install mkdocs-minify-pluginpip install mkdocs-redirects
# Verify installationmkdocs --versionExpected output: mkdocs, version X.X.X
✅ Checkpoint: MkDocs Material installed successfully
Step 3: Configure Documentation Site (20 minutes)
Section titled “Step 3: Configure Documentation Site (20 minutes)”3.1 Clone Your Documentation Repository
Section titled “3.1 Clone Your Documentation Repository”# Still in /var/www/docscd /var/www/docs
# Clone your mathew-goniwe repositorygit clone https://github.com/gedeza/mathew-goniwe.git repo
# Change ownershipchown -R docs:docs /var/www/docs/repo3.2 Create MkDocs Configuration
Section titled “3.2 Create MkDocs Configuration”# Navigate to docs foldercd /var/www/docs/repo
# Create mkdocs.yml configuration filenano mkdocs.ymlPaste this configuration (I’ll provide the complete file in the next section):
# See mkdocs.yml file that will be created in the repoSave and exit (Ctrl+X, then Y, then Enter)
3.3 Test Build Locally
Section titled “3.3 Test Build Locally”# Activate virtual environment if not already activesource /var/www/docs/venv/bin/activate
# Build the documentationcd /var/www/docs/repomkdocs build
# This creates a 'site/' folder with HTML filesls site/ # Should show index.html and other files✅ Checkpoint: Build completes without errors, site/ folder created
Step 4: Set Up Web Server (Nginx) (20 minutes)
Section titled “Step 4: Set Up Web Server (Nginx) (20 minutes)”4.1 Create Nginx Configuration
Section titled “4.1 Create Nginx Configuration”# Create nginx site configurationnano /etc/nginx/sites-available/docs.isutech.co.zaPaste this configuration:
server { listen 80; server_name docs.isutech.co.za;
root /var/www/docs/repo/site; index index.html;
# Logging access_log /var/log/nginx/docs-access.log; error_log /var/log/nginx/docs-error.log;
# Main location location / { try_files $uri $uri/ =404; }
# Security headers add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Content-Type-Options "nosniff" always; add_header X-XSS-Protection "1; mode=block" always;
# Cache static assets location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2)$ { expires 1y; add_header Cache-Control "public, immutable"; }}Save and exit (Ctrl+X, then Y, then Enter)
4.2 Enable the Site
Section titled “4.2 Enable the Site”# Create symbolic link to enable siteln -s /etc/nginx/sites-available/docs.isutech.co.za /etc/nginx/sites-enabled/
# Test nginx configurationnginx -t
# If test passes, reload nginxsystemctl reload nginx
# Check nginx statussystemctl status nginx✅ Checkpoint: Nginx configuration test passes, service is running
Step 5: Configure Domain (docs.isutech.co.za) (15 minutes)
Section titled “Step 5: Configure Domain (docs.isutech.co.za) (15 minutes)”5.1 Add DNS Record
Section titled “5.1 Add DNS Record”Go to your domain registrar (where you manage isutech.co.za DNS)
Add A Record:
- Type: A
- Name: docs (or docs.isutech)
- Value: 46.224.40.5 (your Hetzner server IP)
- TTL: 3600 (or default)
Example for common registrars:
Cloudflare:
- Log in to Cloudflare
- Select isutech.co.za domain
- Go to DNS settings
- Click “Add record”
- Type: A, Name: docs, IPv4 address: 46.224.40.5
- Click Save
Other registrars: Similar process - add A record pointing docs to 46.224.40.5
5.2 Test DNS Propagation
Section titled “5.2 Test DNS Propagation”# Wait 5-10 minutes, then test (on your local machine, not server)nslookup docs.isutech.co.za
# Orping docs.isutech.co.za
# Should resolve to 46.224.40.5Note: DNS propagation can take 5 minutes to 24 hours (usually <30 minutes)
✅ Checkpoint: docs.isutech.co.za resolves to your server IP
Step 6: Set Up Auto-Updates (20 minutes)
Section titled “Step 6: Set Up Auto-Updates (20 minutes)”We’ll set up automatic rebuilding when you push to GitHub.
6.1 Create Update Script
Section titled “6.1 Create Update Script”# Create script directorymkdir -p /var/www/docs/scriptscd /var/www/docs/scripts
# Create update scriptnano update-docs.shPaste this script:
#!/bin/bash
# Documentation Auto-Update Script# This script pulls latest changes from Git and rebuilds documentation
LOG_FILE="/var/log/docs-update.log"REPO_DIR="/var/www/docs/repo"VENV_DIR="/var/www/docs/venv"
echo "=== Documentation Update Started: $(date) ===" >> $LOG_FILE
# Navigate to repositorycd $REPO_DIR
# Pull latest changesecho "Pulling latest changes from Git..." >> $LOG_FILEgit pull origin main >> $LOG_FILE 2>&1
if [ $? -eq 0 ]; then echo "Git pull successful" >> $LOG_FILE
# Activate virtual environment and rebuild echo "Rebuilding documentation..." >> $LOG_FILE source $VENV_DIR/bin/activate mkdocs build --clean >> $LOG_FILE 2>&1
if [ $? -eq 0 ]; then echo "Documentation rebuilt successfully" >> $LOG_FILE echo "=== Update Completed Successfully: $(date) ===" >> $LOG_FILE exit 0 else echo "ERROR: MkDocs build failed" >> $LOG_FILE echo "=== Update Failed: $(date) ===" >> $LOG_FILE exit 1 fielse echo "ERROR: Git pull failed" >> $LOG_FILE echo "=== Update Failed: $(date) ===" >> $LOG_FILE exit 1fiSave and exit
# Make script executablechmod +x /var/www/docs/scripts/update-docs.sh
# Change ownershipchown docs:docs /var/www/docs/scripts/update-docs.sh
# Test the script/var/www/docs/scripts/update-docs.sh
# Check logtail /var/log/docs-update.log6.2 Set Up Automatic Updates (Option A: Cron Job)
Section titled “6.2 Set Up Automatic Updates (Option A: Cron Job)”# Create cron job to check for updates every 10 minutescrontab -e
# Add this line (choose your preferred editor if prompted)*/10 * * * * /var/www/docs/scripts/update-docs.shThis will check for updates every 10 minutes.
Alternative: Manual trigger - Just run the script when you want to update:
/var/www/docs/scripts/update-docs.sh✅ Checkpoint: Update script runs successfully, documentation rebuilds
Step 7: Enable HTTPS (SSL) (15 minutes)
Section titled “Step 7: Enable HTTPS (SSL) (15 minutes)”Secure your documentation site with free Let’s Encrypt SSL.
7.1 Obtain SSL Certificate
Section titled “7.1 Obtain SSL Certificate”# Run certbot for automatic SSL setupcertbot --nginx -d docs.isutech.co.za
# Follow the prompts:# - Enter email address (for renewal notifications)# - Agree to terms# - Choose whether to redirect HTTP to HTTPS (recommended: Yes)Certbot will automatically:
- Obtain SSL certificate
- Update nginx configuration
- Set up auto-renewal
7.2 Test SSL
Section titled “7.2 Test SSL”# Test SSL certificatecertbot certificates
# Test auto-renewalcertbot renew --dry-runIf dry-run succeeds, auto-renewal is configured! ✅
7.3 Access Your Site
Section titled “7.3 Access Your Site”Open browser and visit:
https://docs.isutech.co.zaYou should see your beautiful documentation website! 🎉
✅ Checkpoint: Site loads with valid HTTPS certificate
Step 8: Test & Verify (15 minutes)
Section titled “Step 8: Test & Verify (15 minutes)”8.1 Functionality Tests
Section titled “8.1 Functionality Tests”Test navigation:
- Homepage loads
- Can navigate to different sections
- Search works (type in search box)
- Mobile view works (resize browser)
Test content:
- Master Index displays correctly
- Marketing templates accessible
- Business Development section works
- All links work (no 404 errors)
8.2 Test Auto-Update
Section titled “8.2 Test Auto-Update”# On your local machine, make a small change to a doc# For example, edit docs/00-INDEX/MASTER_INDEX.md# Add a line: "Last verified: [today's date]"
git add docs/git commit -m "Test auto-update functionality"git push origin main
# Wait 10 minutes (or run update script manually on server)# Then refresh https://docs.isutech.co.za
# Your change should appear!✅ Checkpoint: Changes from Git appear on website
🎉 Deployment Complete!
Section titled “🎉 Deployment Complete!”You Now Have:
Section titled “You Now Have:”✅ Professional documentation website at https://docs.isutech.co.za ✅ Automatic updates every 10 minutes from Git ✅ Secure HTTPS with auto-renewing certificate ✅ Fast, searchable interface ✅ Mobile-friendly design ✅ Zero ongoing cost (using existing server)
🔐 Access Control (Optional - Phase 2b)
Section titled “🔐 Access Control (Optional - Phase 2b)”If you want to restrict access to certain sections:
Option 1: Basic Auth (Simple Password Protection)
Section titled “Option 1: Basic Auth (Simple Password Protection)”# Install apache2-utilsapt install apache2-utils
# Create password filehtpasswd -c /etc/nginx/.htpasswd isutech
# Enter password when prompted
# Update nginx confignano /etc/nginx/sites-available/docs.isutech.co.za
# Add auth to specific location:location /business-development/ { auth_basic "Restricted Access"; auth_basic_user_file /etc/nginx/.htpasswd; try_files $uri $uri/ =404;}
# Reload nginxnginx -t && systemctl reload nginxOption 2: IP Whitelist (Office/VPN Only)
Section titled “Option 2: IP Whitelist (Office/VPN Only)”# In nginx config, add:location /business-development/ { allow 102.x.x.x; # Your office IP allow 10.0.0.0/8; # Private network deny all; try_files $uri $uri/ =404;}📊 Monitoring & Maintenance
Section titled “📊 Monitoring & Maintenance”Daily/Weekly (Automatic)
Section titled “Daily/Weekly (Automatic)”- ✅ SSL renewal: Automatic (certbot)
- ✅ Documentation updates: Automatic (every 10 min via cron)
- ✅ Server updates: Monthly (set reminder)
Monthly Tasks (5 minutes)
Section titled “Monthly Tasks (5 minutes)”# SSH to serverssh root@46.224.40.5
# Update system packagesapt update && apt upgrade -y
# Check disk spacedf -h
# Check logs for errorstail -n 50 /var/log/docs-update.logtail -n 50 /var/log/nginx/docs-error.log
# Update MkDocs Material (optional, if new version available)source /var/www/docs/venv/bin/activatepip install --upgrade mkdocs-materialMonitoring Checklist
Section titled “Monitoring Checklist”- Site loads properly (https://docs.isutech.co.za)
- SSL certificate valid (check browser padlock)
- Auto-updates working (check log: /var/log/docs-update.log)
- No errors in nginx logs
- Server disk space >20% free
🆘 Troubleshooting
Section titled “🆘 Troubleshooting”Issue: Site Not Loading
Section titled “Issue: Site Not Loading”Check nginx status:
systemctl status nginxnginx -t # Test configurationCheck logs:
tail -n 50 /var/log/nginx/docs-error.logRestart nginx:
systemctl restart nginxIssue: Documentation Not Updating
Section titled “Issue: Documentation Not Updating”Check update log:
tail -n 100 /var/log/docs-update.logManually trigger update:
/var/www/docs/scripts/update-docs.shCheck Git status:
cd /var/www/docs/repogit statusgit log -n 5 # See recent commitsIssue: SSL Certificate Problems
Section titled “Issue: SSL Certificate Problems”Check certificate:
certbot certificatesRenew manually:
certbot renewCheck certificate expiry:
openssl s_client -connect docs.isutech.co.za:443 -servername docs.isutech.co.za < /dev/null 2>/dev/null | openssl x509 -noout -datesIssue: Slow Performance
Section titled “Issue: Slow Performance”Enable gzip compression in nginx:
# Add to /etc/nginx/sites-available/docs.isutech.co.za
gzip on;gzip_vary on;gzip_types text/plain text/css text/xml text/javascript application/json application/javascript application/xml+rss;Restart nginx:
systemctl restart nginx📞 Support & Resources
Section titled “📞 Support & Resources”Official Documentation
Section titled “Official Documentation”- MkDocs Material: https://squidfunk.github.io/mkdocs-material/
- MkDocs: https://www.mkdocs.org/
- Nginx: https://nginx.org/en/docs/
Quick Commands Reference
Section titled “Quick Commands Reference”# Rebuild documentation manuallycd /var/www/docs/repo && source /var/www/docs/venv/bin/activate && mkdocs build --clean
# Update documentation from Git/var/www/docs/scripts/update-docs.sh
# Check nginx statussystemctl status nginx
# View update logstail -f /var/log/docs-update.log
# View nginx error logstail -f /var/log/nginx/docs-error.log
# Renew SSL certificatecertbot renew✅ Post-Deployment Checklist
Section titled “✅ Post-Deployment Checklist”After completing deployment:
- Site accessible at https://docs.isutech.co.za
- HTTPS working (green padlock in browser)
- Search functionality working
- Mobile view working
- Auto-updates configured and tested
- Team informed of new URL
- Bookmarks updated (if applicable)
- Old documentation access method retired (if applicable)
🎓 Training Your Team
Section titled “🎓 Training Your Team”Share This With Your Team:
Section titled “Share This With Your Team:”New Documentation Access:
- Old way: Navigate folders in Git
- New way: Visit https://docs.isutech.co.za
Making Updates:
- Process unchanged: Edit markdown → Git push
- Bonus: Changes appear on website automatically (within 10 minutes)
No new skills needed!
- Non-technical users: Just browse the website
- Technical users: Same Git workflow as before
🎉 Congratulations!
Section titled “🎉 Congratulations!”You’ve successfully deployed a professional, self-hosted documentation system at:
What you’ve achieved:
- ✅ Enterprise-grade documentation platform
- ✅ Beautiful, searchable interface
- ✅ Automatic updates from Git
- ✅ Secure HTTPS
- ✅ Mobile-friendly
- ✅ Zero ongoing costs
Total monthly cost: R0 (using existing server) Saved vs. Notion/Confluence: R600-1,000/month = R7,200-12,000/year
Phase 2 Deployment Guide - iSu Technologies Need help? Check troubleshooting section or contact technical lead Last Updated: 08/11/2025