Flowise Server Setup
Learn how to deploy and configure your Flowise server for Supa-Flow.
Official Documentation
For general deployment options and configurations, please refer to the Flowise documentation.
Hugging Face Deployment with Supabase
Follow these instructions to deploy Flowise on Hugging Face with a Supabase backend.
Prerequisites
- A Hugging Face account with CPU upgrade enabled
- Small persistent storage configured
- Supabase project with database credentials (see database setup guide)
Environment Setup
Configure the following environment variables in your Hugging Face space:
Variables:
PORT
- Server port numberDATABASE_TYPE
- Set to "postgres"OVERRIDE_DATABASE
- Database override flagFLOWISE_USERNAME
- Admin usernameDATABASE_HOST
- Supabase database hostDATABASE_NAME
- Database nameDATABASE_USER
- Database user
Secrets:
DATABASE_PASSWORD
- Database passwordFLOWISE_PASSWORD
- Admin passwordFLOWISE_SECRETKEY_OVERWRITE
- Secret key for encryption
Dockerfile Configuration
Use the following Dockerfile for your Hugging Face deployment:
FROM node:18-alpine
USER root
# Arguments that can be passed at build time
ARG FLOWISE_PATH=/usr/local/lib/node_modules/flowise
ARG BASE_PATH=/data/.flowise
ARG DATABASE_PATH=$BASE_PATH
ARG APIKEY_PATH=$BASE_PATH
ARG SECRETKEY_PATH=$BASE_PATH
ARG LOG_PATH=$BASE_PATH/logs
# Set the ARGs as ENV
ENV FLOWISE_PATH=$FLOWISE_PATH
ENV BASE_PATH=$BASE_PATH
ENV LOG_PATH=$LOG_PATH
# Set environment variables
ENV DATABASE_TYPE=postgres
ENV DATABASE_PORT=5432
ENV OVERRIDE_DATABASE=false
# Install dependencies
RUN apk add --no-cache git python3 py3-pip make g++ build-base cairo-dev pango-dev chromium
ENV PUPPETEER_SKIP_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
# Install pnpm globally
RUN npm install -g pnpm
# Clone Flowise repository
RUN git clone https://github.com/FlowiseAI/Flowise.git /app/Flowise
WORKDIR /app/Flowise
# Navigate to packages/components and add supabase-js
RUN cd packages/components && pnpm add @supabase/supabase-js
# Go back to the root directory, install dependencies, and build the project
RUN pnpm install
RUN pnpm build
# Ensure the 'run' script is executable
RUN chmod +x packages/server/bin/run
# Change ownership of the application directory to the 'node' user
RUN chown -R node:node /app/Flowise
# Expose the application port
EXPOSE 3000
# Configure Flowise directories
RUN mkdir -p $FLOWISE_PATH/uploads /data $LOG_PATH && chmod -R 777 $FLOWISE_PATH /data $LOG_PATH
# Switch to the 'node' user
USER node
# Start the application
CMD ["pnpm", "start"]
Post-Deployment
After deployment, you can access your Flowise server using the provided Hugging Face URL. Log in with your configured FLOWISE_USERNAME and FLOWISE_PASSWORD to start creating and managing your AI flows.