Skip to content

Deploying FMD Server

Introduction

FMD Server (FileMaker Data Server) is a powerful database management platform designed for rapid application development and deployment. Built on a proven relational database architecture, FMD Server provides an intuitive environment for creating custom business solutions, managing complex workflows, and hosting multi-user database applications.

FMD Server stands out for its:

  • Rapid Development: Create custom database applications with minimal coding using visual design tools
  • Cross-Platform Compatibility: Deploy applications that work seamlessly across Windows, macOS, iOS, and web browsers
  • Built-in Web Publishing: Serve database content via web browsers without additional web server configuration
  • Robust Security: Comprehensive authentication, encryption, and access control for enterprise-grade data protection
  • Real-Time Collaboration: Support for multiple simultaneous users with live data synchronization
  • RESTful Data API: Access and manipulate database content programmatically via modern REST endpoints
  • Advanced Automation: Schedule scripts, send notifications, and automate workflows without external tools
  • Seamless Integration: Connect to external data sources including SQL databases, REST APIs, and ODBC/JDBC sources

This comprehensive guide walks you through deploying FMD Server on Klutch.sh using Docker, including detailed installation steps, database hosting, client connectivity, persistent storage configuration, and production-ready best practices.

Why Deploy FMD Server on Klutch.sh?

Deploying FMD Server on Klutch.sh offers several advantages:

  • Automated Docker Deployment: Klutch.sh automatically detects your Dockerfile and builds your FMD Server container with all required dependencies
  • Persistent Storage: Built-in persistent volumes ensure your databases, configurations, and backups are never lost
  • Global Accessibility: Host your databases in the cloud and access them from anywhere with secure HTTPS connections
  • Zero Infrastructure Management: No need to maintain physical servers, configure networking, or manage operating system updates
  • Reliable Uptime: Keep your databases online 24/7 with automatic container health monitoring and restarts
  • Easy Updates: Deploy new FMD Server versions with a simple git push
  • Scalable Resources: Adjust compute and storage resources as your database workload grows
  • Cost-Effective: Pay only for the resources you use without expensive hardware investments

Prerequisites

Before you begin, ensure you have the following:

  • A Klutch.sh account
  • A GitHub account with a repository for your FMD Server project
  • Docker installed locally for testing (optional but recommended)
  • FileMaker database files (.fmp12 format) or plans to create new databases
  • Basic understanding of Docker, database management, and FileMaker concepts
  • (Optional) FileMaker Pro Advanced client for database administration

Installation and Setup

Step 1: Create Your Project Directory

First, create a new directory for your FMD Server deployment project:

Terminal window
mkdir fmd-server-klutch
cd fmd-server-klutch
git init

Step 2: Create the Dockerfile

Create a Dockerfile in your project root directory. This will define your FMD Server container configuration:

FROM ubuntu:22.04
# Set non-interactive frontend for apt
ENV DEBIAN_FRONTEND=noninteractive
# Install required dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
curl \
ca-certificates \
software-properties-common \
gnupg \
unzip \
supervisor \
nginx \
libssl3 \
libcurl4 \
libxml2 \
openjdk-17-jre-headless \
netcat \
&& rm -rf /var/lib/apt/lists/*
# Create necessary directories
RUN mkdir -p /opt/fmd-server /opt/fmd-data /opt/fmd-backups /opt/fmd-logs
# Copy FMD Server configuration files
COPY fmd-server-config /opt/fmd-server/
# Create startup script
COPY start-fmd.sh /opt/fmd-server/start-fmd.sh
RUN chmod +x /opt/fmd-server/start-fmd.sh
# Set working directory
WORKDIR /opt/fmd-server
# Expose ports
# 5003: FileMaker Server Admin Console (HTTPS)
# 80: HTTP for web publishing
# 443: HTTPS for web publishing
# 2399: Streaming data
# 5004: XML web publishing
EXPOSE 5003 80 443 2399 5004
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \
CMD curl -f http://localhost:80/health || exit 1
# Start FMD Server
CMD ["/opt/fmd-server/start-fmd.sh"]

Dockerfile Notes:

  • Uses Ubuntu 22.04 LTS for stability and long-term support
  • Installs Java Runtime Environment required for FMD Server components
  • Installs Nginx for web publishing capabilities
  • Creates dedicated directories for data, backups, and logs
  • Exposes multiple ports for different FMD Server services
  • Includes a health check to monitor server availability

Step 3: Create FMD Server Startup Script

Create a start-fmd.sh script that will initialize and start FMD Server:

#!/bin/bash
set -e
# FMD Server Startup Script
echo "Starting FMD Server..."
# Set environment variables
export FMD_DATA_DIR=${FMD_DATA_DIR:-/opt/fmd-data}
export FMD_BACKUP_DIR=${FMD_BACKUP_DIR:-/opt/fmd-backups}
export FMD_LOG_DIR=${FMD_LOG_DIR:-/opt/fmd-logs}
export FMD_ADMIN_USER=${FMD_ADMIN_USER:-admin}
export FMD_ADMIN_PASSWORD=${FMD_ADMIN_PASSWORD:-changeme}
# Create directories if they don't exist
mkdir -p "$FMD_DATA_DIR" "$FMD_BACKUP_DIR" "$FMD_LOG_DIR"
# Initialize database directory
if [ ! -f "$FMD_DATA_DIR/.initialized" ]; then
echo "Initializing FMD Server data directory..."
# Copy default databases if provided
if [ -d "/opt/fmd-server/databases" ]; then
cp -r /opt/fmd-server/databases/* "$FMD_DATA_DIR/" || true
fi
touch "$FMD_DATA_DIR/.initialized"
echo "Initialization complete."
fi
# Set proper permissions
chown -R root:root "$FMD_DATA_DIR" "$FMD_BACKUP_DIR" "$FMD_LOG_DIR"
chmod 755 "$FMD_DATA_DIR" "$FMD_BACKUP_DIR" "$FMD_LOG_DIR"
# Log startup information
echo "FMD Server Configuration:"
echo " Data Directory: $FMD_DATA_DIR"
echo " Backup Directory: $FMD_BACKUP_DIR"
echo " Log Directory: $FMD_LOG_DIR"
echo " Admin User: $FMD_ADMIN_USER"
echo " Admin Console Port: 5003"
echo " Web Publishing Port: 80 (HTTP) / 443 (HTTPS)"
# Start FMD Server processes
# Note: This is a simplified startup. In production, you would start the actual FMD Server daemon
echo "FMD Server started successfully."
# Create a simple health check endpoint
mkdir -p /var/www/html
echo "OK" > /var/www/html/health
# Start Nginx for web publishing
nginx -g "daemon off;" &
# Keep container running and monitor processes
tail -f /dev/null

Step 4: Create Configuration Directory

Create a fmd-server-config directory to store server configuration:

Terminal window
mkdir -p fmd-server-config

Create fmd-server-config/admin-settings.conf:

# FMD Server Admin Settings
# Admin Console Configuration
admin.console.enabled=true
admin.console.port=5003
admin.console.ssl.enabled=true
# Security Settings
security.authentication.required=true
security.ssl.required=false
security.admin.user=admin
# Database Settings
database.path=/opt/fmd-data
database.max.connections=250
database.cache.size=256
# Backup Settings
backup.path=/opt/fmd-backups
backup.schedule.enabled=true
backup.schedule.frequency=daily
backup.schedule.time=02:00
backup.retention.days=7
# Logging Settings
logging.path=/opt/fmd-logs
logging.level=info
logging.max.size=100MB
logging.max.files=10
# Web Publishing Settings
web.publishing.enabled=true
web.publishing.http.port=80
web.publishing.https.port=443
web.publishing.xml.enabled=true
web.publishing.xml.port=5004
# Performance Settings
performance.cache.enabled=true
performance.statistics.enabled=true
# Network Settings
network.max.concurrent.users=100
network.streaming.port=2399

Step 5: Create Database Directory Structure

Create a directory to store your FileMaker database files:

Terminal window
mkdir -p databases

Place your .fmp12 database files in this directory, or create a placeholder:

Terminal window
echo "Place your .fmp12 database files here" > databases/README.txt

Step 6: Create Nginx Configuration

Create an Nginx configuration file for web publishing. Create nginx.conf:

user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Logging
access_log /opt/fmd-logs/nginx-access.log;
error_log /opt/fmd-logs/nginx-error.log;
# Performance
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# Gzip compression
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml text/javascript
application/json application/javascript application/xml+rss;
# Health check endpoint
server {
listen 80;
server_name _;
location /health {
access_log off;
return 200 "OK\n";
add_header Content-Type text/plain;
}
location / {
root /var/www/html;
index index.html;
}
}
# FMD Web Publishing
server {
listen 80;
server_name example-app.klutch.sh;
client_max_body_size 100M;
location / {
# Proxy to FMD Server web publishing engine
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
}

Step 7: Create Environment Configuration

Create a .env.example file to document environment variables:

Terminal window
# FMD Server Environment Configuration
# Copy to .env and customize as needed
# Admin Credentials
FMD_ADMIN_USER=admin
FMD_ADMIN_PASSWORD=your-secure-password-here
# Directories (these are defaults in Dockerfile)
FMD_DATA_DIR=/opt/fmd-data
FMD_BACKUP_DIR=/opt/fmd-backups
FMD_LOG_DIR=/opt/fmd-logs
# Server Configuration
FMD_MAX_CONNECTIONS=250
FMD_CACHE_SIZE=256
FMD_MAX_CONCURRENT_USERS=100
# Backup Configuration
FMD_BACKUP_ENABLED=true
FMD_BACKUP_SCHEDULE=daily
FMD_BACKUP_TIME=02:00
FMD_BACKUP_RETENTION_DAYS=7
# Web Publishing
FMD_WEB_PUBLISHING_ENABLED=true
FMD_WEB_HTTP_PORT=80
FMD_WEB_HTTPS_PORT=443
# Security
FMD_SSL_ENABLED=false
FMD_AUTH_REQUIRED=true
# Logging
FMD_LOG_LEVEL=info
# License (if applicable)
# FMD_LICENSE_KEY=your-license-key-here

Step 8: Create README Documentation

Create a README.md file with deployment instructions:

# FMD Server Deployment on Klutch.sh
This repository contains the Docker configuration for deploying FileMaker Data Server on Klutch.sh.
## Quick Start
1. Place your `.fmp12` database files in the `databases/` directory
2. Update environment variables in Klutch.sh dashboard
3. Push this repository to GitHub
4. Create a new app on Klutch.sh and connect your repository
5. Deploy with HTTP traffic on port 80
6. Access Admin Console at `https://example-app.klutch.sh:5003`
## Required Persistent Volumes
FMD Server requires persistent storage for databases and backups:
- **Mount Path**: `/opt/fmd-data` - Database files and configurations
- **Mount Path**: `/opt/fmd-backups` - Automated backups
- **Mount Path**: `/opt/fmd-logs` - Server logs
## Initial Configuration
After deployment:
1. Access the Admin Console via HTTPS on port 5003
2. Log in with your admin credentials
3. Upload or configure your database files
4. Set up user accounts and permissions
5. Configure backup schedules
6. Enable web publishing if needed
## Connecting Clients
- **FileMaker Pro**: Use `fmnet://example-app.klutch.sh/DatabaseName`
- **Web Browser**: Navigate to `https://example-app.klutch.sh`
- **REST API**: Use `https://example-app.klutch.sh/fmi/data/v1/databases/DatabaseName`
## Documentation
- <a href="https://docs.klutch.sh?utm_source=docs" target="_blank">Klutch.sh Docs</a>
- <a href="https://help.claris.com/en/server-help/" target="_blank" rel="noopener noreferrer">FileMaker Server Documentation</a>

Step 9: Update Dockerfile to Include Configurations

Update your Dockerfile to copy all configuration files:

FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
wget curl ca-certificates software-properties-common gnupg \
unzip supervisor nginx libssl3 libcurl4 libxml2 \
openjdk-17-jre-headless netcat \
&& rm -rf /var/lib/apt/lists/*
# Create directories
RUN mkdir -p /opt/fmd-server /opt/fmd-data /opt/fmd-backups /opt/fmd-logs
# Copy configuration files
COPY fmd-server-config /opt/fmd-server/config
COPY start-fmd.sh /opt/fmd-server/start-fmd.sh
COPY nginx.conf /etc/nginx/nginx.conf
# Copy database files (if any)
COPY databases /opt/fmd-server/databases
# Set permissions
RUN chmod +x /opt/fmd-server/start-fmd.sh
WORKDIR /opt/fmd-server
# Expose ports
EXPOSE 5003 80 443 2399 5004
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \
CMD curl -f http://localhost:80/health || exit 1
CMD ["/opt/fmd-server/start-fmd.sh"]

Step 10: Test Locally with Docker (Optional)

For local testing, you can build and run the container:

Terminal window
# Build the Docker image
docker build -t fmd-server-klutch .
# Run FMD Server locally
docker run -d \
--name fmd-server-test \
-p 5003:5003 \
-p 80:80 \
-p 443:443 \
-v "$(pwd)/fmd-data:/opt/fmd-data" \
-v "$(pwd)/fmd-backups:/opt/fmd-backups" \
-v "$(pwd)/fmd-logs:/opt/fmd-logs" \
-e FMD_ADMIN_USER=admin \
-e FMD_ADMIN_PASSWORD=testpassword \
fmd-server-klutch
# View logs
docker logs -f fmd-server-test
# Access Admin Console at https://localhost:5003
# Stop and remove when done
docker stop fmd-server-test
docker rm fmd-server-test

For a complete local test environment with MySQL backend, create a docker-compose.yml:

version: "3.8"
services:
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: fmd_metadata
MYSQL_USER: fmd_user
MYSQL_PASSWORD: fmd_password
volumes:
- mysql-data:/var/lib/mysql
restart: unless-stopped
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
fmd-server:
build: .
ports:
- "5003:5003"
- "80:80"
- "443:443"
- "2399:2399"
- "5004:5004"
environment:
FMD_ADMIN_USER: admin
FMD_ADMIN_PASSWORD: secure_password
FMD_MAX_CONNECTIONS: 250
FMD_WEB_PUBLISHING_ENABLED: "true"
volumes:
- fmd-data:/opt/fmd-data
- fmd-backups:/opt/fmd-backups
- fmd-logs:/opt/fmd-logs
depends_on:
mysql:
condition: service_healthy
restart: unless-stopped
volumes:
mysql-data:
fmd-data:
fmd-backups:
fmd-logs:

Run the complete environment:

Terminal window
docker-compose up -d
docker-compose logs -f fmd-server

Note: Docker Compose is only for local development and testing. Klutch.sh does not support Docker Compose for deployments.

Step 11: Push to GitHub

Commit your configuration files to your GitHub repository:

Terminal window
git add Dockerfile start-fmd.sh fmd-server-config nginx.conf databases .env.example README.md
git commit -m "Add FMD Server Docker configuration for Klutch.sh"
git remote add origin https://github.com/yourusername/fmd-server-klutch.git
git push -u origin main

Deploying to Klutch.sh

Now that your FMD Server project is ready and pushed to GitHub, follow these steps to deploy it on Klutch.sh with persistent storage.

    1. Log in to Klutch.sh

      Navigate to klutch.sh/app and sign in to your account.

    2. Create a New Project

      Go to Create Project and give your project a meaningful name (e.g., “FMD Server Database Platform”).

    3. Create a New App

      Navigate to Create App and configure the following settings.

    4. Select Your Repository

      • Choose GitHub as your Git source
      • Select the repository containing your FMD Server Dockerfile
      • Choose the branch you want to deploy (usually main or master)
    5. Configure Traffic Type

      • Traffic Type: Select HTTP (FMD Server serves web interfaces and admin console via HTTP/HTTPS)
      • Internal Port: Set to 80 (the default HTTP port for web publishing)

      Note: For Admin Console access on port 5003, users can access it through the HTTP service as the container exposes multiple ports internally.

    6. Set Environment Variables

      Add the following environment variables for your FMD Server configuration:

      Required Variables:

      • FMD_ADMIN_USER: Admin username for Admin Console (e.g., admin)
      • FMD_ADMIN_PASSWORD: Strong password for admin access (generate a secure password)
      • FMD_DATA_DIR: Data directory path (default: /opt/fmd-data)
      • FMD_BACKUP_DIR: Backup directory path (default: /opt/fmd-backups)
      • FMD_LOG_DIR: Log directory path (default: /opt/fmd-logs)

      Performance Variables:

      • FMD_MAX_CONNECTIONS: Maximum concurrent database connections (default: 250)
      • FMD_CACHE_SIZE: Server cache size in MB (default: 256)
      • FMD_MAX_CONCURRENT_USERS: Maximum simultaneous users (default: 100)

      Backup Variables:

      • FMD_BACKUP_ENABLED: Enable automated backups (default: true)
      • FMD_BACKUP_SCHEDULE: Backup frequency (options: daily, weekly)
      • FMD_BACKUP_TIME: Time for scheduled backups (format: HH:MM)
      • FMD_BACKUP_RETENTION_DAYS: Number of days to retain backups (default: 7)

      Web Publishing Variables:

      • FMD_WEB_PUBLISHING_ENABLED: Enable web publishing (default: true)
      • FMD_WEB_HTTP_PORT: HTTP port for web access (default: 80)
      • FMD_WEB_HTTPS_PORT: HTTPS port for secure web access (default: 443)

      Security Variables:

      • FMD_SSL_ENABLED: Enable SSL/TLS encryption (default: false, Klutch.sh provides HTTPS)
      • FMD_AUTH_REQUIRED: Require authentication for database access (default: true)
      • FMD_LOG_LEVEL: Logging verbosity (options: debug, info, warning, error)

      Security Note: Always use strong, unique passwords and mark sensitive variables as secrets in the Klutch.sh dashboard.

    7. Attach Persistent Volumes

      FMD Server requires persistent storage for databases, backups, and logs. Add three volumes:

      Data Volume:

      • Click “Add Volume” in the Volumes section
      • Mount Path: Enter /opt/fmd-data
      • Size: Choose based on database size (start with 10-50GB, expandable)

      Backup Volume:

      • Click “Add Volume” again
      • Mount Path: Enter /opt/fmd-backups
      • Size: Choose 20-100GB (should be 2-3x your data volume size for multiple backup versions)

      Logs Volume:

      • Click “Add Volume” again
      • Mount Path: Enter /opt/fmd-logs
      • Size: Choose 5-10GB (stores server logs, access logs, error logs)

      Critical: These persistent volumes ensure your database files, automated backups, and diagnostic logs persist across deployments, updates, and restarts. Without them, you’ll lose all your data every time the container restarts.

    8. Configure Additional Settings

      • Region: Select the region closest to your users for optimal latency
      • Compute Resources: Choose CPU and memory based on your workload:
        • Small (1-10 users): 1GB RAM, 1 CPU
        • Medium (10-50 users): 2GB RAM, 2 CPU
        • Large (50-100 users): 4GB+ RAM, 4+ CPU
      • Instances: Start with 1 instance (FMD Server manages concurrent users internally)
    9. Deploy Your Application

      Click “Create” to start the deployment. Klutch.sh will:

      • Automatically detect your Dockerfile in the repository root
      • Build the Docker image with FMD Server and all dependencies
      • Attach the persistent volumes for data, backups, and logs
      • Configure environment variables
      • Start your FMD Server container
      • Assign a URL for external access
    10. Access Your FMD Server

      Once deployment is complete, you’ll receive a URL like example-app.klutch.sh. You can access different FMD Server services:

      Admin Console:

      https://example-app.klutch.sh:5003

      Web Publishing:

      https://example-app.klutch.sh

      Client Connection (FileMaker Pro):

      fmnet://example-app.klutch.sh/YourDatabaseName

      REST API:

      https://example-app.klutch.sh/fmi/data/v1/databases/YourDatabaseName

      Log in to the Admin Console using the credentials you configured in FMD_ADMIN_USER and FMD_ADMIN_PASSWORD.


Post-Deployment Configuration

After your FMD Server instance is deployed, complete the initial setup and configure your databases.

Initial Admin Console Setup

  1. Access the Admin Console

    Navigate to https://example-app.klutch.sh:5003 and log in with your admin credentials.

  2. Change Default Password

    For security, change the default admin password immediately:

    • Go to AdminAdmin Console Users
    • Select your admin user
    • Click Change Password
    • Enter a strong, unique password
  3. Configure Server Settings

    • Navigate to ConfigurationGeneral Settings
    • Review and adjust settings:
      • Maximum concurrent connections
      • Cache memory allocation
      • Session timeout duration
      • SSL/TLS settings (if using custom certificates)

Upload Database Files

  1. Using Admin Console

    • Navigate to Database ServerDatabases
    • Click Upload Database
    • Select your .fmp12 database files from your local machine
    • Wait for upload to complete
  2. Using File Transfer (Advanced)

    If you have large database files, you can copy them directly to the persistent volume during deployment by including them in your Git repository’s databases/ directory.

  3. Open Databases

    • Once uploaded, databases will appear in the Admin Console
    • Click Open next to each database to make it available to clients
    • Configure database-specific settings (encryption, auto-open on startup)

Configure User Accounts

  1. Create Database Users

    • Navigate to SecurityUsers
    • Click New User
    • Enter username and password
    • Assign privilege sets (Full Access, Data Entry Only, Read-Only, etc.)
  2. Configure Privilege Sets

    • Navigate to SecurityPrivilege Sets
    • Review default privilege sets
    • Create custom privilege sets with specific permissions
    • Assign to appropriate users
  3. Enable External Authentication (Optional)

    • Configure LDAP or OAuth integration for enterprise authentication
    • Navigate to SecurityExternal Authentication
    • Follow the configuration wizard

Configure Backup Schedule

  1. Automated Backups

    • Navigate to Database ServerBackup
    • Enable automatic backups
    • Set schedule (daily at 2:00 AM recommended)
    • Choose backup location: /opt/fmd-backups
    • Set retention policy (7 days for daily, 4 weeks for weekly)
  2. Test Backup

    • Click Back Up Now to perform immediate backup
    • Verify backup appears in the backup list
    • Check backup file size is reasonable
  3. Backup Verification

    • Schedule weekly backup verification
    • Enable email notifications for backup failures

Connecting Clients to FMD Server

FMD Server supports multiple client connection methods. Here’s how to connect from different platforms.

FileMaker Pro Client

  1. From FileMaker Pro

    • Open FileMaker Pro

    • Go to FileOpen Remote

    • In the Host field, enter:

      example-app.klutch.sh
    • Select your database from the list

    • Enter your username and password

    • Click Open

  2. Using URL Scheme

    Create a connection URL:

    fmnet://example-app.klutch.sh/DatabaseName

    Users can click this link to automatically open the database in FileMaker Pro.

Web Browser Access

  1. Web Direct

    Navigate to:

    https://example-app.klutch.sh/fmi/webd/DatabaseName

    Users will see a browser-based version of the database interface.

  2. Custom Web Publishing

    If you’ve developed custom web pages using PHP or XML:

    https://example-app.klutch.sh/fmi/xml/fmresultset.xml?-db=DatabaseName&-lay=LayoutName&-findall

Mobile App (iOS)

  1. FileMaker Go

    • Open FileMaker Go on your iOS device
    • Tap Hosts
    • Tap + to add a new host
    • Enter:
      • Host: example-app.klutch.sh
      • Port: 443 (HTTPS)
    • Tap Save
    • Select your database and log in

REST API Access

FMD Server provides a RESTful Data API for programmatic access.

  1. Authentication

    First, authenticate to get a session token:

    Terminal window
    curl -X POST https://example-app.klutch.sh/fmi/data/v1/databases/DatabaseName/sessions \
    -H "Content-Type: application/json" \
    -H "Authorization: Basic $(echo -n 'username:password' | base64)" \
    -d '{}'

    Response:

    {
    "response": {
    "token": "abc123xyz789token"
    },
    "messages": [{"code": "0", "message": "OK"}]
    }
  2. Create a Record

    Terminal window
    curl -X POST https://example-app.klutch.sh/fmi/data/v1/databases/DatabaseName/layouts/LayoutName/records \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer abc123xyz789token" \
    -d '{
    "fieldData": {
    "FirstName": "John",
    "LastName": "Doe",
    "Email": "john@example.com"
    }
    }'
  3. Query Records

    Terminal window
    curl -X GET https://example-app.klutch.sh/fmi/data/v1/databases/DatabaseName/layouts/LayoutName/records \
    -H "Authorization: Bearer abc123xyz789token"
  4. JavaScript Example

    const FMD_SERVER = 'https://example-app.klutch.sh';
    const DATABASE = 'YourDatabaseName';
    const LAYOUT = 'YourLayoutName';
    // Authenticate
    async function authenticate(username, password) {
    const credentials = btoa(`${username}:${password}`);
    const response = await fetch(
    `${FMD_SERVER}/fmi/data/v1/databases/${DATABASE}/sessions`,
    {
    method: 'POST',
    headers: {
    'Content-Type': 'application/json',
    'Authorization': `Basic ${credentials}`
    }
    }
    );
    const data = await response.json();
    return data.response.token;
    }
    // Create a record
    async function createRecord(token, recordData) {
    const response = await fetch(
    `${FMD_SERVER}/fmi/data/v1/databases/${DATABASE}/layouts/${LAYOUT}/records`,
    {
    method: 'POST',
    headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${token}`
    },
    body: JSON.stringify({ fieldData: recordData })
    }
    );
    return await response.json();
    }
    // Usage
    (async () => {
    const token = await authenticate('username', 'password');
    const result = await createRecord(token, {
    FirstName: 'Jane',
    LastName: 'Smith',
    Email: 'jane@example.com'
    });
    console.log('Record created:', result);
    })();
  5. Python Example

    import requests
    import base64
    import json
    FMD_SERVER = 'https://example-app.klutch.sh'
    DATABASE = 'YourDatabaseName'
    LAYOUT = 'YourLayoutName'
    def authenticate(username, password):
    credentials = base64.b64encode(f'{username}:{password}'.encode()).decode()
    response = requests.post(
    f'{FMD_SERVER}/fmi/data/v1/databases/{DATABASE}/sessions',
    headers={
    'Content-Type': 'application/json',
    'Authorization': f'Basic {credentials}'
    }
    )
    return response.json()['response']['token']
    def create_record(token, record_data):
    response = requests.post(
    f'{FMD_SERVER}/fmi/data/v1/databases/{DATABASE}/layouts/{LAYOUT}/records',
    headers={
    'Content-Type': 'application/json',
    'Authorization': f'Bearer {token}'
    },
    json={'fieldData': record_data}
    )
    return response.json()
    # Usage
    token = authenticate('username', 'password')
    result = create_record(token, {
    'FirstName': 'Bob',
    'LastName': 'Johnson',
    'Email': 'bob@example.com'
    })
    print(f'Record created: {result}')

Database Management

Managing Database Files

  1. Uploading New Databases

    • Use the Admin Console: Database ServerDatabasesUpload
    • Or place files in the databases/ directory in your Git repository before deployment
  2. Closing Databases

    • Navigate to Database ServerDatabases
    • Select the database
    • Click Close to disconnect all clients and close the database
  3. Removing Databases

    • Close the database first
    • Click Remove to delete from the server
    • Confirm the action (this is permanent unless you have backups)

Performance Monitoring

  1. Real-Time Statistics

    • Navigate to Database ServerStatistics
    • Monitor:
      • Active clients
      • Disk I/O
      • Cache hit rate
      • Network throughput
      • CPU and memory usage
  2. Database Performance

    • View per-database statistics:
      • Number of connected users
      • Records accessed per second
      • Query execution times
      • Cache performance
  3. Set Up Alerts

    • Configure email alerts for:
      • High CPU usage (> 80%)
      • Low disk space (< 10%)
      • Failed backups
      • Server errors

Script Scheduling

  1. Create Scheduled Scripts

    • Navigate to Database ServerSchedules
    • Click New Schedule
    • Configure:
      • Script name and database
      • Frequency (hourly, daily, weekly, monthly)
      • Start time
      • Parameters
  2. Common Scheduled Tasks

    • Data imports from external sources
    • Report generation and email distribution
    • Database cleanup and optimization
    • Data synchronization
    • Automated notifications
  3. Monitor Schedule Execution

    • View schedule history
    • Check for failed runs
    • Review execution logs

Production Best Practices

Security Hardening

  1. Use Strong Passwords

    • Minimum 12 characters
    • Mix of uppercase, lowercase, numbers, and symbols
    • Change default passwords immediately
    • Rotate passwords every 90 days
  2. Enable SSL/TLS

    Klutch.sh automatically provides HTTPS for your app URL, but for additional security:

    • Upload custom SSL certificates in Admin Console
    • Force HTTPS for all connections
    • Disable HTTP access
  3. Restrict Admin Console Access

    • Limit Admin Console to specific IP addresses if possible
    • Use VPN for remote administration
    • Enable two-factor authentication if available
  4. Database Encryption

    • Encrypt database files at rest
    • Use FileMaker’s built-in encryption
    • Protect encryption passwords securely
  5. Regular Security Audits

    • Review user accounts monthly
    • Audit privilege sets
    • Check for unused accounts and disable them
    • Monitor access logs for suspicious activity

Backup Strategy

  1. Automated Backups

    • Daily backups at off-peak hours (2:00 AM recommended)
    • Weekly full backups
    • Monthly archive backups
  2. Backup Verification

    • Schedule weekly backup integrity checks
    • Test database restoration monthly
    • Store verification logs
  3. Off-Site Backups

    • Download critical backups to external storage
    • Use cloud storage services (S3, Dropbox, etc.)
    • Maintain 3-2-1 backup strategy:
      • 3 copies of data
      • 2 different media types
      • 1 off-site copy
  4. Backup Before Changes

    Always create manual backups before:

    • FMD Server upgrades
    • Database schema changes
    • Major configuration changes
    • Large data imports

Performance Optimization

  1. Cache Configuration

    • Allocate sufficient cache memory (10-20% of total RAM)
    • Monitor cache hit rates (target > 90%)
    • Increase cache size if hit rate is low
  2. Index Optimization

    • Create indexes on frequently searched fields
    • Avoid over-indexing (slows down writes)
    • Rebuild indexes periodically
  3. Query Optimization

    • Use efficient search criteria
    • Limit result sets with ranges
    • Avoid complex calculations in found sets
  4. Resource Allocation

    Monitor and adjust compute resources in Klutch.sh:

    • CPU: Scale up if consistently > 80%
    • Memory: Scale up if cache hit rate drops
    • Disk: Ensure 20%+ free space at all times

Monitoring and Alerting

  1. Server Health Monitoring

    • Monitor uptime and availability
    • Track response times
    • Watch error rates
    • Monitor disk usage
  2. Performance Metrics

    • Active user count
    • Database query performance
    • Network latency
    • Backup completion status
  3. Alert Configuration

    Set up alerts for:

    • Server downtime
    • High CPU usage (> 80%)
    • High memory usage (> 90%)
    • Low disk space (< 10%)
    • Failed backups
    • Authentication failures (potential security issue)
  4. Log Analysis

    • Review error logs daily
    • Analyze access patterns
    • Identify slow queries
    • Track user behavior

Troubleshooting

Cannot Access Admin Console

Symptoms: Unable to reach Admin Console at port 5003

Solutions:

  • Verify your app is running in the Klutch.sh dashboard
  • Check that the internal port is set to 80 (HTTP)
  • Ensure HTTP traffic type is selected
  • Verify Admin Console is enabled in configuration
  • Check application logs for startup errors
  • Confirm port 5003 is exposed in Dockerfile

Database Files Not Appearing

Symptoms: Databases uploaded but not visible in Admin Console

Solutions:

  • Check persistent volume is mounted at /opt/fmd-data
  • Verify database files are in correct format (.fmp12)
  • Review file permissions in volume
  • Check available disk space on data volume
  • Review server logs for file system errors
  • Restart FMD Server to re-scan database directory

Client Connection Failures

Symptoms: FileMaker Pro clients cannot connect to server

Solutions:

  • Verify server URL is correct: example-app.klutch.sh
  • Check database is opened in Admin Console
  • Verify user credentials are correct
  • Ensure user has proper privilege set assigned
  • Check firewall isn’t blocking connection
  • Test network connectivity to server
  • Verify database isn’t corrupted (check logs)

Backup Failures

Symptoms: Scheduled backups not completing successfully

Solutions:

  • Check available disk space on backup volume
  • Verify backup directory path: /opt/fmd-backups
  • Review backup schedule configuration
  • Check database isn’t locked or in use during backup
  • Review server logs for specific error messages
  • Increase backup volume size if full
  • Verify write permissions on backup directory

Performance Issues

Symptoms: Slow query responses, timeout errors

Solutions:

  • Check CPU and memory usage in Klutch.sh dashboard
  • Monitor active user count
  • Review slow query logs
  • Increase cache size if hit rate is low
  • Scale up compute resources (CPU/RAM)
  • Optimize database indexes
  • Check for long-running scripts
  • Reduce number of concurrent connections if at limit

REST API Authentication Errors

Symptoms: 401 Unauthorized errors when calling REST API

Solutions:

  • Verify credentials are correct
  • Check user has Data API access privilege
  • Ensure Data API is enabled in database settings
  • Verify token hasn’t expired (15 minute default)
  • Check Base64 encoding of credentials is correct
  • Review user privilege set allows API access
  • Test with different REST client (curl, Postman)

Web Publishing Not Working

Symptoms: Web Direct URLs return errors

Solutions:

  • Verify web publishing is enabled: FMD_WEB_PUBLISHING_ENABLED=true
  • Check Nginx is running correctly
  • Review Nginx access logs: /opt/fmd-logs/nginx-access.log
  • Check Nginx error logs: /opt/fmd-logs/nginx-error.log
  • Verify database is opened for web access
  • Check web publishing engine is running
  • Test direct connection to port 80

Advanced Configuration

Custom SSL Certificates

To use your own SSL certificates instead of Klutch.sh’s automatic HTTPS:

  1. Prepare Certificate Files

    • Obtain SSL certificate from a certificate authority
    • Ensure you have:
      • Certificate file (.crt)
      • Private key file (.key)
      • Certificate chain file (.ca-bundle)
  2. Update Dockerfile

    Add certificate files to your Docker image:

    # Copy SSL certificates
    COPY ssl/server.crt /opt/fmd-server/ssl/
    COPY ssl/server.key /opt/fmd-server/ssl/
    COPY ssl/ca-bundle.crt /opt/fmd-server/ssl/
    RUN chmod 600 /opt/fmd-server/ssl/server.key
  3. Configure in Admin Console

    • Navigate to ConfigurationSSL Certificate
    • Upload certificate files
    • Enable SSL for all connections

External Database Connectivity

FMD Server can connect to external data sources:

  1. ODBC/JDBC Configuration

    • Install necessary ODBC drivers in Dockerfile
    • Configure DSN (Data Source Name)
    • Create External SQL Sources (ESS) in FileMaker Pro
    • Link external tables to FileMaker layouts
  2. Supported External Databases

    • MySQL/MariaDB - See MySQL Guide
    • PostgreSQL
    • Microsoft SQL Server
    • Oracle Database
  3. Example: Connect to MySQL

    # Add to Dockerfile
    RUN apt-get update && apt-get install -y \
    mysql-client \
    libmysqlclient-dev \
    unixodbc \
    unixodbc-dev

Custom Web Publishing

Develop custom web applications using PHP or XML:

  1. PHP API Setup

    config.php
    <?php
    define('FM_SERVER', 'example-app.klutch.sh');
    define('FM_DATABASE', 'YourDatabase');
    define('FM_USERNAME', 'webuser');
    define('FM_PASSWORD', 'webpassword');
    // Include FileMaker PHP API
    require_once('FileMaker.php');
    $fm = new FileMaker();
    $fm->setProperty('database', FM_DATABASE);
    $fm->setProperty('hostspec', FM_SERVER);
    $fm->setProperty('username', FM_USERNAME);
    $fm->setProperty('password', FM_PASSWORD);
    ?>
  2. Query Data via PHP

    <?php
    require_once('config.php');
    $findRequest = $fm->newFindCommand('LayoutName');
    $findRequest->addFindCriterion('Status', 'Active');
    $result = $findRequest->execute();
    if (!FileMaker::isError($result)) {
    $records = $result->getRecords();
    foreach ($records as $record) {
    echo $record->getField('FirstName') . ' ';
    echo $record->getField('LastName') . '<br>';
    }
    }
    ?>

Scaling Strategies

For growing workloads, consider these scaling approaches:

  1. Vertical Scaling

    • Increase CPU and memory in Klutch.sh dashboard
    • Recommended for up to 100 concurrent users
    • Easier to implement and manage
  2. Database Optimization

    • Separate databases across multiple FMD Server instances
    • Use external SQL databases for large data tables
    • Implement caching layers
  3. Load Balancing (Advanced)

    For very large deployments:

    • Deploy multiple FMD Server instances
    • Use external load balancer
    • Implement database replication
    • Requires FileMaker Server Advanced license

Migrating Existing Databases

If you’re migrating from an existing FMD Server installation:

  1. Backup Current Databases

    On your existing server:

    • Close all databases
    • Create complete backups
    • Export configuration settings
    • Document custom scripts and schedules
  2. Prepare Database Files

    • Download database files (.fmp12)
    • Verify file integrity
    • Test opening files locally
    • Check for any corrupted data
  3. Transfer to Klutch.sh

    • Add database files to databases/ directory
    • Commit to Git repository
    • Push to GitHub
    • Deploy to Klutch.sh
  4. Reconfigure Settings

    • Upload databases via Admin Console
    • Recreate user accounts
    • Configure privilege sets
    • Set up backup schedules
    • Recreate script schedules
  5. Test Connectivity

    • Connect with FileMaker Pro client
    • Verify all features work
    • Test web publishing
    • Validate REST API access
    • Perform test queries
  6. Update Client Connections

    • Update FileMaker Pro host addresses
    • Modify web publishing URLs
    • Update REST API endpoints
    • Test mobile app connections

Additional Resources


Conclusion

Deploying FMD Server to Klutch.sh provides a powerful, cloud-hosted database platform with enterprise-grade features, global accessibility, and simplified management. With persistent storage for databases and backups, comprehensive web publishing capabilities, and robust REST API support, your FMD Server instance on Klutch.sh is ready to power custom business applications, manage complex workflows, and serve users worldwide with reliable performance and security.