Software & Applications

Coolify Server Crash During Build: Diagnose Safely

Diagnose a Coolify server crash during build, separate OOM, Docker, VPS, and provider failures, then recover safely and verify the fix with evidence.

Coolify server terminal diagnosing build crashes
Coolify server terminal diagnosing build crashes

A “Coolify server crash during build” usually means one of five failures. The build failed, a container stopped, Docker failed, the VPS rebooted, or the provider became unreachable. First save the logs and timestamps. Then check access, uptime, RAM, swap, disk space, inodes, CPU, and Docker. Apply only the smallest reversible fix that the evidence supports.

Did Coolify crash, or did only the build fail?

First, check what you can still reach. A failed source build can leave SSH and Coolify available. A lost SSH connection or changed uptime points to a host, network, or provider problem. The word “crash” alone is too broad to choose a safe fix.

Coolify can deploy a pre-built Docker image or build one from source. For a source deployment, Docker Engine builds the image on the server. That work can affect CPU and memory on the host. A pre-built image avoids this workload on the Coolify server.

What you observeLikely fault areaFirst safe check
Build fails but SSH and Coolify remain availableApplication, dependency, or build-stage errorRead the complete build log
Build container stops while the host stays upResource limit or process failureCheck container and Docker events
Coolify UI fails but SSH worksCoolify service, reverse proxy, or network pathCheck local service access
SSH and UI are lost, then returnVPS reboot, kernel failure, or provider eventCompare uptime with provider timestamps
VPS remains unreachableProvider outage, network rule, or host failureUse the provider console
Docker commands fail while Linux respondsDocker daemon or storage problemCheck Docker status and journal logs

A Docker exit code does not by itself show an out-of-memory kill. Kernel evidence, a reboot record, or a matching provider event is stronger.

Before you start: preserve evidence

Save the build ID, deployment time, visible error, and last useful log lines before restarting Docker, Coolify, or the VPS. A restart can remove runtime context. Cleanup can also erase the image, layer, cache, or stopped container that explains the failure.

If SSH still works, record the current state. These checks do not change the system. Paths and service names vary by Linux distribution and installation.

  1. Record the current time, host identity, and uptime.
Linux shell
date -Is
hostname
uptime
  1. Record memory, swap, disk space, and inode usage.
Linux shell
free -h
swapon --show
df -h
df -ih
  1. Save recent kernel and system messages. Use sudo if your account requires it.
Linux shell
sudo journalctl -k --since "2 hours ago" --no-pager
sudo journalctl --since "2 hours ago" --no-pager
  1. Capture Docker state and its recent journal. These commands do not change the system.
Linux shell
docker info
docker ps -a
docker system df
sudo journalctl -u docker --since "2 hours ago" --no-pager
  1. Copy the Coolify build log, deployment ID, build method, and timestamps. Also save the Dockerfile, build arguments, and recent source or dependency changes.

Match the build-log timestamp with the kernel, Docker, and system journals. Look for out-of-memory messages, Killed, filesystem write errors, inability to create temporary files, failed image pulls, registry authentication errors, and Docker daemon restarts. Exact wording varies across kernels, Docker Engine versions, and logging setups.

If SSH is unavailable, use the provider’s web console or serial console when available. Save screenshots and event timestamps before choosing a reboot or recovery action. Check the provider’s current status page and event history. Console features differ by provider, so confirm them in its current documentation.

Match the timeline to the failure

Build a single timeline from the last successful build event, final build-log line, host uptime, and provider events. The build log can end before the kernel or Docker service records the failure.

Memory and swap

Low available memory, little or no swap, and a kernel message naming an OOM kill support a memory-exhaustion diagnosis. A process killed during dependency installation or compilation fits this branch. The build log by itself does not establish the cause. Check whether the host recovered without rebooting.

Disk space and inodes

df -h reports available bytes. df -ih reports available inodes. Either limit can stop Docker from creating layers, temporary files, sockets, or logs. A full filesystem can also break unrelated Coolify and Docker operations. Check both before deleting anything.

CPU pressure

High load, a stalled build, and an otherwise responsive host suggest CPU contention. top or htop can identify active processes. Interpret the load in the context of the machine’s CPU count and other workloads. CPU pressure does not by itself explain why a VPS became unreachable.

Docker daemon failure

If Linux and SSH work but docker info fails, inspect the Docker journal. Look for daemon exits, storage-driver errors, failed mounts, or an inability to write its data directory. Coolify tells Docker Engine to perform source builds, so a Docker failure can appear in Coolify as a deployment failure.

Dependency or application failure

A bad Dockerfile command, missing package, unavailable private repository, registry authentication problem, or failed health check can stop a deployment without harming the host. Keep this branch focused on build and deployment logs until host evidence points elsewhere.

Host, network, or provider failure

A changed uptime value shows that the host rebooted. Provider event records can help distinguish planned work, host maintenance, a network incident, and recovery. If uptime did not change but access is intermittent, inspect firewall and network evidence instead of blaming the build. Coolify’s connection troubleshooting identifies UFW, iptables, and related server rules as possible causes of unstable connections.

Apply the smallest reversible fix

Choose one branch only after saving evidence and matching the timeline. If the server repeatedly reboots, the filesystem is read-only, or important data is at risk, stop retrying and escalate. Repeated builds can make recovery harder.

If memory is exhausted

  1. Stop only competing workloads that you know are safe to stop. Prevent simultaneous builds.
  2. If swap is not enabled, consider adding it according to your distribution and provider’s current documentation. Swap can reduce abrupt kills, but it is a mitigation. It does not show that the server has enough capacity. A swap-heavy build can become slow and unhealthy.
  3. Run one controlled build while watching memory and swap. If the same evidence returns, use the provider’s current resize process to add RAM or move the build elsewhere. Coolify’s guidance recommends more server capacity or offloading builds for this problem.

If disk space or inodes are exhausted

  1. Identify large files, logs, images, and caches before deleting anything.
  2. Confirm that each candidate is not active deployment data, a database file, mounted volume, backup, or useful evidence.

Do not run a broad Docker prune while investigating. Never delete Docker volumes until backups are verified and the volume is known to be disposable.

  1. Remove only identified disposable files through the normal process for the distribution. Then recheck df -h and df -ih.

If space or inodes return but Docker still fails, stop cleanup and inspect the Docker journal. Do not delete more data.

If CPU pressure is the problem

  1. Reduce build concurrency and stop an identified nonessential workload.
  2. Retry once during a quieter period while watching the host.
  3. If the build repeatedly monopolizes the machine, move it to a larger server or external builder. Do not mask the pressure with retries.

If Docker failed

  1. Preserve the Docker journal and confirm that Linux and the filesystem are stable.
  2. Restart only the Docker service after considering its effect on running containers.
  3. Check Docker status and run docker info immediately afterward.

If Docker does not return cleanly, stop retrying. Inspect storage, mounts, and daemon configuration. A VPS reboot is not a diagnosis.

If the source build is too heavy

  1. Build the image outside the production VPS, using an external build server or GitHub Actions.
  2. Push the resulting image to a container registry.
  3. Configure Coolify to deploy the pre-built image. Verify the registry credentials and image tag before changing production settings.

Coolify documents external builders and GitHub Actions as ways to reduce build load on the server.

If the VPS is unreachable or keeps rebooting

Use the provider console or serial console, when available, to preserve logs and check the last uptime and resource evidence. Check the provider’s current event history and status page. If the console also fails, or the VPS reboots without a clear guest-side cause, stop rebuild attempts and escalate to the provider.

Verify the deployment and the host

A green Coolify message is not enough. Confirm that the deployment works. Then confirm that the host stays stable after the build workload ends.

  1. Confirm that Coolify reports a completed build. Save the successful deployment ID and timestamp.
  2. Confirm that Docker shows the expected container running. Inspect its logs and health status through Coolify or Docker. A running container can still serve a broken application.
  3. Test the application through its normal domain or endpoint. Include the reverse proxy, TLS, background workers, and required dependencies.
  4. Recheck uptime, free -h, swapon --show, df -h, and df -ih. Look for stable uptime, remaining disk and inode headroom, and no new kernel or Docker errors.
  5. If the same evidence returns, stop changing variables. Record the new timestamps instead of starting another blind retry.

The fix worked only when the intended deployment responds and the host stays reachable and stable after the build.

Prevent another build crash

For recurring failures, reduce parallel builds and use a smaller build context with .dockerignore. Keep source builds off a production VPS when they repeatedly consume its resources. External CI or a dedicated builder can build the image before Coolify deploys it. Coolify documents external builds and larger server resources as ways to reduce build load.

Monitor host reachability, memory, disk bytes, inodes, Docker service state, and reboot events. Treat swap activity as a warning signal, not proof of a healthy system. The host can stay up while performance degrades.

When escalating, provide the deployment ID, exact timestamps and timezone, build method, relevant Coolify and Docker logs, kernel messages, uptime before and after, resource readings, and provider event details. Remove secrets and private tokens before sharing logs. Contact the hosting provider for unexplained reboots, console or storage failures, and matching provider incidents. Contact Coolify through its current support or community channels for deployment-specific issues.

Conclusion

Save the timeline first. Then make one reversible change that matches the evidence. If the VPS keeps rebooting, stays unreachable through the provider console, or shows storage or hardware errors, stop rebuilding and escalate with the collected logs and timestamps.

Frequently Asked Questions

Should I reboot the VPS immediately after a Coolify build crash?

No. Save the evidence first. A reboot can restore access, but it may remove useful runtime context and does not identify the cause. Save Coolify, Docker, kernel, uptime, resource, and provider evidence. Reboot only when the host is unsafe or inaccessible and you have captured everything available through the provider console.

Can adding swap stop a Coolify server crash during build?

Sometimes, when the evidence points to memory pressure. Swap is only a mitigation. It can make a build very slow and cannot fix disk exhaustion, CPU contention, Docker errors, or a provider outage. Confirm the memory evidence first. Then consider swap or more RAM and observe the next controlled build.

Is Docker prune safe after a failed build?

Not automatically. Pruning can remove unused images, stopped containers, or build cache that may explain or help recover the failure. Deleting volumes can destroy application data. Preserve logs, confirm disk or inode exhaustion, and remove only items you have identified as disposable.

When should I move Coolify builds to GitHub Actions or another builder?

Move builds elsewhere when source builds repeatedly consume VPS resources, cause reboots, or compete with production services after the evidence confirms that pattern. Build the image externally, push it to a registry, and configure Coolify to deploy that image. Check the current Coolify and CI documentation for setup and authentication details.

Sources

Automation & Infrastructure Desk

Think Tech Editorial

Engineering guides focused on reliable self-hosted workflows, reverse proxies, and production diagnostics.