Digital Ocean

Learn how to deploy Flowise on Digital Ocean


Create Droplet

In this section, we are going to create a Droplet. For more information, refer to official guide.

  1. First, Click Droplets from the dropdown

  1. Select Data Region and a Basic $6/mo Droplet type

  1. Select Authentication Method. In this example, we are going to use Password

  1. After a while you should be able to see your droplet created successfully

How to Connect to your Droplet

For Windows follow this guide.

For Mac/Linux, follow this guide.

Install Docker

  1. Install docker-compose:

  1. Set permission:

Setup

  1. Clone the repo

  1. Cd into docker folder

  1. Create a .env file. You can use your favourite editor. I'll use nano

  1. Specify the env variables:

  1. Then press Ctrl + X to Exit, and Y to save the file

  2. Run docker compose

  1. You can then view the app: "Your Public IPv4 DNS":3000. Example: 176.63.19.226:3000

  2. You can bring the app down by:

  1. You can pull from latest image by:

Adding Reverse Proxy & SSL

A reverse proxy is the recommended method to expose an application server to the internet. It will let us connect to our droplet using a URL alone instead of the server IP and port number. This provides security benefits in isolating the application server from direct internet access, the ability to centralize firewall protection, a minimized attack plane for common threats such as denial of service attacks, and most importantly for our purposes, the ability to terminate SSL/TLS encryption in a single place.

A lack of SSL on your Droplet will cause the embeddable widget and API endpoints to be inaccessible in modern browsers. This is because browsers have begun to deprecate HTTP in favor of HTTPS, and block HTTP requests from pages loaded over HTTPS.

Step 1 — Installing Nginx

  1. Nginx is available for installation with apt through the default repositories. Update your repository index, then install Nginx:

Press Y to confirm the installation. If you are asked to restart services, press ENTER to accept the defaults.

  1. You need to allow access to Nginx through your firewall. Having set up your server according to the initial server prerequisites, add the following rule with ufw:

  1. Now you can verify that Nginx is running:

Output:

Next you will add a custom server block with your domain and app server proxy.

Step 2 — Configuring your Server Block + DNS Record

It is recommended practice to create a custom configuration file for your new server block additions, instead of editing the default configuration directly.

  1. Create and open a new Nginx configuration file using nano or your preferred text editor:

  1. Insert the following into your new file, making sure to replace your_domain with your own domain name:

  1. Save and exit, with nano you can do this by hitting CTRL+O then CTRL+X.

  2. Next, enable this configuration file by creating a link from it to the sites-enabled directory that Nginx reads at startup, making sure again to replace your_domain with your own domain name::

  1. You can now test your configuration file for syntax errors:

  1. With no problems reported, restart Nginx to apply your changes:

  1. Go to your DNS provider, and add a new A record. Name will be your domain name, and value will be the Public IPv4 address from your droplet

Nginx is now configured as a reverse proxy for your application server. You should now be able to open the app: http://yourdomain.com.

Step 3 — Installing Certbot for HTTPS (SSL)

If you'd like to add a secure https connection to your Droplet like https://yourdomain.com, you'll need to do the following:

  1. For installing Certbot and enabling HTTPS on NGINX, we will rely on Python. So, first of all, let's set up a virtual environment:

  1. Afterwards, run this command to install Certbot:

  1. Now, execute the following command to ensure that the certbot command can be run:

  1. Finally, run the following command to obtain a certificate and let Certbot automatically modify the NGINX configuration, enabling HTTPS:

  1. After following the certificate generation wizard, we will be able to access our Droplet via HTTPS using the address https://yourdomain.com

Set up automatic renewal

To enable Certbot to automatically renew the certificates, it is sufficient to add a cron job by running the following command:

Congratulations!

You have successfully setup Flowise on your Droplet, with SSL certificate on your domain 🥳

Steps to update Flowise on Digital Ocean

  1. Navigate to the directory you installed flowise in

  1. Stop and remove docker image

Note: This will not delete your flows as the database is stored in a separate folder

  1. Pull the latest Flowise Image

You can check the latest version release here

  1. Start the docker

Last updated