Skip to content
kalyugwasi edited this page Apr 25, 2026 · 2 revisions

Fortrx-Server Wiki

Welcome to the Fortrx-Server wiki! This wiki provides detailed information and guides for setting up, configuring, and managing the Fortrx-Server.

Table of Contents

Overview

The Fortrx-Server is the backend component of the Fortrx secure communication system. It facilitates Post-Quantum-Resistant Double Ratchet + X3DH key exchanges, handles encrypted message routing, user presence, and live delivery. The server is built with a robust stack including FastAPI, PostgreSQL, Redis, MinIO, Caddy, and DuckDNS.

Installation

To install and run the Fortrx-Server, follow these steps:

  1. Clone the repository:

    git clone https://github.com/Fortrx/Fortrx-Server.git
    cd Fortrx-Server
  2. Run the launch script:

    bash ops/launch.sh

    This script will guide you through the installation of Docker and Docker Compose v2 (if needed) and help you choose between local (development) or prod (production) deployment modes.

Configuration

Configuration for the Fortrx-Server is handled through environment variables. Depending on your chosen deployment mode (local or prod), the launch.sh script will either create a local .env file or export runtime secrets from Infisical into .env.runtime.

Key Configuration Parameters

  • SERVER_URL: The base URL for the Fortrx-Server API.
  • DATABASE_URL: Connection string for the PostgreSQL database.
  • REDIS_URL: Connection string for the Redis instance.
  • MINIO_ACCESS_KEY, MINIO_SECRET_KEY: Credentials for MinIO object storage.
  • INFISICAL_TOKEN: (Production only) Token for Infisical secret management.

Deployment Modes

Local Development

  • Purpose: Ideal for development and testing.
  • Setup: Choose local during ops/launch.sh execution.
  • Endpoints:
    • API: http://localhost:8000
    • MinIO API: http://localhost:9000
    • MinIO Console: http://localhost:9001

Production Deployment

  • Purpose: For live, secure, and scalable deployments.
  • Setup: Choose prod during ops/launch.sh execution.
  • Requirements:
    • Repository linked to an Infisical project with prod environment secrets.
    • INFISICAL_TOKEN recommended for non-interactive authentication.
  • Features: Installs Docker, Docker Compose v2, cron, restic, exports production secrets, starts production stack, and configures nightly backups.

Backup and Restore

Manual Backup

To perform a manual backup of the server data:

bash ops/backup.sh

This will back up the PostgreSQL database, MinIO volume, and environment metadata.

Restore a Snapshot

To restore the server from a previous snapshot:

bash ops/restore.sh <snapshot-id>

Backups are managed using restic, supporting various backends. Ensure RESTIC_REPOSITORY and RESTIC_PASSWORD (along with any other backend-specific environment variables) are configured in Infisical for production backups.

Troubleshooting

If you encounter issues with the Fortrx-Server, consider the following:

  • Check Docker container status: Ensure all services are running (docker compose ps).
  • Review logs: Examine container logs for error messages (docker compose logs <service_name>).
  • Verify environment variables: Confirm that all necessary environment variables are correctly set for your deployment mode.
  • Database connectivity: Ensure PostgreSQL and Redis are accessible and properly configured.
  • Firewall rules: Check if any firewall rules are blocking necessary ports.
  • Consult the Fortrx-Server GitHub Issues for known issues or to report a new one.