Deployment Production - anubissbe/ProjectHub-Mcp GitHub Wiki

🐳 Production Server Deployment Guide

Deploy ProjectHub-MCP to your production server for a robust, self-hosted project management solution. This guide provides deployment instructions for any Docker-enabled server.

🎯 Prerequisites

Hardware Requirements

  • Server Requirements: Linux server with Docker support
  • RAM: Minimum 4GB, recommended 8GB+
  • Storage: At least 10GB free space
  • Docker Package: Installed from Package Center

Network Requirements

  • SSH Access: Enabled on your server
  • Available Ports: 3008 (backend), 5174 (frontend), 5433 (database)
  • Internet Access: For Docker image downloads

Access Requirements

  • SSH Credentials: Your server username and SSH port
  • Admin Access: Root or sudo privileges
  • Docker Experience: Basic familiarity with Docker commands

🚀 Quick Deployment (Recommended)

One-Command Installation

This single command deploys the complete, working ProjectHub-MCP stack:

ssh username@your-server-ip 'docker stop projecthub-backend projecthub-frontend projecthub-postgres 2>/dev/null; docker rm projecthub-backend projecthub-frontend projecthub-postgres 2>/dev/null; docker network create root_projecthub-network 2>/dev/null; docker run -d --name projecthub-postgres -e POSTGRES_USER=projecthub -e POSTGRES_PASSWORD=projecthub_password -e POSTGRES_DB=projecthub_mcp -p 5433:5432 --network root_projecthub-network postgres:15-alpine && docker run -d --name projecthub-backend -p 3008:3001 -e DATABASE_URL=postgresql://projecthub:projecthub_password@projecthub-postgres:5432/projecthub_mcp -e JWT_SECRET=your-secret-key-here -e CORS_ORIGIN="*" --network root_projecthub-network telkombe/projecthub-backend:complete-v4.7.1 && docker run -d --name projecthub-frontend -p 5174:80 --network root_projecthub-network telkombe/projecthub-frontend:latest'

Verification

After deployment, verify everything is working:

# Check containers are running
ssh -p 2222 [email protected] 'docker ps | grep projecthub'

# Test frontend
curl http://192.168.1.24:5174/

# Test backend API
curl http://192.168.1.24:3008/health

📋 Step-by-Step Deployment

Step 1: Connect to Synology

# SSH to your Synology NAS
ssh -p 2222 [email protected]

Step 2: Prepare Environment

# Clean any existing deployment
docker stop projecthub-backend projecthub-frontend projecthub-postgres 2>/dev/null
docker rm projecthub-backend projecthub-frontend projecthub-postgres 2>/dev/null

# Create Docker network
docker network create root_projecthub-network 2>/dev/null

Step 3: Deploy Database

docker run -d \
  --name projecthub-postgres \
  -e POSTGRES_USER=projecthub \
  -e POSTGRES_PASSWORD=projecthub_password \
  -e POSTGRES_DB=projecthub_mcp \
  -p 5433:5432 \
  --network root_projecthub-network \
  --restart unless-stopped \
  postgres:15-alpine

Step 4: Deploy Backend

docker run -d \
  --name projecthub-backend \
  -p 3008:3001 \
  -e DATABASE_URL=postgresql://projecthub:projecthub_password@projecthub-postgres:5432/projecthub_mcp \
  -e JWT_SECRET=your-secret-key-here \
  -e CORS_ORIGIN="*" \
  --network root_projecthub-network \
  --restart unless-stopped \
  telkombe/projecthub-backend:complete-v4.7.1

Step 5: Deploy Frontend

docker run -d \
  --name projecthub-frontend \
  -p 5174:80 \
  --network root_projecthub-network \
  --restart unless-stopped \
  telkombe/projecthub-frontend:latest

🔧 Configuration Options

Environment Variables

Backend Configuration

Variable Description Default Required
DATABASE_URL PostgreSQL connection string - Yes
JWT_SECRET Secret for JWT tokens - Yes
CORS_ORIGIN Allowed origins * No
PORT Internal port 3001 No

Security Configuration

# Generate secure JWT secret
openssl rand -hex 32

# Example strong configuration
-e JWT_SECRET=a1b2c3d4e5f6789012345678901234567890abcdef
-e CORS_ORIGIN=http://192.168.1.24:5174

Network Configuration

# Create custom network with specific subnet
docker network create \
  --driver bridge \
  --subnet=172.20.0.0/16 \
  root_projecthub-network

Storage Configuration

# Create persistent volumes
docker volume create projecthub-postgres-data
docker volume create projecthub-uploads

# Use in deployment
-v projecthub-postgres-data:/var/lib/postgresql/data
-v projecthub-uploads:/app/uploads

🐳 Docker Compose Deployment

Create a docker-compose.yml file on your Synology:

version: '3.8'

services:
  postgres:
    image: postgres:15-alpine
    container_name: projecthub-postgres
    environment:
      POSTGRES_USER: projecthub
      POSTGRES_PASSWORD: projecthub_password
      POSTGRES_DB: projecthub_mcp
    ports:
      - "5433:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data
    networks:
      - projecthub-network
    restart: unless-stopped

  backend:
    image: telkombe/projecthub-backend:complete-v4.7.1
    container_name: projecthub-backend
    environment:
      DATABASE_URL: postgresql://projecthub:projecthub_password@postgres:5432/projecthub_mcp
      JWT_SECRET: your-secret-key-here
      CORS_ORIGIN: "*"
    ports:
      - "3008:3001"
    depends_on:
      - postgres
    networks:
      - projecthub-network
    restart: unless-stopped

  frontend:
    image: telkombe/projecthub-frontend:latest
    container_name: projecthub-frontend
    ports:
      - "5174:80"
    depends_on:
      - backend
    networks:
      - projecthub-network
    restart: unless-stopped

volumes:
  postgres_data:

networks:
  projecthub-network:
    driver: bridge

Deploy with:

docker-compose up -d

🔒 Security Hardening

SSL/TLS Configuration

# Using Synology reverse proxy
# 1. Go to DSM > Control Panel > Application Portal
# 2. Create reverse proxy rule:
#    - Source: projecthub.your-domain.com:443
#    - Destination: localhost:5174

Firewall Configuration

# Allow only necessary ports
# In DSM > Control Panel > Security > Firewall
# Create rules for:
# - Port 5174 (HTTPS frontend)
# - Port 3008 (Backend API - internal only)
# - Port 5433 (Database - internal only)

User Access Control

# Create dedicated user in DSM
# Assign minimal required permissions
# Use strong passwords and 2FA

📊 Monitoring and Maintenance

Health Monitoring

# Check container health
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"

# Check resource usage
docker stats projecthub-backend projecthub-frontend projecthub-postgres

# Check logs
docker logs projecthub-backend --tail 50
docker logs projecthub-frontend --tail 50
docker logs projecthub-postgres --tail 50

Backup Strategy

# Database backup
docker exec projecthub-postgres pg_dump -U projecthub projecthub_mcp > backup.sql

# Volume backup
docker run --rm -v projecthub-postgres-data:/data -v $(pwd):/backup alpine tar czf /backup/postgres-backup.tar.gz /data

# Automated backup script
cat > /volume1/scripts/projecthub-backup.sh << 'EOF'
#!/bin/bash
BACKUP_DIR="/volume1/backups/projecthub"
DATE=$(date +%Y%m%d_%H%M%S)

mkdir -p $BACKUP_DIR

# Database backup
docker exec projecthub-postgres pg_dump -U projecthub projecthub_mcp > $BACKUP_DIR/db_$DATE.sql

# Keep only last 7 days
find $BACKUP_DIR -name "db_*.sql" -mtime +7 -delete
EOF

chmod +x /volume1/scripts/projecthub-backup.sh

Update Procedure

# Pull latest images
docker pull telkombe/projecthub-backend:complete-v4.7.1
docker pull telkombe/projecthub-frontend:latest

# Recreate containers
docker-compose down
docker-compose up -d

# Verify update
curl http://192.168.1.24:3008/health

🔍 Troubleshooting

Common Issues

Container Won't Start

# Check logs
docker logs projecthub-backend

# Check port conflicts
netstat -tuln | grep -E "3008|5174|5433"

# Check disk space
df -h

Database Connection Issues

# Test database connectivity
docker exec projecthub-postgres pg_isready -U projecthub

# Check database logs
docker logs projecthub-postgres

# Manual connection test
docker exec -it projecthub-postgres psql -U projecthub -d projecthub_mcp

Frontend Not Accessible

# Check nginx configuration
docker exec projecthub-frontend cat /etc/nginx/conf.d/default.conf

# Test internal connectivity
docker exec projecthub-frontend wget -q -O- http://projecthub-backend:3001/health

Performance Issues

# Check resource limits
docker stats

# Increase PostgreSQL memory
docker run ... postgres:15-alpine -c shared_buffers=256MB -c max_connections=100

# Monitor Synology resources
cat /proc/meminfo | grep Available
top -bn1 | grep load

Recovery Procedures

Database Recovery

# Stop services
docker stop projecthub-backend projecthub-frontend

# Restore database
docker exec -i projecthub-postgres psql -U projecthub -d projecthub_mcp < backup.sql

# Restart services
docker start projecthub-backend projecthub-frontend

Complete System Recovery

# Remove everything
docker-compose down -v

# Restore from backup
# ... restore database and volumes ...

# Redeploy
docker-compose up -d

📋 Maintenance Schedule

Daily Tasks

  • Check application accessibility
  • Monitor container health
  • Review error logs

Weekly Tasks

  • Create database backup
  • Check disk space usage
  • Review access logs

Monthly Tasks

  • Update Docker images
  • Security audit
  • Performance review

🌐 Access Information

After successful deployment:

Default Credentials

Network Access

  • Internal Network: Full access to all services
  • External Access: Only frontend on port 5174 (configure firewall accordingly)

🆘 Support

Synology-Specific Support

  • DSM Documentation: Official Synology guides
  • Community Forums: Synology community support
  • Docker on Synology: Docker package documentation

ProjectHub-MCP Support


Last Updated: July 3, 2025 • Version: 4.7.1

💡 Production Ready: This deployment configuration is currently running in production and serves as the live demo at http://192.168.1.24:5174