Setup MeshCentral on App Platform
1. Create GitHub Repository
cd /home/cw/Documents/IBG_HUB/rmm-psa-meshcentral
# Using GitHub CLI (easiest)
gh repo create rmm-psa-meshcentral --private --source=. --remote=origin --push
# Or manually
git remote add origin https://github.com/Independent-Business-Group/rmm-psa-meshcentral.git
git push -u origin main
2. Generate Session Key
openssl rand -hex 32
# Save this value - you'll need it for MESHCENTRAL_SESSION_KEY
3. Deploy to App Platform
Option A: Using Web Console (Recommended)
- Go to https://cloud.digitalocean.com/apps
- Click "Create App"
- Select "GitHub" → "rmm-psa-meshcentral" repository
- Click "Import from GitHub" (it will detect app.yaml)
- Update environment variables:
- MESHCENTRAL_SESSION_KEY: Paste the key from step 2
- MESHCENTRAL_DOMAIN: Will be auto-filled with app URL (update later if using custom domain)
- Click "Create Resources"
Option B: Using doctl CLI
# Install doctl if needed
brew install doctl # or snap install doctl on Linux
# Authenticate
doctl auth init
# Create app
doctl apps create --spec .digitalocean/app.yaml
# Get app ID
doctl apps list
# Update environment variables
doctl apps update <app-id> --spec .digitalocean/app.yaml
4. Configure Custom Domain (Optional)
If you want to use mesh.everydaytech.au:
- In App Platform, go to Settings → Domains
- Click "Add Domain"
- Enter mesh.everydaytech.au
- Add CNAME record in your DNS:
mesh.everydaytech.au CNAME meshcentral-xxxxx.ondigitalocean.app
- Update MESHCENTRAL_DOMAIN environment variable to mesh.everydaytech.au
- Redeploy the app
5. Initial Setup
Once deployed:
- Visit your MeshCentral URL (e.g., https://meshcentral-xxxxx.ondigitalocean.app)
- Create the first admin account:
- Username: apiuser (or your preference)
- Email: martin+api@independentbusinessgroup.com.au
- Password: Generate a strong password
- Create a login token for API access:
- Go to My Account → Account Security
- Click "Add" under "Login Tokens"
- Name: everydaytech
- Expiration: Never
- Copy the token username (starts with ~t:)
6. Update Backend Configuration
Update /home/cw/Documents/IBG_HUB/rmm-psa-backend/.env:
MESHCENTRAL_URL=https://mesh.everydaytech.au # or your App Platform URL
MESHCENTRAL_USERNAME=apiuser
MESHCENTRAL_PASSWORD=your_password_here
7. Test API Integration
cd /home/cw/Documents/IBG_HUB/rmm-psa-backend
node test-meshcentral-api.js
Testing Locally (Optional)
Before deploying to App Platform, you can test locally:
# Copy environment variables
cp .env.example .env
# Edit .env with your values
nano .env
# Build and run with Docker
./test-local.sh
# View logs
docker logs -f meshcentral-test
# Access at https://localhost:4430
Maintenance
View Logs
doctl apps logs <app-id> --type run
Restart App
doctl apps restart <app-id>
Update Configuration
- Edit config.json or app.yaml
- Commit and push changes:
git add .
git commit -m "Update configuration"
git push
- App will auto-deploy from GitHub
Database Backup
pg_dump -h rmm-psa-db-do-user-28531160-0.i.db.ondigitalocean.com \
-p 25060 -U doadmin -d meshcentral > meshcentral_backup_$(date +%Y%m%d).sql
Database Restore
psql -h rmm-psa-db-do-user-28531160-0.i.db.ondigitalocean.com \
-p 25060 -U doadmin -d meshcentral < meshcentral_backup.sql
Cost
- App Platform (Basic - XS): ~$5/month
- PostgreSQL: Shared with existing cluster (no additional cost)
- Total: ~$5/month
Troubleshooting
App won't start
Check environment variables are set correctly:
doctl apps get <app-id> --format JSON | jq '.spec.services[0].envs'
Database connection fails
Verify database exists:
PGPASSWORD='AVNS_J8RJAmsEwsHFG52_-F2' psql \
-h rmm-psa-db-do-user-28531160-0.i.db.ondigitalocean.com \
-p 25060 -U doadmin -d meshcentral -c "\dt"
Can't log in
- Check logs for errors
- Verify MESHCENTRAL_SESSION_KEY is set
- Clear browser cache
- Try incognito/private mode
Migration from Docker
To migrate from your existing Docker setup:
# 1. Export users from old database
docker exec meshcentral cat /opt/meshcentral/meshcentral-data/meshcentral.db > old_db.json
# 2. The new App Platform deployment will start fresh
# 3. Manually recreate admin accounts
# 4. Agents will need to be reinstalled with new server URL
Next Steps
After successful deployment:
- ✅ Test MeshCentral web interface
- ✅ Create admin account
- ✅ Update backend .env
- ✅ Test API integration
- ✅ Install MeshAgent on test VM
- ✅ Test remote desktop functionality
- ✅ Sync devices to agents table