Deploying Flowise to Fly.io

Flowise is an amazing tool for building AI flows quickly and Fly.io is a great platform for deploying your applications. In this guide, we will show you how to deploy a Flowise server to the Fly.io network.

Create the docker file

Start by copying the below code into a Dockerfile and make modifications as needed. This guide is setup to use the latest version of Flowise and assumes you are not using a separate database. It is super short and pretty much all it does is set up the right folders for you and install the packages.

FROM node:20-bookworm-slim

USER root

# You can install a specific version like: flowise@1.0.0
WORKDIR /app
RUN npm install flowise

ENV PATH="/usr/bin/npx:$PATH"

EXPOSE 3000
CMD ["npx","flowise","start"]

Now you can create your Fly.toml file. This file is used to configure your Fly.io deployment. Here is an example of what you might use. You shouldn't have to modify much on it. The Paths are important to make sure your data gets preserved between deployments.

app = 'your-flowise-app'
primary_region = 'ord'

[build]

[env]
  FLOWISE_PASSWORD = 'super-secret-password'
  FLOWISE_USERNAME = 'your-username'
  BLOB_STORAGE_PATH = '/data'
  DATABASE_PATH = '/data'
  SECRETKEY_PATH = '/data'
  APIKEY_PATH = '/data'

[[mounts]]
  source = 'flowise_vol'
  destination = '/data'

[http_service]
  internal_port = 3000
  force_https = true
  auto_stop_machines = true
  auto_start_machines = true
  min_machines_running = 1

  [http_service.concurrency]
    type = 'connections'
    hard_limit = 100
    soft_limit = 50

[[vm]]
  cpu_kind = 'shared'
  cpus = 1
  memory_mb = 512

Launching your Flowise server

You are almost there, nice job! Just a few more commands left to run to set up your volume and launch the server. When you launch the app, tell it to use the current settings found in the toml file. The deployment takes a few minutes, so be patient.

flyctl launch
flyctl volumes create flowise_vol -r ord -size 1
flyctl deploy

That's it! You should now have a Flowise server running on the Fly.io network!

You can use the following command to check the status and logs of your server.

flyctl status
flyctl logs

Updates

The Flowise team is great about keeping their software up to date. If you want to update your server, you can do so by running the following commands.

flyctl deploy

And that is it!

Featured Articles
Deploying CakePHP to Fly.io using Docker
A quick guide on how to create your Docker file for CakePHP when using Fly.io for deployment
Using Tailwind with CakePHP
A quick guide for setting up Tailwind CSS with CakePHP
Deploying Flowise to Fly.io
A quick guide on how to deploy a Flowise server to the Fly.io network
Creating a static HTML template for Tailwind and Alpine JS
A guide for creating a basic HTML template that uses Tailwind for styling and Alpine JS for interactive elements