MeshCentral deployment for DigitalOcean App Platform with PostgreSQL backend.
Features
- ✅ PostgreSQL database backend (instead of NeDB)
- ✅ Automatic deployments from GitHub
- ✅ HTTPS with automatic certificates
- ✅ WebSocket support for agents and remote desktop
- ✅ Persistent data storage
- ✅ Health checks and auto-restart
Setup Instructions
1. Create PostgreSQL Database
Create a new database in your existing DO managed PostgreSQL cluster:
psql "postgresql://doadmin:AVNS_J8RJAmsEwsHFG52_-F2@rmm-psa-db-do-user-28531160-0.i.db.ondigitalocean.com:25060/defaultdb?sslmode=require" -c "CREATE DATABASE meshcentral;"
2. Initialize Git Repository
cd /home/cw/Documents/IBG_HUB/rmm-psa-meshcentral
git init
git add .
git commit -m "Initial MeshCentral setup for App Platform"
git remote add origin https://github.com/Independent-Business-Group/rmm-psa-meshcentral.git
git push -u origin main
3. Deploy to App Platform
Option A: Using DigitalOcean CLI (doctl)
doctl apps create --spec .digitalocean/app.yaml
Option B: Using Web Console
- Go to https://cloud.digitalocean.com/apps
- Click "Create App"
- Choose GitHub and select rmm-psa-meshcentral repository
- Import the app.yaml configuration
- Update environment variables:
- MESHCENTRAL_SESSION_KEY: Generate random string (e.g., openssl rand -hex 32)
- Update MESHCENTRAL_DOMAIN with your actual App Platform URL or custom domain
4. Configure Custom Domain (Optional)
If using a custom domain like mesh.everydaytech.au:
- Add domain in App Platform settings
- Add DNS records:
mesh.everydaytech.au CNAME meshcentral-xxxxx.ondigitalocean.app
- Update MESHCENTRAL_DOMAIN environment variable
5. Create Initial Admin Account
Once deployed, visit your MeshCentral URL and create the first admin account.
Database Schema
MeshCentral will automatically create these PostgreSQL tables:
- meshcentral_main - Main objects (users, devices, meshes)
- meshcentral_events - Event log
- meshcentral_power - Power events
- meshcentral_stats - Statistics
- meshcentral_smbios - Hardware information
Configuration
Edit config.json to customize MeshCentral settings:
- Domain settings
- Authentication options
- User permissions
- Session timeouts
- Agent configurations
Environment Variables
Required:
- MESHCENTRAL_DOMAIN - Your domain (e.g., mesh.everydaytech.au)
- MESHCENTRAL_SESSION_KEY - Random session encryption key
- POSTGRES_HOST - Database host
- POSTGRES_PORT - Database port (25060)
- POSTGRES_USER - Database user (doadmin)
- POSTGRES_PASSWORD - Database password
- POSTGRES_DB - Database name (meshcentral)
Optional:
- SMTP_HOST, SMTP_PORT, SMTP_FROM, SMTP_USER, SMTP_PASSWORD - Email notifications
Integrating with RMM Backend
Update your backend .env file:
MESHCENTRAL_URL=https://mesh.everydaytech.au # or your App Platform URL
MESHCENTRAL_USERNAME=apiuser
MESHCENTRAL_PASSWORD=your_password
Maintenance
Viewing Logs
doctl apps logs <app-id> --type run
Restarting
doctl apps restart <app-id>
Database Backup
pg_dump -h rmm-psa-db-do-user-28531160-0.i.db.ondigitalocean.com -p 25060 -U doadmin -d meshcentral > meshcentral_backup.sql
Troubleshooting
MeshCentral won't start
- Check logs: doctl apps logs <app-id>
- Verify PostgreSQL connection
- Ensure MESHCENTRAL_SESSION_KEY is set
- Check domain configuration
Agents can't connect
- Verify port 4433 is accessible
- Check agent configuration in MeshCentral
- Ensure agentPort and agentAliasPort are correct in config.json
Database connection issues
- Verify PostgreSQL database exists: CREATE DATABASE meshcentral;
- Check firewall rules allow App Platform IP
- Verify SSL connection settings
Migration from Docker
To migrate from your existing Docker setup:
- Stop the Docker container: docker stop meshcentral
- Export the database from Docker:
docker exec meshcentral cat /opt/meshcentral/meshcentral-data/meshcentral.db > meshcentral_old.db
- Use MeshCentral's migration tool (if available) or manually recreate users in the new setup
- Update agents to point to the new URL
Cost Estimate
- App Platform (Basic - XS): ~$5/month
- PostgreSQL database: Shared with existing cluster (~$0 additional)
- Total: ~$5/month
Support