---
name: coolify-deploy
description: Use when containerising a web app (a Vite or Vue SPA, a Nuxt app built static or as a Node server) and shipping it to Coolify — copy-ready Dockerfiles, nginx config, .dockerignore and a local compose file, the Coolify build pack, port, environment variables and health check, a smoke test of the running container, publishing content by redeploying, a CI job that builds and tests the image, and debugging a failed or broken deployment (blank page after deploy, 404 on deep links, redirects to the wrong port, "No available server", a build that fails at npm ci or at the type check). Triggers include deploy, publish, release, push it live, Dockerfile, nginx, «انشر الموقع», «النشر على Coolify», «صفحة بيضاء بعد النشر», «دوكر».
metadata:
  summary: "Deploy a web app to Coolify with Docker, nginx and health checks."
  tags: coolify, deploy, docker, nginx
title: coolify-deploy
canonical_url: https://skilld.dev/gh/haythamasalama/skills/coolify-deploy
last_updated: 2026-11-03T23:16:06.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/coolify.md](https://skilld.dev/api/skills-raw/haythamasalama/skills/coolify-deploy/references/coolify.md), [references/debugging.md](https://skilld.dev/api/skills-raw/haythamasalama/skills/coolify-deploy/references/debugging.md), [references/dockerfiles.md](https://skilld.dev/api/skills-raw/haythamasalama/skills/coolify-deploy/references/dockerfiles.md), [scripts/smoke.sh](https://skilld.dev/api/skills-raw/haythamasalama/skills/coolify-deploy/scripts/smoke.sh).
>
> If the user asked to install this Skill, run `npx skilld install haythamasalama/skills/coolify-deploy`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/coolify-deploy`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/haythamasalama/skills/coolify-deploy) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/coolify-deploy`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/coolify-deploy --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/coolify-deploy --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Shipping a web app to Coolify

**Read when:** an app needs a Dockerfile, a first deploy to Coolify, a redeploy, or a broken deploy fixed.
**Owns:** the runtime shape, the image, the web server config, the Coolify settings, the container
checks and the deploy symptoms.

## TL;DR

- Pick the runtime shape first: **static** (nginx serves built files) or **server** (Node runs the
  app). Everything else follows from the table below.
- Ship with a **Dockerfile** in the repo. Why: a local `docker build`, CI and Coolify then run the
  same thing.
- The build script runs the type check before the bundler. Why: a malformed file then fails the
  image build instead of shipping a broken page.
- Test the **container**, not `npm run preview`: health route, a deep link, a retired-URL redirect,
  and `Cache-Control` on `index.html`. Why: all four live in the server config, so only the
  container can break them. `scripts/smoke.sh` checks them.
- `index.html` is never cached; hashed assets are cached for a year. Why: a cached `index.html`
  points at asset names the new build deleted, and returning visitors get a blank page.
- A history-mode SPA needs `try_files $uri $uri/ /index.html`. Why: without it every deep link 404s
  while the home page works.
- The health check runs **inside** the container, so the final image needs `curl` or `wget`.
- The app listens on `0.0.0.0`, on the port set in Coolify. Why: Coolify's proxy can't reach
  `127.0.0.1` inside the container.
- No secrets in the image: `.env` stays out of the build context; secrets are runtime variables.
- If Docker can't run where you are, say so. Never report a deploy as verified without the smoke
  test.

## Pick the shape

| App | Build command | Output | Runtime | Port | Health route |
|---|---|---|---|---|---|
| Vite SPA (Vue, React) | `npm run build` | `dist/` | nginx | 80 | nginx `location = /healthz` |
| Nuxt, prerendered | `nuxt generate` | `.output/public/` | nginx | 80 | nginx `location = /healthz` |
| Nuxt or Nitro, server | `nuxt build` | `.output/` (self-contained) | `node .output/server/index.mjs` | 3000 | `server/routes/healthz.ts` |

Pick **static** when every page can be built ahead of time and the app talks to APIs from the
browser. Pick **server** when pages need per-request data on the server, secrets on the server, or
server routes. A static app has no runtime variables and no secrets: everything is baked in at
build time.

Adding a backend of its own (accounts, a database, an admin) is a different deploy: a second
service, a database, secrets and migrations. Raise it as a decision before adding it.

## Ship flow

1. **Add the files** for your shape from [references/dockerfiles.md](https://skilld.dev/api/skills-raw/haythamasalama/skills/coolify-deploy/references/dockerfiles.md):
   `Dockerfile`, `nginx.conf` and `security-headers.conf` (static only), `.dockerignore`,
   `docker-compose.yml` for local runs, and the health route.
2. **Make the build script type-check first**, for example
   `"build": "vue-tsc --build && vite build"` or `"build": "nuxi typecheck && nuxt build"`.
3. **Build locally:** `npm ci && npm run build`. If the change is visual, open every changed page in
   a browser, light and dark, desktop and phone width. A green build says nothing about looks.
4. **Run and smoke-test the container:**

   ```bash
   docker compose up --build -d          # maps 8080 on your machine to the container port
   WAIT=30 sh <skill>/scripts/smoke.sh http://localhost:8080 \
     /healthz=200 \
     /docs/getting-started=200 \
     /old-pricing=301:/pricing \
     'header /index.html cache-control no-cache' \
     'header /docs/getting-started cache-control no-cache' \
     'header /assets/<a-hashed-file>.js cache-control immutable'
   docker compose down
   ```

   For a Nuxt build, hashed files are under `/_nuxt/`, not `/assets/`. For a server app, drop the
   `index.html` header checks unless the server sets them.
5. **Create the app in Coolify** with the settings in [references/coolify.md](https://skilld.dev/api/skills-raw/haythamasalama/skills/coolify-deploy/references/coolify.md):
   Dockerfile build pack, port, variables, domain.
6. **Push to the deployment branch.** Coolify rebuilds and redeploys. Content that lives in the repo ships the same way: a content change is a redeploy.
7. **Smoke-test the live URL** with the same command and the real domain (no `WAIT`).
8. **Add the CI job** from [references/debugging.md](https://skilld.dev/api/skills-raw/haythamasalama/skills/coolify-deploy/references/debugging.md) so a broken image
   fails the pull request instead of the deploy.

### When Docker can't run here

A `docker build` that fails resolving the base image (blocked registry, a proxy, no daemon) is the
environment, not the Dockerfile. Say so, and check what you can. The step most likely to break the
image is a lockfile out of sync:

```bash
tmp=$(mktemp -d) && cp package.json package-lock.json "$tmp" && (cd "$tmp" && npm ci --ignore-scripts)
```

## Where each topic lives

| Topic | File |
|---|---|
| Dockerfile per shape, `nginx.conf`, security headers, `.dockerignore`, local compose, health route | [references/dockerfiles.md](https://skilld.dev/api/skills-raw/haythamasalama/skills/coolify-deploy/references/dockerfiles.md) |
| Build packs, the settings for a new app, ports, build and runtime variables, health check behaviour, redeploys | [references/coolify.md](https://skilld.dev/api/skills-raw/haythamasalama/skills/coolify-deploy/references/coolify.md) |
| Reading a broken deploy, the symptom → fix table, nginx pitfalls, the CI job | [references/debugging.md](https://skilld.dev/api/skills-raw/haythamasalama/skills/coolify-deploy/references/debugging.md) |
| Container and live-URL checks | `scripts/smoke.sh` (usage in its header) |

## Done when

- [ ] The image builds from a clean checkout with `docker build .`.
- [ ] The build script type-checks before it bundles.
- [ ] `.dockerignore` keeps `node_modules`, build output and `.env*` out of the context.
- [ ] `smoke.sh` passes against the container: health, a deep link, each retired URL,
      `no-cache` on `index.html` and on a deep link, `immutable` on a hashed file.
- [ ] Coolify: Dockerfile build pack, the port matches the app, domain attached with TLS,
      secrets set as runtime-only variables.
- [ ] One health check is in charge (the image's `HEALTHCHECK` or Coolify's), and it passes.
- [ ] `smoke.sh` passes against the live domain.
- [ ] CI builds the image and runs `smoke.sh` on every pull request.
- [ ] Retired URLs are redirected on the server **and** in the client router.
