CrushMFT Documentation

Ports and networking#

The ports#

A new CrushMFT 27 server listens on these ports inside the container; the image declares them:

Port Protocol Notes
8080 HTTP: the web interface, WebDAV, the API, the health checks
9090 HTTP a second web port
443 HTTPS with CrushMFT's built-in certificate until you set your own
2222 SFTP and SCP
21 FTP, FTPS (explicit) passive transfers need more ports, see FTP

Publish the ones you use: -p 8080:8080 -p 443:443 -p 2222:2222. The host side can be any port: -p 22:2222 offers SFTP on the host's port 22.

Ports are changed, added (implicit FTPS 990, more HTTPS ports, AS2, ...) and removed in the admin pages, Preferences, IP / Servers, like on any server. A port you add inside must also be published (-p) or added to the Kubernetes Service. To fix the port list from outside, see Configuration (_server_list.xml).

Ports below 1024#

The server is not root, yet it can open ports 21 and 443 inside the container: Docker and Podman allow ports below 1024 to every process in a container. In Kubernetes this depends on the container runtime. If the log says a port below 1024 could not be opened, either allow it in the pod (the chart's podSecurityContext):

podSecurityContext:
  fsGroup: 65532
  sysctls:
    - name: net.ipv4.ip_unprivileged_port_start
      value: "0"

or move the port above 1024 in IP / Servers and map it in the Service (port: 21, targetPort: 2121).

FTP#

FTP opens a second connection for every listing and transfer. In passive mode (what clients use behind firewalls) the server tells the client an address and a port to connect to. In a container both must be right:

  1. A passive port range. In IP / Servers, on the FTP port, set the passive ports to a small range, e.g. 30000-30019 (20 ports allow 20 transfers at once).
  2. Publish the range: -p 30000-30019:30000-30019 (the same numbers inside and out).
  3. The address clients use. In the same port's settings, set the address the server announces to the host's public address or name. The server announces the container's own address otherwise, which clients outside can't reach.

FTPS (FTP over TLS) needs the same, since the router in between can't read encrypted commands. SFTP and HTTPS need only their one port: prefer them when you can.

In Kubernetes: list the passive ports in a Service of their own (Kubernetes Services have no port ranges, each port is a line), and give the FTP port the address of that Service's load balancer.

HTTPS and certificates#

Port 443 starts with CrushMFT's built-in certificate. Use your own:

  • In CrushMFT: import or request a certificate in the admin pages (Encryption); the keystore is kept in the volume. The LetsEncrypt plugin can get and renew one.
  • In front of CrushMFT: a reverse proxy or load balancer (Traefik, nginx, an Ingress, a cloud load balancer) ends HTTPS and sends plain HTTP to port 8080. Then turn on the trusted proxy headers in the HTTP port's settings, so CrushMFT sees the client's real address and that the connection was secure.

Only HTTP and HTTPS go through an HTTP proxy. SFTP, FTP and FTPS need a TCP pass-through (a TCP router, a LoadBalancer Service, or a plain port mapping).

The client's address#

CrushMFT sees the address the connection comes from. Behind Docker's default network that is the client's real address for published ports on Linux. With Docker Desktop, rootless Docker or Podman, some setups show the gateway's address instead; through an HTTP proxy it is the proxy's address unless the proxy headers are trusted (above). Address-based rules (bans, IP restrictions) need the real address.

Outbound connections#

The server connects out for the update check (www.crushftp.com, HTTPS) and to whatever you configure (storage, LDAP, mail, webhooks). A container without internet access runs fine; the update check then logs that it could not be read.