Windows Deployment
Deploy SaleSpider on Windows Server or Windows 10/11 using WSL 2 and Docker Desktop.
Overview
Windows deployment uses:
- Windows Subsystem for Linux (WSL 2)
- Docker Desktop for Windows
- Ubuntu distribution in WSL
- Self-hosted PostgreSQL database
Prerequisites
System Requirements
- Windows Server 2019+ or Windows 10/11 Pro/Enterprise
- 4GB+ RAM available
- 10GB+ disk space
- Administrator access
- Virtualization enabled in BIOS
Quick Start
1. Enable WSL 2
Open PowerShell as Administrator:
# Enable WSL
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
# Enable Virtual Machine Platform
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
# Restart computer
Restart-ComputerAfter restart:
# Install WSL 2
wsl --install
# Set WSL 2 as default
wsl --set-default-version 2
# Install Ubuntu
wsl --install -d Ubuntu2. Install Docker Desktop
- Download from docker.com/products/docker-desktop
- Run installer
- Enable WSL 2 integration during installation
- Restart computer
3. Configure Docker Desktop
Open Docker Desktop:
Settings → General
- ✅ Use WSL 2 based engine
Settings → Resources → WSL Integration
- ✅ Enable integration with Ubuntu
Settings → Resources → Advanced
- Memory: 4GB minimum (8GB recommended)
- CPUs: 2 minimum (4 recommended)
Apply & Restart
4. Deploy SaleSpider
Open Ubuntu from Start menu:
# Clone repository
git clone https://github.com/IdrisAkintobi/SaleSpider.git
cd SaleSpider
# Configure environment
cp env.example .env
nano .env
# Deploy
make deploy5. Access Application
From Windows:
From network:
- https://YOUR_SERVER_IP
Configuration
Environment Variables
Edit .env in Ubuntu:
# Database
DATABASE_URL="postgresql://salespider:password@postgres:5432/salespider"
# Authentication
JWT_SECRET="your-super-secret-jwt-key"
JWT_EXPIRES_IN="7d"
# Application
NODE_ENV="production"
NEXT_PUBLIC_APP_URL="http://localhost:3000"
# Backup
SETUP_BACKUP="true"Windows Firewall
Allow incoming connections:
# In PowerShell as Administrator
# Allow HTTP
New-NetFirewallRule -DisplayName "SaleSpider HTTP" -Direction Inbound -LocalPort 80 -Protocol TCP -Action Allow
# Allow HTTPS
New-NetFirewallRule -DisplayName "SaleSpider HTTPS" -Direction Inbound -LocalPort 443 -Protocol TCP -Action AllowSSL Certificate
Install self-signed certificate:
# In WSL, export certificate
cp .docker/ssl/cert.pem /mnt/c/Users/Public/salespider-cert.pem# In PowerShell as Administrator
Import-Certificate -FilePath "C:\Users\Public\salespider-cert.pem" -CertStoreLocation "Cert:\LocalMachine\Root"Management
Daily Operations
In Ubuntu (WSL):
cd ~/SaleSpider
# Check status
make status
# View logs
make logs
# Restart services
make restart
# Stop services
make stop
# Start services
make startBackup & Restore
# Create backup
make backup
# Restore backup
make restore
# View backup info
make backup-infoAutomated Backups
Create Windows Task Scheduler task:
Create
C:\Scripts\salespider-backup.bat:batch@echo off wsl -d Ubuntu -e bash -c "cd ~/SaleSpider && make backup"Schedule task:
powershell$action = New-ScheduledTaskAction -Execute "C:\Scripts\salespider-backup.bat" $trigger = New-ScheduledTaskTrigger -Daily -At 2am Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "SaleSpider Backup"
Troubleshooting
WSL Issues
WSL not starting:
wsl --shutdown
wsl --update
wslUbuntu not found:
wsl --list
wsl --install -d UbuntuDocker Issues
Docker not starting:
- Check Hyper-V is enabled
- Restart Docker Desktop
- Check Docker Desktop logs
Cannot connect to Docker:
- Docker Desktop → Settings → Resources → WSL Integration
- Enable integration with Ubuntu
- Apply & Restart
Port Conflicts
If ports 80/443 are in use:
# In .env
HTTP_PORT=8080
HTTPS_PORT=8443Update firewall rules accordingly.
Performance Issues
Slow file access:
- Use WSL filesystem (
~/SaleSpider) instead of Windows filesystem (/mnt/c/)
High memory usage:
- Reduce Docker memory in Docker Desktop settings
- Adjust limits in
.env
Auto-Start on Boot
Option 1: Docker Desktop
Docker Desktop → Settings → General
- ✅ Start Docker Desktop when you log in
Option 2: Task Scheduler
$action = New-ScheduledTaskAction -Execute "wsl" -Argument "-d Ubuntu -e bash -c 'cd ~/SaleSpider && make start'"
$trigger = New-ScheduledTaskTrigger -AtStartup
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -LogonType ServiceAccount -RunLevel Highest
Register-ScheduledTask -Action $action -Trigger $trigger -Principal $principal -TaskName "SaleSpider Auto-start"Best Practices
1. Use WSL Filesystem
Store project in WSL home directory for better performance:
cd ~
git clone https://github.com/IdrisAkintobi/SaleSpider.git2. Regular Backups
- Enable automated backups
- Test restore procedures
- Store backups on separate drive
3. Resource Allocation
- Allocate sufficient memory to Docker
- Monitor with
docker stats - Adjust limits as needed
4. Security
- Change default passwords
- Keep Windows updated
- Configure firewall properly
- Use strong SSL certificates
Network Access
From Windows Server
From Other Computers
Find server IP:
ipconfig | findstr IPv4Access at:
- https://SERVER_IP
DNS Configuration
For custom domain:
- Configure DNS server
- Point domain to server IP
- Update
NEXT_PUBLIC_APP_URLin.env
Updating
# In WSL
cd ~/SaleSpider
# Pull latest changes
git pull
# Update deployment
make updateMonitoring
# Service status
make status
# Resource usage
docker stats
# Disk usage
df -hCommon Commands
# Status and monitoring
make status # Service status
make health # Health checks
make logs # View logs
# Service management
make start # Start services
make stop # Stop services
make restart # Restart services
# Database operations
make backup # Create backup
make restore # Restore backup
make db-shell # Database shell
# Troubleshooting
docker compose ps # Service list
docker compose logs # View logsBenefits
- ✅ Native Windows - Runs on Windows Server
- ✅ Full Control - Complete access to all components
- ✅ Offline Capable - Works without internet
- ✅ Familiar Environment - Windows management tools
Limitations
- ⚠️ WSL Required - Needs WSL 2 setup
- ⚠️ Resource Overhead - WSL and Docker overhead
- ⚠️ Complexity - More complex than Linux deployment