Deploying to a Cluster
Deploying to a Docker Swarm cluster follows the same general workflow as standalone deployments, with additional steps for pushing and pulling images through a container registry.
Prerequisites
Before deploying to a cluster, ensure you have:
- A cluster set up. A single leader node is enough to start; worker nodes are optional.
- A container registry configured — required for multi-node clusters. Single-node clusters where the leader is also the build server can deploy registry-less.
- At least one build server assigned to the cluster. New clusters automatically use the leader, but a standalone build server is recommended for production.
Step-by-Step Deployment
1. Create an Application
- Go to the Appliku dashboard and click Create Application
- Connect your Git repository (GitHub, GitLab, or custom Git URL)
- Select the branch to deploy from
- For deployment target, select your cluster (instead of a standalone server)
2. Configure the Application
Set up your application as you would for a standalone deployment:
- Build settings -- Choose a build image or use a Dockerfile
- Environment variables -- Add any required configuration
- Processes -- Define your
web,release,worker, and other process types
3. Add a Database (If Needed)
Databases can only be deployed on standalone servers, not inside a cluster. Select a standalone server when adding a database. The database connection URL is still injected into your cluster application as an environment variable.
4. Deploy
Trigger a deployment by pushing to your branch or clicking Deploy in the dashboard. The build process depends on whether the cluster uses a registry.
Registry-backed (multi-node clusters, or single-node with registry credentials configured):
- Code pull -- The build server clones your repository
- Image build -- Docker image is built using your configured build image or Dockerfile
- Image push -- The built image is pushed to your configured container registry
- Release phase -- If a
releaseprocess is defined, it runs on the leader node (e.g., database migrations) - Service update -- Docker Swarm pulls the new image on cluster nodes and updates running services
- Health check -- Swarm verifies containers are healthy before routing traffic
Local-only (single-node clusters with no registry credentials, leader == build server):
- Code pull -- The build server (also the leader) clones your repository
- Image build -- Docker image is built and tagged locally as
appliku-{app-name}:{deployment-id} - Release phase -- If a
releaseprocess is defined, it runs on the leader - Service update --
docker stack deploy --resolve-image=neverschedules the service against the local image; no push or pull occurs - Health check -- Swarm verifies containers are healthy before routing traffic
See Single-Node Clusters for the full picture, including what happens when you later add a worker node.
5. Set Process Scale
After deploying, configure the number of replicas for each process:
- Go to the Processes tab of your application
- For each process, click Change Scale
- Set the desired number of replicas
Docker Swarm distributes replicas across available nodes automatically. If your cluster has worker nodes, Appliku places generated application services on workers by default. If there are no worker nodes, services can run on the leader.
Build Flow Comparison
| Step | Standalone | Cluster |
|---|---|---|
| Build | On the same server | On a dedicated build server |
| Image storage | Local on server | Pushed to container registry |
| Deployment | Docker Compose restart | Docker Swarm service update across nodes |
| Scaling | On/Off per process | N replicas per process |
Monitoring Deployments
- Build logs -- Available in the Deployments tab, showing each build step
- Application logs -- Available from Application Overview > App Logs, select the process/service to view
- Deployment status -- Tracked as: new, deploying, deployed, failed, timeout, or aborted
Next Steps
- Scaling in Clusters -- Scale processes across worker nodes
- Cluster Limitations -- Important constraints to be aware of
- Container Registry Setup -- Configure registry credentials