Skip to main content
This guide covers advanced configuration options for McDis-RCON, including the Flask download server, backup management, and performance optimization.

Flask Server Configuration

The Flask server enables downloading files larger than Discord’s 5MB limit.

Basic Setup

Flask:
  Allow: true
  IP: '0.0.0.0'
  Port: 8000

Allow

Enable/disable Flask serverType: BooleanDefault: false

IP

IP address to bind toType: StringDefault: '0.0.0.0'

Port

Port to listen onType: IntegerDefault: 8000

IP Address Configuration

For testing on the same machine:
Flask:
  Allow: true
  IP: '127.0.0.1'
  Port: 8000
Access: Only from the same machineUse case: Testing, local development
For access within your local network:
Flask:
  Allow: true
  IP: '0.0.0.0'
  Port: 8000
Access: Any device on your local networkUse case: Home server, local team
For external access:
Flask:
  Allow: true
  IP: '123.45.67.89'  # Your public IP
  Port: 8000
Requirements:
  • Port forwarding configured
  • Firewall allows port 8000
  • Static IP or DDNS
Use case: Remote administration, distributed team

Port Selection

Port Conflicts: Ensure the chosen port is not already in use:
# Linux
sudo netstat -tulpn | grep :8000

# If in use, choose a different port
Common ports:
  • 8000 - Default, commonly used for development
  • 8080 - Alternative HTTP port
  • 5000 - Another common Flask default
  • 3000-9000 - Generally safe range
Avoid:
  • 80 - HTTP (requires root/admin)
  • 443 - HTTPS (requires root/admin)
  • 25565 - Minecraft default
  • Ports below 1024 (require elevated permissions)

Firewall Configuration

# Allow Flask port
sudo ufw allow 8000/tcp

# Check status
sudo ufw status

Router Port Forwarding

For external access, configure port forwarding:
1

Access Router Admin

Navigate to your router’s admin panel (usually 192.168.1.1 or 192.168.0.1)
2

Find Port Forwarding

Look for “Port Forwarding”, “Virtual Server”, or “NAT” settings
3

Add Rule

  • External Port: 8000
  • Internal Port: 8000
  • Internal IP: Your server’s local IP
  • Protocol: TCP
4

Save and Test

Save the rule and test from an external network

Flask Security

Single-Use Links

Configure links to expire after one downloadSet in Discord: Tools → Flask → Single Use

Temporary Links

Links expire automatically after timeSet in Discord: Tools → Flask → Temporary

IP Restrictions

Bind to specific IP for limited access
IP: '192.168.1.100'

Reverse Proxy

Use nginx/Apache for HTTPS and rate limitingRecommended for production

Flask with Reverse Proxy

For production, use nginx as a reverse proxy:
# /etc/nginx/sites-available/mcdis
server {
    listen 80;
    server_name mcdis.yourdomain.com;
    
    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}
With this setup:
  • McDis Flask runs on 127.0.0.1:8000 (not public)
  • Nginx handles public traffic on port 80
  • Add SSL with Let’s Encrypt for HTTPS
This provides better security, logging, and allows HTTPS.

Backup Configuration

Retention Policy

### Number of backups that McDis will save.
### Valid Values: [1, 5] (inclusive)
### Default Value: 3
Backups: 3
How it works:
  • McDis keeps the N most recent backups per process
  • Oldest backups are automatically deleted
  • Backups are numbered 1 (newest) to N (oldest)

Choosing Backup Count

Pros:
  • Minimal disk usage
  • Simple management
Cons:
  • No version history
  • If backup fails, you have nothing
Use case: Very limited disk space, frequent external backups
Pros:
  • Can roll back one version
  • Low disk usage
Cons:
  • Limited history
Use case: Small servers, tight disk space
Pros:
  • Extensive version history
  • More recovery options
Cons:
  • Higher disk usage
  • Older backups may be less useful
Use case: Critical servers, ample disk space, frequent changes

Disk Space Planning

Estimate disk space needed:
Total space = (Server size) × (Number of backups) × (Number of servers)
Example:
  • 3 servers, 2GB each
  • Backups: 3
  • Total: 3 servers × 2GB × 3 backups = 18GB
Monitor disk usage regularly:
df -h
du -sh McDis/.mdbackups/*

Backup Compression

Backups are stored as ZIP archives:
  • Compression: Standard ZIP compression (reduces size ~20-40%)
  • Format: .zip (compatible with all OS)
  • Structure: Entire process folder is compressed

Performance Optimization

Console Output Tuning

Reduce console relay overhead:
blacklist:
  - 'Can\'t keep up'
  - 'moved too quickly'
  - 'logged in'
  - 'logged out'
  - 'lost connection'
  - 'ServerConnector'
Benefits:
  • Reduced Discord API calls
  • Less bandwidth usage
  • Faster console processing
  • Cleaner console threads

Memory Allocation

McDis-RCON Memory:
  • Base usage: ~50-100MB
  • Per process: ~10-20MB
  • Console buffers: ~5MB per active process
Total System Memory Planning:
Total RAM needed = OS (2-4GB) + 
                   McDis (100MB) + 
                   Server 1 (Xmx) + 
                   Server 2 (Xmx) + ...
Example for 16GB system:
  • OS: 4GB
  • McDis: 0.5GB
  • Available for servers: 11.5GB
  • Allocate: 8GB server + 2GB proxy = 10GB
  • Remaining: 1.5GB buffer

Process Priority

On Linux, you can set process priority:
# Start McDis with nice (lower priority)
nice -n 10 mcdis run

# Or set priority after starting
renice -n 10 -p $(pgrep -f "mcdis run")
Lower priority (higher nice value) ensures Minecraft servers get CPU priority over McDis.

Multiple McDis Instances

You can run multiple McDis instances:
Do NOT run multiple instances with the same Panel ID! This will cause conflicts.
Correct setup:
# Instance 1
cd /path/to/mcdis1
mcdis run  # Uses Panel ID: 111111111

# Instance 2  
cd /path/to/mcdis2
mcdis run  # Uses Panel ID: 222222222
Each instance manages different servers in different folders with different panel channels.

Environment-Specific Configurations

Development Environment

# dev_config.yml
Bot Token: DEV_BOT_TOKEN
Panel ID: 111111111111  # Dev channel
Language: en
Backups: 5  # Keep more for testing

Flask:
  Allow: true
  IP: '127.0.0.1'  # Local only
  Port: 8000

Processes:
  Servers:
    test_server:
      start_cmd: java -Xms1G -Xmx2G -jar paper.jar nogui
      stop_cmd: stop
      blacklist: []  # See everything during development

Production Environment

# md_config.yml
Bot Token: PROD_BOT_TOKEN
Panel ID: 999999999999  # Prod channel
Language: en
Backups: 3

Flask:
  Allow: true
  IP: '0.0.0.0'  # Public access
  Port: 8000

Processes:
  Networks:
    velocity:
      start_cmd: java -Xms1G -Xmx2G -XX:+UseG1GC -jar velocity.jar
      stop_cmd: end
      blacklist:
        - 'logged in'
        - 'has disconnected'
        - 'ServerConnector'
        
  Servers:
    lobby:
      start_cmd: java -Xms4G -Xmx4G -XX:+UseG1GC -jar paper.jar nogui
      stop_cmd: stop
      blacklist:
        - 'Can\'t keep up'
        - 'moved too quickly'

Language Customization

McDis supports English and Spanish:
Language: en  # English (default)
# or
Language: es  # Spanish
What changes:
  • Discord panel messages
  • Button labels
  • Error messages
  • Command responses
  • Console output from McDis
What doesn’t change:
  • Minecraft server console (depends on server config)
  • Plugin output
  • Your process names

Configuration Templates

Small Home Server

Bot Token: YOUR_TOKEN
Panel ID: YOUR_CHANNEL_ID
Language: en
Backups: 2

Flask:
  Allow: false  # Not needed for small files
  IP: '0.0.0.0'
  Port: 8000

Processes:
  Networks:
  
  Servers:
    vanilla:
      start_cmd: java -Xms2G -Xmx4G -jar server.jar nogui
      stop_cmd: stop
      blacklist:
        - 'Can\'t keep up'

Large Multi-Server Network

Bot Token: YOUR_TOKEN
Panel ID: YOUR_CHANNEL_ID
Language: en
Backups: 3

Flask:
  Allow: true
  IP: '123.45.67.89'
  Port: 8000

Processes:
  Networks:
    velocity:
      start_cmd: java -Xms2G -Xmx3G -XX:+UseG1GC -jar velocity.jar
      stop_cmd: end
      blacklist: ['logged in', 'has disconnected', 'ServerConnector']
        
  Servers:
    lobby:
      start_cmd: java -Xms4G -Xmx4G -XX:+UseG1GC -jar paper.jar nogui
      stop_cmd: stop
      blacklist: ['Can\'t keep up']
      
    survival:
      start_cmd: java -Xms12G -Xmx12G -XX:+UseG1GC -jar paper.jar nogui
      stop_cmd: stop
      blacklist: ['Can\'t keep up', 'moved too quickly']
      
    creative:
      start_cmd: java -Xms6G -Xmx6G -XX:+UseG1GC -jar paper.jar nogui
      stop_cmd: stop
      blacklist: ['Can\'t keep up']
      
    minigames:
      start_cmd: java -Xms4G -Xmx8G -XX:+UseG1GC -jar paper.jar nogui
      stop_cmd: stop
      blacklist: ['Can\'t keep up']

Troubleshooting Advanced Configuration

Check:
  • Port already in use: netstat -tulpn | grep :8000
  • Firewall blocking port
  • Invalid IP address
  • Permission issues (ports < 1024)
Solution:
  • Choose different port
  • Configure firewall
  • Verify IP in config
  • Use ports ≥ 1024
Check:
  • Port forwarding configured?
  • Firewall allows incoming?
  • Using public IP, not 127.0.0.1?
  • ISP blocking port?
Solution:
  • Set up port forwarding
  • Open firewall port
  • Use '0.0.0.0' or public IP
  • Try different port
Solution:
  • Reduce Backups setting
  • Clean up old backups manually
  • Increase disk space
  • Compress/archive old backups externally
Possible causes:
  • Too many processes
  • Console output flooding
  • Memory leak (rare)
Solution:
  • Reduce number of processes
  • Add more to blacklist
  • Restart McDis periodically

Configuration Overview

Complete configuration reference

Process Setup

Configure servers and networks

File Manager

Using Flask downloads

Backup System

Backup management details

Build docs developers (and LLMs) love