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
.└── DockerfileSample Dockerfile
FROM node:18-alpine
WORKDIR /app
# Install FlowRUN npm install -g total4 flow
# Copy your custom Flow project (if any)COPY . /app
# Default Flow portENV PORT=8000EXPOSE 8000
CMD ["node", "/usr/local/lib/node_modules/flow/flow.js"]Recommended environment variables
PORT– internal port (default8000).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.shwhile Klutch.sh routes to8000inside the container.
Health check (recommended)
curl -I http://localhost:8000Deployment on Klutch.sh
- Push your Dockerfile (and any custom Flow assets) to GitHub.
- In klutch.sh/app, create a new app and select GitHub as the source.
- Klutch.sh automatically detects the Dockerfile in the repository root.
- Choose HTTP traffic and set the internal port to
8000. - Add environment variables such as
FLOW_SECRETandPORTif you override the default. - Attach a persistent volume at
/app/flowssized for your projects and exports. - Deploy and sign in to configure your flows in the browser UI.
Verification
-
UI check: open
https://example-app.klutch.shand 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_SECRETand HTTPS-only access. - Set up backups for
/app/flows. - Add authentication and rate limits in your Flow project as needed.