Claus Lavendt, Jan 8, 2022, FilaMaker Training TV

Automating the installation of a FileMaker Server can save countless hours, minimize errors, and ensure consistent configurations every time. In this blog post, we’ll take you through a step-by-step guide on using shell scripts to automate the setup of a FileMaker Server on Ubuntu Linux, featuring insights from expert developer Klaus Lavendt of DataManix. From initial server setup to configuring SSL certificates and other essential services, this guide will walk you through everything you need to know.

Menu

  1. Introduction
  2. Why Automate Your FileMaker Server Installation?
  3. Prerequisites
  4. Preparing Your Environment
  5. Understanding the Shell Script
  6. Automated Installation Steps
  7. Advanced Setup and Customizations
  8. Admin API and Additional Configurations
  9. Common Issues and Troubleshooting
  10. Best Practices for Maintenance
  11. Conclusion
  12. Resources and Further Reading

Introduction

Managing the setup of a FileMaker Server can be time-consuming, especially if you are configuring multiple instances or testing different environments. Automation is the key to streamlining this process. This guide will delve into a shell script that automates the entire installation and configuration of FileMaker Server on an Ubuntu Linux instance, significantly reducing the manual effort involved.

Why Automate Your FileMaker Server Installation?

Consistency and Efficiency

Automating server installation ensures that your configurations remain consistent across deployments, eliminating discrepancies that may arise from manual installations. Once you create the script, it can be reused for future installations with little to no modification.

Avoiding Manual Errors

Manual installations can be prone to mistakes, such as missing steps or incorrect settings. Automation helps you avoid these errors by scripting each step in detail, ensuring nothing is skipped or misconfigured.

Best Practices

With automation, you can enforce best practices for your server setup, like configuring SSL for secure communication, setting up separate volumes for databases, and adjusting cache settings. These are often overlooked during manual installations.

Prerequisites

Before you start automating your FileMaker Server installation, make sure you have the following in place:

Ubuntu Server on AWS

This guide focuses on using Ubuntu 18.04 on AWS for installing FileMaker Server. Ensure your environment supports Linux-based installations.

Understanding the Components

You’ll need to understand key elements such as:

  • SSL Certificates: Necessary for secure communication.
  • Admin API: Allows for advanced configuration.
  • FileMaker’s Command Line Interface (CLI): For server configuration.

Tools You’ll Need

  • Transmit: For file uploads.
  • Terminal: To execute shell commands.
  • Certbot: For SSL certificate management.

Preparing Your Environment

Creating an Ubuntu Instance

Start by creating an Ubuntu instance on AWS (or your preferred cloud provider):

  1. Choose Ubuntu 18.04 as your base image.
  2. Select an appropriate instance size based on your needs (e.g., t2.medium for testing).
  3. Attach additional volumes for Data, Container, and Backup to separate concerns.
  4. Note the size of each volume for future reference.

Uploading Necessary Files

You need to have certain files prepared for the automation:

  • SSL Certificates (private key, signed certificate, and intermediate).
  • Assisted Install File: Pre-configures the admin user and password.
  • License Certificate: Your FileMaker license information.

Using Transmit for File Transfer

Upload the necessary files using Transmit (or any other FTP/SFTP tool). Place them in a folder on the server, ready for use by the shell script.

Understanding the Shell Script

Script Overview

The shell script is a Bash script that automates every step required to set up and configure a FileMaker Server on Ubuntu. It handles:

  • Formatting and mounting drives.
  • Installing required Ubuntu packages.
  • Setting up FileMaker Server.
  • Configuring the server with best practices.

Setting Up Variables

At the top of the script, you’ll find variable declarations:

bashCopy code# Define the installation directory
INSTALL_DIR="/home/ubuntu/fms_install"

# Define the sizes of the data, container, and backup disks
DATA_DISK_SIZE=10
CONTAINER_DISK_SIZE=15
BACKUP_DISK_SIZE=25

These variables make it easy to adjust your configurations without editing the entire script.

Formatting and Mounting Disks

The script includes commands to format and mount the additional volumes. This ensures your Data, Container, and Backup folders are on separate disks, optimizing performance:

bashCopy code# Create and mount the data disk
sudo mkfs.ext4 /dev/nvme1n1
sudo mkdir /mnt/data
sudo mount /dev/nvme1n1 /mnt/data

Automated Installation Steps

Downloading and Installing FileMaker Server

The script downloads the FileMaker Server package from Claris and installs it:

bashCopy code# Download FileMaker Server installer
curl -O "https://downloads.claris.com/FileMakerServer_${FMS_VERSION}.zip"
unzip FileMakerServer_${FMS_VERSION}.zip

Make sure to keep the version number updated for new releases.

Configuring FileMaker Server

Once the server is installed, the script handles initial configurations:

  • Enable Server Stats for monitoring.
  • Adjust Cache Size to optimize database performance.
  • Import SSL Certificates using command-line tools.

Installing and Configuring SSL

Configuring SSL certificates is vital for secure connections:

bashCopy code# Import SSL certificate
fmsadmin certificate import server.pem --keyfile serverKey.pem

The script uses variables to locate and import the necessary SSL files, streamlining what is usually a manual process.

Advanced Setup and Customizations

Custom Cache Settings

The script includes an automated calculation for the Database Cache based on your server’s memory:

bashCopy code# Calculate cache size as slightly less than half of total memory
TOTAL_MEMORY=$(grep MemTotal /proc/meminfo | awk '{print $2}')
CACHE_SIZE=$(echo "$TOTAL_MEMORY / 2.2" | bc)
fmsadmin set serverconfig cachesize=$CACHE_SIZE

This ensures that your server’s memory is optimized without manual calculations.

Enabling Essential Features

The script enables essential features such as Data API, ODBC/JDBC, and Server Logging using best practices:

bashCopy code# Enable Data API and Server Logging
fmsadmin set serverconfig enable_dapi=true
fmsadmin set serverconfig log_communication=true

Managing Backups with Retrospect

The script configures the Retrospect Client for secure backups, including firewall adjustments:

bashCopy code# Configure firewall for Retrospect
sudo ufw allow 497
sudo ufw reload

Admin API and Additional Configurations

Using the Admin API

The FileMaker Server Admin API is used for advanced configuration:

  • Server Name Setup
  • Folder Paths for Databases and Backups
  • Notification Settings

The script handles this via curl commands, automating the API requests.

Setting Up Notifications and Plugins

To ensure proper monitoring and plugin management:

bashCopy code# Set up email notifications
curl -X PATCH "https://localhost:16000/fmi/admin/api/v1/config/email" \
-H "Authorization: Bearer $TOKEN" \
-d '{"senderAddress": "admin@example.com", "smtpServer": "smtp.example.com"}'

Final Cleanup and Server Reboot

Finally, the script cleans up temporary files and reboots the server to apply all settings:

bashCopy code# Clean up and reboot
rm -rf /home/ubuntu/fms_install
sudo reboot

Common Issues and Troubleshooting

Script Errors

Ensure that any errors encountered are logged for review. Modify the script to add additional echo statements for better tracking of each step.

SSL Installation Problems

SSL issues often arise from incorrect file paths or certificate formats. Double-check that your SSL files are in the correct format (.pem) and accessible.

FileMaker Server Configuration Challenges

If the server does not configure correctly, verify the Admin API responses and adjust the JSON payloads as needed. Check for network connectivity and DNS resolution if the Admin API fails.

Best Practices for Maintenance

Monitoring the Server

Enable server stats for better monitoring and consider using third-party monitoring tools for advanced insights.

Automating Backups

Incorporate automated backup tools like Retrospect for secure and scheduled backups. Consider using Wazuh for security monitoring.

Security Considerations

Ensure that the server is updated regularly and maintain strict SSH access policies. Avoid storing plain-text passwords and sensitive data in the scripts.

Conclusion

Automating your FileMaker Server installation simplifies deployment, enforces best practices, and saves time. With the right script, you can achieve a robust and consistent setup in just a few minutes.

Resources and Further Reading

Feel free to contact Klaus Lavendt if you want to dive deeper into automation or need expert guidance on your FileMaker Server setup!


This blog post aims to provide a comprehensive guide for anyone looking to automate their FileMaker Server installations. Feel free to explore the resources provided for additional support and tools.