EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
Loading...
Searching...
No Matches
Quick Start Guide

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)

  1. Go to https://cloud.digitalocean.com/apps
  2. Click "Create App"
  3. Select "GitHub" → "rmm-psa-meshcentral" repository
  4. Click "Import from GitHub" (it will detect app.yaml)
  5. 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)
  6. 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:

  1. In App Platform, go to Settings → Domains
  2. Click "Add Domain"
  3. Enter mesh.everydaytech.au
  4. Add CNAME record in your DNS:
    mesh.everydaytech.au CNAME meshcentral-xxxxx.ondigitalocean.app
  5. Update MESHCENTRAL_DOMAIN environment variable to mesh.everydaytech.au
  6. Redeploy the app

5. Initial Setup

Once deployed:

  1. Visit your MeshCentral URL (e.g., https://meshcentral-xxxxx.ondigitalocean.app)
  2. Create the first admin account:
    • Username: apiuser (or your preference)
    • Email: martin+api@independentbusinessgroup.com.au
    • Password: Generate a strong password
  3. 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

  1. Edit config.json or app.yaml
  2. Commit and push changes:
    git add .
    git commit -m "Update configuration"
    git push
  3. 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

  1. Check logs for errors
  2. Verify MESHCENTRAL_SESSION_KEY is set
  3. Clear browser cache
  4. 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:

  1. ✅ Test MeshCentral web interface
  2. ✅ Create admin account
  3. ✅ Update backend .env
  4. ✅ Test API integration
  5. ✅ Install MeshAgent on test VM
  6. ✅ Test remote desktop functionality
  7. ✅ Sync devices to agents table