Flowise

How to Install Flowise on a VPS: A Complete Step-by-Step Guide

Building AI-powered applications used to mean either paying for expensive SaaS platforms or wrestling with complex Python codebases. Flowise flips that script entirely. It’s an open-source, drag-and-drop tool for building LLM workflows and AI agents, and it needs no PhD to operate. Self-host it on a VPS and you get full control, zero per-seat licensing fees, and the freedom to connect whatever APIs you want.

This guide walks you through the entire process. You’ll go from a bare Ubuntu server to a production-ready Flowise deployment sitting behind Nginx with HTTPS. Let’s get into it.

What Is Flowise?

Think of Flowise as a visual canvas for LangChain. Instead of writing chains and agents in code, you drag components onto a board, connect them together, then hit run. It supports OpenAI, Anthropic, HuggingFace, local Ollama models, and dozens more. You can build chatbots, document Q&A pipelines, autonomous agents, and retrieval-augmented generation (RAG) systems, all from the same interface.

The appeal for self-hosters is obvious. You keep your data on your own machine, you skip the monthly per-user fees, and nothing gets rate-limited by someone else’s infrastructure. A modest VPS handles most workloads comfortably.

Prerequisites

Before running a single command, make sure you have the following in place:

RequirementMinimumRecommended
OSUbuntu 20.04Ubuntu 22.04 LTS
RAM1 GB2 GB or more
CPU1 vCPU2 vCPUs
Storage10 GB20 GB SSD
Node.jsv18v20 LTS
AccessRoot or sudo user 
DomainOptionalStrongly recommended for HTTPS

You’ll also want a basic comfort level with the terminal. Nothing expert-level here. If you can SSH into a server and run commands, you’re good.

Step 1: Connect to Your VPS

Fire up your terminal and SSH into your server. Replace the placeholder with your actual IP address or hostname:

ssh your_user@your_server_ip

Once you’re in, run a full system update before anything else. Stale packages cause weird installation issues, and this takes thirty seconds to avoid hours of debugging later.

sudo apt update && sudo apt upgrade -y

While that runs, install a handful of utilities you’ll need along the way:

sudo apt install -y curl git build-essential

Step 2: Install Node.js via NVM

Flowise runs on Node.js, so this part is non-negotiable. Skip the default apt version though, because it’s almost always outdated. Use NVM (Node Version Manager) instead. It lets you install multiple Node versions side by side and switch between them without touching system files.

Install NVM first:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

Now reload your shell environment so the nvm command becomes available:

source ~/.bashrc

Install Node.js v20 LTS, the most stable option for Flowise as of this writing:

nvm install 20
nvm use 20
nvm alias default 20

Verify it worked:

node -v
npm -v

You should see something like v20.x.x and 10.x.x respectively. If those numbers show up, you’re ready to move on.

Step 3: Install Flowise

Flowise publishes to npm, so installation is refreshingly simple. Install it globally so it’s available as a system command:

npm install -g flowise

The installation pulls down Flowise and all its dependencies. It usually takes one to three minutes depending on your server’s connection speed.

Once it finishes, do a quick test run to confirm everything installed correctly:

npx flowise start

You should see output similar to this:

[Flowise]: Initializing Flowise...
[Flowise]: Server started on Port 3000

Open your browser and navigate to http://your_server_ip:3000. The Flowise canvas should load.

Go ahead and stop the server for now with Ctrl + C. There’s still work to do before leaving it running.

Step 4: Configure Environment Variables

Running Flowise without authentication means anyone who finds the port can access your workflows. That’s a bad idea. Flowise uses environment variables for configuration, so let’s set them up properly.

Create a dedicated directory to house your configuration and database files:

mkdir -p /opt/flowise
cd /opt/flowise

Now create an environment file:

nano .env

Paste in the following and edit the values to suit your setup:

# Server
PORT=3000
FLOWISE_USERNAME=admin
FLOWISE_PASSWORD=your_strong_password_here

# Storage paths
DATABASE_PATH=/opt/flowise/database
APIKEY_PATH=/opt/flowise/apikeys
SECRETKEY_PATH=/opt/flowise/secretkeys
LOG_PATH=/opt/flowise/logs
BLOB_STORAGE_PATH=/opt/flowise/storage

# Optional: override the base URL if behind a proxy
# CORS_ORIGINS=https://yourdomain.com

Important: Use a strong, unique password. Flowise gives you access to your API keys, connected services, and AI pipelines, so treat that login like you’d treat a root password.

Save the file with Ctrl + X, then Y, then Enter.

Create the directories Flowise will use for storage:

mkdir -p /opt/flowise/{database,apikeys,secretkeys,logs,storage}

Step 5: Set Up a Dedicated System User

Running web services as root is a security anti-pattern. Create a dedicated user for Flowise instead:

sudo useradd -r -s /bin/false flowise
sudo chown -R flowise:flowise /opt/flowise

The -r flag creates a system account with no home directory and no login shell. The ownership change means Flowise’s files stay under that user’s control.

Step 6: Keep Flowise Running with PM2

Closing your SSH session kills the Flowise process. PM2 is a process manager that keeps Node.js applications alive, restarts them on crashes, and brings them back after a server reboot.

Install PM2 globally:

npm install -g pm2

Start Flowise through PM2 with your environment file:

pm2 start "npx flowise start" \
  --name flowise \
  --env /opt/flowise/.env \
  -u flowise

Tell PM2 to survive server reboots:

pm2 startup

PM2 will print a command for you to copy and run. It looks like sudo env PATH=... pm2 startup .... Run exactly what it prints. Then save the current PM2 process list:

pm2 save

Here are a few useful PM2 commands to keep in your back pocket:

pm2 status          # Check running processes
pm2 logs flowise    # Tail the Flowise logs
pm2 restart flowise # Restart the app
pm2 stop flowise    # Stop without removing

Step 7: Install and Configure Nginx

Flowise runs on port 3000, but you want it accessible on standard web ports (80 and 443) with a proper domain. Nginx acts as a reverse proxy. It sits at the front door, handles incoming requests, and forwards them to Flowise internally.

Install Nginx:

sudo apt install -y nginx
sudo systemctl enable nginx
sudo systemctl start nginx

Create a new server block for Flowise. Replace yourdomain.com with your actual domain throughout:

sudo nano /etc/nginx/sites-available/flowise

Paste in this configuration:

server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;

    # Security headers
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-XSS-Protection "1; mode=block" always;
    add_header X-Content-Type-Options "nosniff" always;

    # Increase body size limit for large flow uploads
    client_max_body_size 50M;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;

        # WebSocket support (required for real-time streaming)
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';

        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_cache_bypass $http_upgrade;
        proxy_read_timeout 86400;
    }
}

The proxy_read_timeout 86400 line matters more than it looks. Long-running LLM calls can take a while, and without it Nginx would cut the connection prematurely.

Enable the configuration by creating a symlink, then test it:

sudo ln -s /etc/nginx/sites-available/flowise /etc/nginx/sites-enabled/
sudo nginx -t

If the test outputs syntax is ok and test is successful, reload Nginx:

sudo systemctl reload nginx

Step 8: Enable HTTPS with Let’s Encrypt

HTTP is fine for testing. Production deployments need HTTPS, especially when API keys and credentials flow through the interface. Certbot automates the entire certificate process for free.

Install Certbot:

sudo apt install -y certbot python3-certbot-nginx

Make sure your domain’s DNS A record points to your VPS IP before running this. Certbot verifies domain ownership over HTTP, so it needs to reach your server.

Request and install the certificate:

sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com

Certbot will ask for an email address and prompt you to agree to Let’s Encrypt’s terms. It automatically edits your Nginx config to redirect HTTP traffic to HTTPS. Follow the prompts, and within a minute you’ll have a valid, trusted certificate.

Certbot sets up auto-renewal via a systemd timer. Verify it’s active:

sudo systemctl status certbot.timer

Certificates renew automatically every 90 days, so you won’t need to touch this again.

Step 9: Configure Your Firewall

Lock down open ports so only necessary traffic gets through:

sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable

This allows SSH so you don’t lock yourself out, plus HTTP and HTTPS traffic through Nginx. Everything else, including direct access to port 3000, gets blocked.

Confirm the rules:

sudo ufw status

Step 10: Access and Verify Your Installation

Open your browser and navigate to https://yourdomain.com. You’ll land on a login screen. Enter the username and password you set in your .env file earlier.

Once logged in, you’ll see the Flowise canvas. It’s a clean, node-based interface ready for your first flow.

To verify the full stack is healthy, run:

pm2 status
sudo systemctl status nginx

Both should show active and running states.

Keeping Flowise Updated

Flowise ships updates regularly. Updating is straightforward:

# Stop the running instance
pm2 stop flowise

# Update the global package
npm update -g flowise

# Restart
pm2 restart flowise

Always check the Flowise GitHub releases page before updating in production. Breaking changes occasionally sneak in between minor versions.

Troubleshooting Common Issues

Flowise won’t start, “port already in use”

Something else is occupying port 3000. Find and kill it, or change the port in your .env file:

sudo lsof -i :3000
# Kill the offending process
sudo kill -9 <PID>

502 Bad Gateway from Nginx

Flowise isn’t running or isn’t reachable. Check PM2 status and logs:

pm2 status
pm2 logs flowise

Login page appears but credentials fail

Double-check the FLOWISE_USERNAME and FLOWISE_PASSWORD values in /opt/flowise/.env. After any .env change, restart Flowise:

pm2 restart flowise

Certbot fails to issue a certificate

Your domain’s DNS probably hasn’t propagated yet, or the A record points to the wrong IP. Use dig yourdomain.com to confirm where it resolves. Wait a few minutes, then try again.

WebSocket errors in the browser console

Check that the Upgrade and Connection headers are present in your Nginx config. Also confirm proxy_read_timeout is set to a high value, since streaming LLM responses keep connections open for extended periods.

What to Build Next

With Flowise running, you’ve got a capable AI orchestration layer at your fingertips. Here are some directions worth exploring:

  • RAG pipelines: Connect a vector store like Pinecone, Qdrant, or Weaviate, then build document chat interfaces over your own files.
  • AI agents: Give an LLM tools like web search, a calculator, or custom API calls, then watch it reason through multi-step tasks.
  • Chatbot widgets: Flowise generates embeddable chat widgets you can drop into any website.
  • API endpoints: Every flow exposes a REST API, so you can call it from external applications.

Wrapping Up

That’s the full picture. Node.js through NVM, Flowise as a global npm package, PM2 keeping things alive, Nginx fronting it all, and Let’s Encrypt handling your certificates. It’s a reliable, production-grade stack you can trust.

The real advantage of self-hosting Flowise isn’t just the cost savings. It’s the absence of constraints. You’re not working inside someone else’s rate limits or data retention policies. Your flows, your API keys, your server. That’s a meaningful difference the moment you start building anything serious.

Now go build something interesting.