Automated installer for OpenTAKServer with MediaMTX, monitoring, and Cloudflare Tunnel support.
- ✅ One-command installation - Fully automated setup
- ✅ Interactive configuration - Guided prompts for all settings
- ✅ Complete TAK stack - OpenTAKServer, MediaMTX, PostgreSQL, RabbitMQ
- ✅ Built-in monitoring - Health checks with Discord/email alerts
- ✅ Security hardened - Firewall, secure defaults, auto-generated secrets
- ✅ Optional integrations - Cloudflare Tunnel, ZeroTier
- ✅ Production ready - Systemd services, automatic restarts, log rotation
- OpenTAKServer v1.6.0+ - TAK server for situational awareness
- MediaMTX v1.15.3 - Real-time media streaming
- PostgreSQL 15 - Primary database
- RabbitMQ - Message queue for COT routing
- nginx - Web server and reverse proxy
- sanity-check - Comprehensive health report (every 8 hours)
- alert-check - Fast failure detection (every 10 minutes)
- Discord webhooks and email alerts
- Automatic recovery notifications
8080- HTTP (Marti)8081- OTS Listener8088- TCP Streaming (non-SSL)8089- SSL Streaming8443- HTTPS (Marti)8554- RTSP (MediaMTX)9997- MediaMTX API5432- PostgreSQL5672- RabbitMQ80/443- HTTP/HTTPS (nginx)22- SSH
- Hardware: Raspberry Pi 4/5 (4GB+ RAM recommended)
- OS: Raspberry Pi OS (64-bit) or Debian 11/12
- Network: Internet connection via Ethernet
- Storage: 10GB+ free space
- Access: Root/sudo privileges
# Download installer
curl -sSL https://raw.githubusercontent.com/yourusername/gridbase-tak-installer/main/install.sh -o install.sh
# Run installer
sudo bash install.sh# Clone repository
git clone https://github.com/yourusername/gridbase-tak-installer.git
cd gridbase-tak-installer
# Run installer
sudo ./install.shThe installer will guide you through:
- Pre-flight Checks - Verify system requirements
- Configuration Wizard - Set up your preferences:
- System username/password
- Email configuration (Gmail)
- Discord webhook
- Location (for airplane/ship tracking)
- Certificate Authority details
- Optional: Cloudflare Tunnel
- Optional: ZeroTier network
- Automated Installation - Sit back while it installs everything
- Service Startup - All services configured and started
- Credentials Summary - Access details saved to
/root/gridbase-credentials.txt
- System Username - Default:
tak - System Password - Auto-generated or custom
- Email for Alerts - Where to send notifications
- Discord Webhook - For real-time alerts
- Gmail Credentials - For email alerts (requires app password)
- Cloudflare Tunnel - For remote access without port forwarding
- ZeroTier Network - For VPN-style connectivity
- Location - Latitude/longitude for tracking features
The installer automatically generates secure random values for:
- Database passwords
- Certificate authority password
- Security tokens and secrets
- API tokens
All credentials are saved to /root/gridbase-credentials.txt
sudo -u tak /home/tak/.opentakserver_venv/bin/ots-manage user create admin- HTTP:
http://<your-pi-ip>:8080 - HTTPS:
https://<your-pi-ip>:8443
# All services
systemctl status opentakserver eud_handler eud_handler_ssl mediamtx
# Monitoring
systemctl status sanity-check.timer alert-check.timer
# View logs
tail -f /var/log/gridbase-installer.log
tail -f /home/tak/ots/logs/opentakserver.log# Login to Cloudflare
cloudflared tunnel login
# Create tunnel
cloudflared tunnel create gridbase-tak
# Configure tunnel
cloudflared tunnel route dns gridbase-tak tak.yourdomain.com
# Run tunnel
cloudflared tunnel run gridbase-tak- Go to https://my.zerotier.com
- Find your network
- Authorize the new device
- Note the assigned IP address
Your server sends automatic Discord notifications for:
- ✅ Every 8 hours - Full health report (always)
- ❌ Immediate - When failures are detected
- ♻️ Recovery - When issues are resolved
Email alerts are sent only for failures, containing:
- Detailed error information
- Service logs
- Recovery instructions
# Run sanity check manually
sudo /usr/local/bin/sanity-check
# Run alert check manually
sudo /usr/local/bin/alert-check
# View monitoring logs
tail -f /var/log/sanity-check.log
tail -f /var/log/alert-check.log/home/tak/
├── ots/
│ ├── config.yml # Main OTS configuration
│ ├── ca/ # Certificate authority
│ ├── logs/ # Application logs
│ ├── uploads/ # User uploads
│ └── mediamtx/ # MediaMTX installation
├── .opentakserver_venv/ # Python virtual environment
└── gridbase-tak-installer/ # Installer files (can be deleted)
/etc/gridbase/
└── monitoring.conf # Monitoring configuration
/usr/local/bin/
├── sanity-check # Health check script
└── alert-check # Failure detection script
/etc/systemd/system/
├── opentakserver.service
├── eud_handler.service
├── eud_handler_ssl.service
├── mediamtx.service
├── sanity-check.timer
└── alert-check.timer
/root/
└── gridbase-credentials.txt # Saved credentials (KEEP SECURE!)
# Check service status
systemctl status opentakserver
journalctl -u opentakserver -n 50
# Restart services
sudo systemctl restart opentakserver eud_handler eud_handler_ssl mediamtx# Find process using port 8080
sudo netstat -tlnp | grep 8080
# Kill process if needed
sudo kill -9 <PID># Check PostgreSQL status
sudo systemctl status postgresql
# Test connection
sudo -u tak psql -U ots -d ots -h 127.0.0.1# Check timer status
systemctl list-timers | grep -E "sanity|alert"
# Run checks manually
sudo /usr/local/bin/sanity-check
sudo /usr/local/bin/alert-check
# Check Discord webhook
curl -X POST -H "Content-Type: application/json" \
-d '{"content": "Test message"}' \
"<your-discord-webhook-url>"If you need to start over:
# Stop all services
sudo systemctl stop opentakserver eud_handler eud_handler_ssl mediamtx
# Remove user and data (WARNING: Destroys all data!)
sudo userdel -r tak
sudo rm -rf /home/tak
sudo -u postgres dropdb ots
sudo -u postgres dropuser ots
# Run installer again
cd gridbase-tak-installer
sudo ./install.shThe installer implements:
- ✅ Firewall (UFW) with only required ports open
- ✅ Auto-generated secure passwords (25+ characters)
- ✅ Restricted file permissions (600 for sensitive files)
- ✅ PostgreSQL accessible only from localhost
- ✅ RabbitMQ with guest user restricted to localhost
-
Change Default Passwords
passwd tak sudo -u postgres psql -c "ALTER USER ots WITH PASSWORD 'new-secure-password';" -
Enable Fail2Ban (Optional)
sudo apt-get install fail2ban sudo systemctl enable fail2ban -
SSL Certificates - Use Let's Encrypt or your own certificates
-
SSH Key Authentication - Disable password auth for SSH
-
Regular Updates
sudo apt-get update && sudo apt-get upgrade sudo -u tak /home/tak/.opentakserver_venv/bin/pip install --upgrade OpenTAKServer
# Stop services
sudo systemctl stop opentakserver eud_handler eud_handler_ssl
# Update
sudo -u tak /home/tak/.opentakserver_venv/bin/pip install --upgrade OpenTAKServer
# Restart services
sudo systemctl start opentakserver eud_handler eud_handler_ssl# Stop and disable services
sudo systemctl stop opentakserver eud_handler eud_handler_ssl mediamtx sanity-check.timer alert-check.timer
sudo systemctl disable opentakserver eud_handler eud_handler_ssl mediamtx sanity-check.timer alert-check.timer
# Remove service files
sudo rm /etc/systemd/system/{opentakserver,eud_handler,eud_handler_ssl,mediamtx,sanity-check,alert-check}.{service,timer}
sudo systemctl daemon-reload
# Remove scripts
sudo rm /usr/local/bin/{sanity-check,alert-check}
# Remove user and data
sudo userdel -r tak
# Remove database
sudo -u postgres dropdb ots
sudo -u postgres dropuser ots
# Remove configs
sudo rm -rf /etc/gridbase
sudo rm /root/gridbase-credentials.txt- Issues: Report bugs or request features
- Documentation: Contributions welcome
- Security: Report vulnerabilities privately
MIT License - See LICENSE file
Built on:
- OpenTAKServer
- MediaMTX
- PostgreSQL, RabbitMQ, nginx
Made with ☕ for the TAK community