Scaling overview

Scaling an application can mean giving one server more capacity, running the application on more than one server, or distributing traffic across those servers.

Coolify can deploy the same application image to multiple connected servers. A cloud load balancer can then direct requests to the healthy application instances. Coolify does not create or manage that external load balancer for you.

Start with the smallest setup that meets your needs

Add infrastructure when load, availability requirements, or measured bottlenecks justify it. A single appropriately sized server is easier to operate than a multi-server deployment.

Choose a scaling path

NeedApproachStart here
More CPU, memory, or storage for the current workloadResize the current server or move the resource to a larger serverServers overview
Run the same application on several standalone serversAttach additional deployment servers to the applicationMulti-server Deployments
Distribute public traffic and remove unhealthy servers from rotationPut a provider-managed load balancer in front of the application serversCloud Load Balancing
Maintain an existing Docker Swarm deployment on Coolify v4Continue only as a temporary legacy setupDocker Swarm (Deprecated)

Multi-server deployment and load balancing solve different parts of the same architecture. Coolify deploys a consistent application image to each attached server. The load balancer decides which server receives each incoming request.

What Coolify handles

For a supported multi-server application, Coolify:

  • keeps one server as the primary deployment server
  • builds the application on the primary server or a configured build server
  • pushes the built image to the Docker registry configured for the application
  • deploys that image to the additional servers attached to the application
  • lets you deploy, stop, remove, or promote individual servers from the application's Servers page

You remain responsible for:

  • configuring the external load balancer and its health checks
  • securing traffic between the load balancer and application servers
  • keeping sessions, uploads, and other application state available to every instance
  • operating shared databases, caches, queues, and file storage
  • monitoring capacity and deciding when to add or remove servers

Prepare the application

Horizontal scaling works best when any application instance can serve any request. Before adding servers:

  1. Move session state, user uploads, queues, and caches out of the container filesystem.
  2. Use a database and storage location reachable from every application server.
  3. Add a health endpoint that returns a successful response only when the instance can serve traffic.
  4. Confirm that the application can run from the same image and configuration on every server.
  5. Decide where TLS terminates and how the load balancer reaches each server.

Applications with persistent storage configured in Coolify cannot use the current multi-server deployment feature. Docker Compose applications also cannot attach additional deployment servers through the application's Servers page.

This section covers infrastructure-level scaling across servers. For a provider-specific example, read Load Balancing on Hetzner. To use multiple CPU cores for a Node.js process on one server, read Node.js Multi-core Scaling.

On this page