Skip to content

Deploying a Total.js Flow App

Introduction

Total.js Flow is a visual low-code platform for building Node.js flows and APIs. This guide shows how to containerize Flow with a Dockerfile, persist project data, and deploy it to Klutch.sh using HTTP.

Prerequisites

  • GitHub repository containing your Total.js Flow Dockerfile.
  • Klutch.sh project ready in klutch.sh/app.

Project structure

.
└── Dockerfile

Sample Dockerfile

FROM node:18-alpine
WORKDIR /app
# Install Flow
RUN npm install -g total4 flow
# Copy your custom Flow project (if any)
COPY . /app
# Default Flow port
ENV PORT=8000
EXPOSE 8000
CMD ["node", "/usr/local/lib/node_modules/flow/flow.js"]
  • PORT – internal port (default 8000).
  • FLOW_SECRET – optional secret to protect the dashboard.

Persistence

Store flows and data on a volume:

  • Mount path: /app/flows
  • Size: based on expected project assets and backups

Networking

  • Protocol: HTTP
  • Internal port: 8000
  • Users access via https://example-app.klutch.sh while Klutch.sh routes to 8000 inside the container.
Terminal window
curl -I http://localhost:8000

Deployment on Klutch.sh

  1. Push your Dockerfile (and any custom Flow assets) to GitHub.
  2. In klutch.sh/app, create a new app and select GitHub as the source.
  3. Klutch.sh automatically detects the Dockerfile in the repository root.
  4. Choose HTTP traffic and set the internal port to 8000.
  5. Add environment variables such as FLOW_SECRET and PORT if you override the default.
  6. Attach a persistent volume at /app/flows sized for your projects and exports.
  7. Deploy and sign in to configure your flows in the browser UI.

Verification

  • UI check: open https://example-app.klutch.sh and confirm the Flow dashboard loads.

  • API check (if enabled):

    Terminal window
    curl -I https://example-app.klutch.sh

Next steps

  • Protect the dashboard with FLOW_SECRET and HTTPS-only access.
  • Set up backups for /app/flows.
  • Add authentication and rate limits in your Flow project as needed.