Deployments

Deploy from GitHub, Docker images, Dockerfiles, or Docker Compose. Zero-downtime by default.

GitHub Repository

Deploy any public GitHub repository. Hostwares clones the repo, auto-detects the framework, and configures optimal build settings.

Setup

  1. Click New Project → GitHub Repository
  2. Enter the repository URL (e.g., github.com/user/my-app)
  3. Select the branch (default: main)
  4. Review auto-detected settings
  5. Click Deploy

Auto-detected settings

Repository: github.com/user/my-app
Branch: main
Build command: npm run build (detected from package.json)
Start command: npm start (detected from package.json)
Port: 3000 (detected from framework)
Node version: 20 (detected from engines field)

Supported package managers

  • npm — Detected via package-lock.json
  • yarn — Detected via yarn.lock
  • pnpm — Detected via pnpm-lock.yaml
  • bun — Detected via bun.lockb

Docker Image

Deploy pre-built images from Docker Hub or any container registry:

Image: nginx:alpine
Port: 80

Image: node:20-alpine
Port: 3000
Command: node server.js

Image: ghcr.io/user/my-app:latest
Port: 8080

Private registries

For private images, provide registry credentials in your site's environment variables:

DOCKER_REGISTRY_URL=ghcr.io
DOCKER_REGISTRY_USER=username
DOCKER_REGISTRY_TOKEN=ghp_xxxx

Dockerfile

Full custom control — paste any valid Dockerfile and we build it:

FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:20-alpine AS runner
WORKDIR /app
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./
EXPOSE 3000
ENV NODE_ENV=production
CMD ["npm", "start"]

Multi-stage builds

We recommend multi-stage builds to minimize image size. The final stage should contain only runtime dependencies.

Build Settings

Configure these per site from Site → Settings → Build:

SettingDescriptionExample
Build commandCommand to build your appnpm run build
Start commandCommand to start the appnpm start
Install commandDependency installationnpm ci
PortPort your app listens on3000
Root directorySubdirectory for monoreposapps/web
Node versionRuntime version20

Environment Variables

Set environment variables before deploying — they're available during both build and runtime:

  • From the dashboard: Site → Environment
  • Via AI: "Set DATABASE_URL to postgres://... on my-site"
  • Via API: PATCH /api/sites/:id with envVariables

See the Environment Variables guide for full documentation.

Rollbacks

Every successful deployment is stored. To rollback:

  1. Go to Site → Deployments
  2. Find the previous working deployment
  3. Click Rollback to this version

Or via AI: "Rollback my-site to the previous deployment"

Rollbacks are instant (no rebuild needed) and use the same container image from the original deployment.

Zero-Downtime Deploys

Hostwares uses a blue-green deployment strategy:

  1. New container is built and started
  2. Health checks verify the new container is healthy
  3. Traffic is switched to the new container
  4. Old container is stopped and removed

If the new container fails health checks, the deployment is marked as failed and the old container continues serving traffic.

Deployment Statuses

StatusMeaningAction
QUEUEDWaiting to buildWait — build will start soon
BUILDINGBuild in progressWatch build logs for progress
DEPLOYINGContainer startingWait for health check
RUNNINGLive and healthyNo action needed
STOPPEDManually stoppedStart when ready
FAILEDBuild or runtime errorCheck logs, fix, redeploy

Triggering Deploys

Multiple ways to trigger a new deployment:

  • Dashboard — Click Redeploy on the site page
  • AI"Redeploy my-site" or "Deploy my-site from the develop branch"
  • APIPATCH /api/sites/:id { "action": "deploy" }
  • Git push — Automatic deploy on push to configured branch

Common Issues

  • Build fails — Check logs for missing deps, wrong Node version, or TypeScript errors
  • Port mismatch — Ensure your app listens on the configured port (use process.env.PORT)
  • Missing env vars — Add all required variables before deploying
  • Out of memory — Upgrade plan or optimize your build
  • Timeout — Build exceeds 10-minute limit. Optimize or use a pre-built Docker image

For detailed solutions, see the Troubleshooting guide.