Fluxme.io
FluxCloud Advanced Deployment

Compose v4: Multi-Component Applications

Deploy up to 10 components in one Flux application — internal DNS, inter-component communication, ports and environment variables.

15 min readVerified November 10, 2026
composemulti-componentdnsarchitecture

Real-world applications are rarely a single container. A typical web app consists of a frontend, an API backend, a database, and possibly a cache or message queue. Flux's compose specification lets you deploy up to 10 components in a single application, with automatic internal DNS for inter-component communication.

A word on the name. The compose array arrived with specification version 4, which is why multi-component deployment is still widely called "Compose v4" — the term in this article, and in the URL. The spec itself has moved on: the protocol reports latestSupportedSpecVersion: 8, enforced from block 1,932,380, and that is what a new deployment writes. Version 8 kept the compose array and added to it; nothing below is obsolete, but if a tool asks you for a version number, the answer today is 8, not 4.

How Compose v4 Works

In a Compose v4 spec, each component is defined as a separate entry in the compose array. Each component has its own Docker image, ports, environment variables, resources (CPU, RAM, HDD), and persistent storage. All components within the same app can communicate with each other using Flux's internal DNS system.

Internal DNS Communication

When you deploy a multi-component app, Flux automatically sets up internal DNS entries for each component. Components can reach each other using the component name as a hostname. For example, if your app has a component named api and another named db, the api component can connect to the database at db:5432 (for PostgreSQL) using the component name as the DNS hostname.

Use the component name (from the spec) as the hostname in your connection strings. Example: DATABASE_URL=postgresql://user:pass@db:5432/mydb — where "db" is the name field of your database component.

Complete Multi-Component Example

Here is a complete Compose v4 specification for a typical 3-component web application: React frontend + Node.js API + MongoDB database.

Compose v4 spec — 3-component web app

{
  "version": 4,
  "name": "mywebapp",
  "description": "Full-stack web application",
  "owner": "YOUR_ZELID",
  "instances": 3,
  "compose": [
    {
      "name": "frontend",
      "description": "React frontend",
      "repotag": "yourusername/myapp-frontend:latest",
      "ports": [80],
      "containerPorts": [80],
      "domains": ["www.myapp.com"],
      "environmentParameters": ["REACT_APP_API_URL=http://api:3000"],
      "commands": [],
      "containerData": "/usr/share/nginx/html",
      "cpu": 0.5,
      "ram": 256,
      "hdd": 1
    },
    {
      "name": "api",
      "description": "Node.js API backend",
      "repotag": "yourusername/myapp-api:latest",
      "ports": [3000],
      "containerPorts": [3000],
      "domains": ["api.myapp.com"],
      "environmentParameters": [
        "NODE_ENV=production",
        "MONGODB_URI=mongodb://db:27017/myapp",
        "PORT=3000"
      ],
      "commands": [],
      "containerData": "/appdata",
      "cpu": 1,
      "ram": 512,
      "hdd": 2
    },
    {
      "name": "db",
      "description": "MongoDB database",
      "repotag": "mongo:7",
      "ports": [],
      "containerPorts": [27017],
      "domains": [],
      "environmentParameters": [],
      "commands": [],
      "containerData": "/data/db",
      "cpu": 1,
      "ram": 512,
      "hdd": 5
    }
  ]
}

Component Configuration Fields

FieldTypeDescription
namestringComponent name — used as DNS hostname for inter-component communication
descriptionstringHuman-readable description
repotagstringDocker image in namespace/image:tag format
portsnumber[]Ports exposed to the public internet (leave empty for internal-only components)
containerPortsnumber[]Ports the container listens on internally
domainsstring[]Custom domains attached to this component
environmentParametersstring[]KEY=VALUE environment variables
commandsstring[]Override container CMD / entrypoint arguments
containerDatastringMount path for persistent volume
cpunumberCPU cores allocated to this component
ramnumberRAM in MB allocated to this component
hddnumberStorage in GB allocated to this component

Key Design Patterns

  1. 1

    Database components: no public ports

    Set ports to an empty array [] for database components. They should only be accessible via internal DNS from other components, never from the public internet.

  2. 2

    Frontend proxy to API

    Configure the frontend to communicate with the API using the internal DNS hostname (e.g., api:3000). For client-side requests, use a public API domain.

  3. 3

    Separate domains per component

    Assign different domains to each public-facing component: www.myapp.com for frontend, api.myapp.com for the API.

  4. 4

    Resource allocation

    Allocate resources based on workload. Databases need more storage (hdd) and RAM; APIs need more CPU; frontends are lightweight.

The current cap is 10 components per application, set by MAX_APP_COMPONENTS in the FluxOS validator. The widely-repeated figure of five is the historical limit: the validator still applies it, but only to specifications below enforcement height 6 (block 1,300,000), which the chain passed long ago — it was at block 3,114,066 on 10 November 2026. Applications with six components are live on the network today, so the five-component ceiling is simply no longer in force. If your architecture needs more than ten, combine lightweight services into one container or split into several Flux apps.

Measured on this site

Component count, port ranges and per-component resource ceilings come from the protocol, and they move with each specification version. The values in force are published here: Flux deployment rules.

What to read next, and why

Read Flux enterprise applications for private images, secrets, static IP, and what each surcharge really costs.

Read deploying with Git for a push, and the network redeploys.

Read Flux-Orbit for zero configuration, a hundred frameworks detected straight from your repository.

Read shared databases on Flux for replication across instances that each have their own disk.

Read the Flux app cost calculator for what a given specification costs per term.