Flower Docs
  • OpenFlower overview
    • The "Hello World" tutorial
  • Videos
    • OpenFlower in 100 seconds
  • 🆕Setup and run
    • Cloud & Private Cloud
    • Self-hosting
      • Access local database or API
      • Google Cloud Platform
      • Heroku
      • Migration from Openblocks
      • Update MongoDB Versions
      • OpenFlower Version Update
      • Traefik loadbalancer
      • SMTP Server
    • Security
  • 🏨Workspaces & Teamwork
    • Workspaces
    • Members and Groups
    • Permissions for Resources
    • OAuth
      • KeyCloak
      • Google
      • GitHub
      • Generic OAuth Provider
    • Query library
    • OpenFlower Marketplace
  • ✨Build Applications
    • Create a new App
      • Modules
      • Version and Release Management
    • App Editor
      • Visual Components
        • Common Component Settings
        • File upload
        • Charts and graphs
        • Image
        • Option lists
        • List View
        • Drawer
        • Google Maps
        • Table
        • Messages / Toast
        • Calendar
      • Date handling
      • Bulk Editing
      • Layers
      • Data selection & Javascript
      • Use Markdown
      • Keyboard shortcuts
    • App Navigation
    • App Interaction
      • Event handlers
    • Themes & Styling
      • Design an efficient and user-friendly form
      • Customize Styles
      • Component Styling Possibilities
  • 🚀Connect your Data
    • Data source basics
    • Data sources in OpenFlower
      • APIs as Datasource
        • REST API
        • GraphQL
        • Google Sheets
      • SQL Databases
        • MySQL
        • MariaDB
        • PostgreSQL
        • Microsoft SQL Server
        • Oracle
      • NoSQL Databases
        • MongoDB
        • CouchDB
        • DynamoDB
      • InMemory Databases
        • Redis
      • File Storages
        • S3 File Storage
      • BigData & OLAP
        • Big Query
        • Snowflake
        • ClickHouse
        • Elasticsearch
      • Websocket Datasource
    • Query basics
      • Bind Query Data to Components
      • Query library
  • 🪄Workflows
    • n8n Integration
  • 💫Business Logic in Apps
    • Write JavaScript
      • JavaScript query
      • Temporary state
      • Transformers
      • Data responder
      • Built-in JS functions
  • 🙌Publish Apps
    • Share an App
    • Publish an App
    • Embedd an App
      • Embed Apps in React
      • Native embed SDK
        • Build the SDK from Source
  • 🔥OpenFlower Extension
    • Opensource Contribution
      • Develop UI components for Apps
      • Develop Data Source Plugins
    • Use third-party libraries in Apps
      • Day.js Date handling
      • Import your own JavaScript Library
    • Custom component
    • OpenFlower Open REST API
Powered by GitBook
On this page
  • 1) Start easy:
  • All-in-one image
  1. Setup and run

Self-hosting

PreviousCloud & Private CloudNextAccess local database or API

Last updated 3 months ago

In this article, you will be guided through how to host OpenFlower on your own server using Docker-Compose or Docker.

There are multiple ways of installation. We directly support:

  • to run with a single line of command.

  • Multi-Docker Image deployment for scaling scenarios with

  • Kubernetes-based deployment with .

1) Start easy:

For easy setup and deployment, we provide an that bundles frontend, backend, and data persistence services altogether in one single container.

All-in-one image

Prerequisites

  • (version 20.10.7 or above)

  • (version 1.29.2 or above)

Recommended system spec: 1-core CPU and 2 GB RAM.

Windows users are recommended to use PowerShell for running the commands below.

In your working directory, run the following commands to make a directory named OpenFlower to store the data of OpenFlower:

mkdir openflower
cd openflower

Deploy

Follow the steps below:

curl https://raw.githubusercontent.com/Flowerappeng-org/openflower/main/deploy/docker/docker-compose.yaml -o $PWD/docker-compose.yml
  1. Start the Docker container by running this command:

    docker compose up -d

    The docker image, about 400 MB, is downloaded during the initial start-up.

    After downloading, it usually takes less than 30 seconds to start the service.

  2. Check the logs by running this command:

    docker logs -f openflower

    When you see frontend, backend, redis, and mongo entered the RUNNING state, the OpenFlower service has officially started:

Run the command below:

docker run -d --name openflower -p 3000:3000 -v "$PWD/stacks:/lowcoder-stacks" flowerappengorg/openflower

Update to the latest version

Run the following commands to update to the latest OpenFlower image:

docker-compose pull
docker-compose rm -fsv openflower
docker-compose up -d

</div>

<div data-gb-custom-block data-tag="tab" data-title='Docker'>

Run the following commands to update to the latest OpenFlower image:

<div data-gb-custom-block data-tag="code" data-overflow='wrap'>

```bash
docker pull flowerappengorg/openflower
docker rm -fv OpenFlower
docker run -d --name OpenFlower -p 3000:3000 -v "$PWD/stacks:/OpenFlower-stacks" flowerappengorg/openflower
```

</div>

</div>

</div>

## 2) Scale

For bigger expected loads that need scaling in a cluster environment: [separate images of backend and frontend services](https://hub.docker.com/u/flowerappengorg) with a customizable Dockerfile.

Multi-Image Installation to scale. API-Service & Node-Service can get scaled independently.

</div>

### Separate images: services in stateless containers <a href="#multi" id="multi"></a>

For bigger expected loads that need scaling in a cluster environment, we offer separate images for stateless containers of the backend and frontend service with a customizable Dockerfile. A well-functioning OpenFlower deployment consists of below services:

- **api-service**: Backend service.
- **node-service**: Backend service.
- **frontend**: Frontend service.
- **MongoDB**: Used for persisting data of users, apps, data sources, etc.
- **Redis**: Used for maintaining user sessions, rate-limiter, etc.

#### Prerequisites

- [Docker-Compose](https://docs.docker.com/compose/install/) (version 1.29.2 or above)

#### Deploy

1.  In your working directory, run the following commands to make a directory named `lowcoder` to store the data of OpenFlower:

    ```bash
    mkdir openflower
    cd openflower
    ```

2.  Download the configuration file by clicking [docker-compose-multi.yml](https://github.com/Flowerappeng-org/openflower/blob/main/deploy/docker/docker-compose-multi.yaml) or running the curl command:

    <pre class="language-bash" data-overflow="wrap"><code class="lang-bash"><strong>curl https://github.com/Flowerappeng-org/openflower/blob/main/deploy/docker/docker-compose-multi.yaml -o $PWD/docker-compose-multi.yml
    </strong></code></pre>

3.  Modify service configurations in the downloaded Dockerfile according to your needs:
    - **mongodb**: Start a new MongoDB instance on your host. You can delete this part and modify the environment variable `MONGODB_URI` of the **api-service** to use your own MongoDB.
    - **redis**: Start a new Redis instance on your host. You can delete this part and modify the environment variable `REDIS_URI` of the **api-service** to use your own Redis.
    - **api-service**: Required.
    - **node-service**: Required.
    - **frontend**: Required. Can be optional if you deploy the frontend on CDN.
4.  Start Docker containers by running this command:

    ```bash
    docker-compose -f docker-compose-multi.yml up -d
    ```

5.  Visit [**http://localhost:3000**](http://localhost:3000) and click **Sign up**. OpenFlower will automatically create a workspace for you, then you can start building your apps and invite members to your workspace.

## 3) Update to the latest version <a href="#update-multi" id="update-multi"></a>

Run the following commands to update services to the latest in a Docker Compose installation:

<div data-gb-custom-block data-tag="hint" data-style='info'>

Please also have a look at this [migration / update guide](lowcoder-version-update.md)

</div>

```bash
docker-compose -f docker-compose-multi.yml pull
docker-compose -f docker-compose-multi.yml up -d
```

## 4) Customize the deployment

This section shows how to customize deployment configurations by setting environment variables.

If you have already started Docker containers, you need to restart the containers for new configurations to take effect. For example, the way to **restart** your container running an all-in-one image is:

<div data-gb-custom-block data-tag="tabs">

<div data-gb-custom-block data-tag="tab" data-title='Docker-Compose (Recommend)'>

One single command:

```bash
docker-compose down
docker-compose up -d
```

It picks up configuration changes by stopping containers already in service and recreating new ones.

</div>

<div data-gb-custom-block data-tag="tab" data-title='Docker'>

Run the following commands to stop, remove the container already in service, and start up a new one using the newly customized deployment command.

```bash
docker stop openflower
docker rm openflower
# run your new docker run command
```

</div>

</div>

Below are examples of configuring the all-in-one image by setting environment variables in `docker-compose.yml`. If you are self-hosting with separate images, modify the `openflower-api-service` part of the `docker-compose-multi.yml` file instead.

<div data-gb-custom-block data-tag="hint" data-style='info'>

For more information about configurations and environment variables, see [Configuration](https://github.com/Flowerappeng-org/openflower/tree/main/deploy/docker).

</div>

### Use your own MongoDB and Redis

By default, OpenFlower uses the built-in MongoDB and Redis installed inside the container, and you can replace them with your own MongoDB and Redis clusters.

<div data-gb-custom-block data-tag="tabs">

<div data-gb-custom-block data-tag="tab" data-title='Docker-Compose'>

Add environment variables `MONGODB_URI` and `REDIS_URI` in `docker-compose.yml` downloaded in your working directory.\

</div>

<div data-gb-custom-block data-tag="tab" data-title='Docker'>

Add environment variables `MONGODB_URI` and `REDIS_URI` to the deployment command, as shown below:

<div data-gb-custom-block data-tag="code" data-overflow='wrap'>

```bash
docker run -d --name openflower -e MONGODB_URI=YOUR_MONGODB_URI REDIS_URI=YOUR_REDIS_URI -p 3000:3000 -v "$PWD/stacks:/lowcoder-stacks flowerappengorg/openflower
```

</div>

</div>

</div>

### Run as non-root user

By default, the supervisor will run under the user `uid=9001`. You can specify the uid by adding a docker environment variable `LOCAL_USER_ID` and setting its value to a different **number**, such as `10010`.

<div data-gb-custom-block data-tag="tabs">

<div data-gb-custom-block data-tag="tab" data-title='Docker-Compose'>

Add an environment variable `LOCAL_USER_ID` in `docker-compose.yml` downloaded in your working directory.\

</div>

<div data-gb-custom-block data-tag="tab" data-title='Docker'>

Add an environment variable `LOCAL_USER_ID` to the deployment command, as shown below:

<div data-gb-custom-block data-tag="code" data-overflow='wrap'>

```bash
docker run -d --name openflower -e LOCAL_USER_ID=10010 -p 3000:3000 -v "$PWD/stacks:/lowcoder-stacks" flowerappengorg/openflower
```

</div>

</div>

</div>

## 5) Secure your deployment

### Install SSL certificate

With an SSL certificate, you can securely visit self-hosted OpenFlower with HTTPS protocol. Here are the steps to install your SSL certificate before starting a container:

<div data-gb-custom-block data-tag="tabs">

<div data-gb-custom-block data-tag="tab" data-title='Docker-Compose'>

1. Copy `fullchain.pem` and `privkey.pem` to the `$PWD/stacks/ssl` directory.
2. In `$PWD/docker-compose.yml`, change the value of `ports` to `"3443:3443"`.\

</div>

<div data-gb-custom-block data-tag="tab" data-title='Docker'>

1. Copy `fullchain.pem` and `privkey.pem` to the `$PWD/stacks/ssl` directory.
2. Change the `ports` in the deployment command to `3443:3443`, as shown below:

<div data-gb-custom-block data-tag="code" data-overflow='wrap'>

```bash
docker run -d --name openflower -p 3443:3443 -v "$PWD/stacks:/lowcoder-stacks" flowerappengorg/openflower
```

</div>

</div>

</div>

<div data-gb-custom-block data-tag="hint" data-style='info'>

In cases where you have certificates with names: `server.crt` and `server.key`, you need to rename them first as follows:\
`server.crt` => `fullchain.pem`\
`server.key` => `privkey.pem`

</div>

## 6) Configure the Environment

<div data-gb-custom-block data-tag="hint" data-style='info'>

ENV Variables for Helm, Docker Compose, and Docker installations are to find in the most current version on our Github Repository.

</div>

### ENV Variables for the all-in-one image

This image contains all services needed to run OpenFlower platform in one container.

<table><thead><tr><th width="355">Environment variable</th><th width="263">Description</th><th>Default-Value</th></tr></thead><tbody><tr><td><code>LOWCODER_REDIS_ENABLED</code></td><td>If <strong>true</strong> redis server is started in the container</td><td><code>true</code></td></tr><tr><td><code>LOWCODER_MONGODB_ENABLED</code></td><td>If <strong>true</strong> mongo database is started in the container</td><td><code>true</code></td></tr><tr><td><code>LOWCODER_MONGODB_EXPOSED</code></td><td>If <strong>true</strong> mongo database accept connections from outside the docker</td><td><code>false</code></td></tr><tr><td><code>LOWCODER_API_SERVICE_ENABLED</code></td><td>If <strong>true</strong> openflower api-service is started in the container</td><td><code>true</code></td></tr><tr><td><code>LOWCODER_NODE_SERVICE_ENABLED</code></td><td>If <strong>true</strong> openflower node-service is started in the container</td><td><code>true</code></td></tr><tr><td><code>LOWCODER_FRONTEND_ENABLED</code></td><td>If <strong>true</strong> openflower web frontend is started in the container</td><td><code>true</code></td></tr><tr><td><code>LOWCODER_PUID</code></td><td>ID of user running services. It will own all created logs and data.</td><td><code>9001</code></td></tr><tr><td><code>LOWCODER_PGID</code></td><td>ID of group of the user running services.</td><td><code>9001</code></td></tr><tr><td><code>LOWCODER_MONGODB_URL</code></td><td>Mongo database connection string</td><td><code>mongodb://localhost:27017/lowcoder?authSource=admin</code></td></tr><tr><td><code>LOWCODER_REDIS_URL</code></td><td>Redis server URL</td><td><code>redis://localhost:6379</code></td></tr><tr><td><code>LOWCODER_DB_ENCRYPTION_PASSWORD</code></td><td>Encryption password</td><td><code>lowcoder.org</code></td></tr><tr><td><code>LOWCODER_DB_ENCRYPTION_SALT</code></td><td>Salt used for encrypting password</td><td><code>lowcoder.org</code></td></tr><tr><td><code>LOWCODER_CORS_DOMAINS</code></td><td>CORS allowed domains</td><td><code>*</code></td></tr><tr><td><code>LOWCODER_MAX_REQUEST_SIZE</code></td><td>OpenFlower max request size</td><td><code>20m</code></td></tr><tr><td><code>LOWCODER_MAX_QUERY_TIMEOUT</code></td><td>OpenFlower max query timeout (in seconds)</td><td><code>120</code></td></tr><tr><td><code>LOWCODER_API_SERVICE_URL</code></td><td>OpenFlower API service URL</td><td><code>http://localhost:8080</code></td></tr><tr><td><code>LOWCODER_NODE_SERVICE_URL</code></td><td>OpenFlower Node service (js executor) URL</td><td><code>http://localhost:6060</code></td></tr><tr><td><code>LOWCODER_MAX_ORGS_PER_USER</code></td><td>Default maximum organizations per user</td><td><code>100</code></td></tr><tr><td><code>LOWCODER_MAX_MEMBERS_PER_ORG</code></td><td>Default maximum members per organization</td><td><code>1000</code></td></tr><tr><td><code>LOWCODER_MAX_GROUPS_PER_ORG</code></td><td>Default maximum groups per organization</td><td><code>100</code></td></tr><tr><td><code>LOWCODER_MAX_APPS_PER_ORG</code></td><td>Default maximum applications per organization</td><td><code>1000</code></td></tr><tr><td><code>LOWCODER_MAX_DEVELOPERS</code></td><td>Default maximum developers</td><td><code>100</code></td></tr><tr><td><code>LOWCODER_WORKSPACE_MODE</code></td><td>SAAS to activate, ENTERPRISE to switch off - Workspaces</td><td><code>SAAS</code></td></tr><tr><td><code>LOWCODER_EMAIL_SIGNUP_ENABLED</code></td><td>Control if users create their own Workspace automatic when Sign Up</td><td><code>true</code></td></tr><tr><td><code>LOWCODER_CREATE_WORKSPACE_ON_SIGNUP</code></td><td>IF LOWCODER_WORKSPACE_MODE = SAAS, controls if a own workspace is created for the user after sign up</td><td><code>true</code></td></tr><tr><td><code>LOWCODER_MARKETPLACE_PRIVATE_MODE</code></td><td>Control if not to show Apps on the local Marketplace to anonymous users</td><td><code>true</code></td></tr></tbody></table>

Also, you should set the API-KEY secret, whcih should be a string of at least 32 random characters On linux/mac, generate one eg. with: head /dev/urandom | head -c 30 | shasum -a 256

<table><thead><tr><th width="354">Environment variable</th><th width="263">Description</th><th>Default-Value</th></tr></thead><tbody><tr><td><code>LOWCODER_API_KEY_SECRET</code></td><td>String to encrypt/sign API Keys that users may create</td><td></td></tr></tbody></table>

### ENV Variables for the api-service image

<table><thead><tr><th width="352">Environment variable</th><th width="267">Description</th><th>Default-Value</th></tr></thead><tbody><tr><td><code>LOWCODER_PUID</code></td><td>ID of user running services. It will own all created logs and data.</td><td><code>9001</code></td></tr><tr><td><code>LOWCODER_PGID</code></td><td>ID of group of the user running services.</td><td><code>9001</code></td></tr><tr><td><code>LOWCODER_MONGODB_URL</code></td><td>Mongo database connection string</td><td><code>mongodb://localhost:27017/lowcoder?authSource=admin</code></td></tr><tr><td><code>LOWCODER_REDIS_URL</code></td><td>Redis server URL</td><td><code>redis://localhost:6379</code></td></tr><tr><td><code>LOWCODER_DB_ENCRYPTION_PASSWORD</code></td><td>Encryption password</td><td><code>lowcoder.org</code></td></tr><tr><td><code>LOWCODER_DB_ENCRYPTION_SALT</code></td><td>Salt used for encrypting password</td><td><code>lowcoder.org</code></td></tr><tr><td><code>LOWCODER_CORS_DOMAINS</code></td><td>CORS allowed domains</td><td><code>*</code></td></tr><tr><td><code>LOWCODER_MAX_ORGS_PER_USER</code></td><td>Default maximum organizations per user</td><td><code>100</code></td></tr><tr><td><code>LOWCODER_MAX_MEMBERS_PER_ORG</code></td><td>Default maximum members per organization</td><td><code>1000</code></td></tr><tr><td><code>LOWCODER_MAX_GROUPS_PER_ORG</code></td><td>Default maximum groups per organization</td><td><code>100</code></td></tr><tr><td><code>LOWCODER_MAX_APPS_PER_ORG</code></td><td>Default maximum applications per organization</td><td><code>1000</code></td></tr><tr><td><code>LOWCODER_MAX_DEVELOPERS</code></td><td>Default maximum developers</td><td><code>100</code></td></tr><tr><td><code>LOWCODER_MAX_QUERY_TIMEOUT</code></td><td>OpenFlower max query timeout (in seconds)</td><td><code>120</code></td></tr><tr><td><code>LOWCODER_MAX_REQUEST_SIZE</code></td><td>OpenFlower max request size</td><td><code>20m</code></td></tr><tr><td><code>LOWCODER_WORKSPACE_MODE</code></td><td>SAAS to activate, ENTERPRISE to switch off - Workspaces</td><td><code>SAAS</code></td></tr><tr><td><code>LOWCODER_EMAIL_SIGNUP_ENABLED</code></td><td>Control is users can create their own Workspace when Sign Up</td><td><code>true</code></td></tr></tbody></table>

### ENV Variables for the node-service image

<table><thead><tr><th width="358">Environment variable</th><th width="263">Description</th><th>Default-Value</th></tr></thead><tbody><tr><td><code>LOWCODER_PUID</code></td><td>ID of user running services. It will own all created logs and data.</td><td><code>9001</code></td></tr><tr><td><code>LOWCODER_PGID</code></td><td>ID of group of the user running services.</td><td><code>9001</code></td></tr><tr><td><code>LOWCODER_API_SERVICE_URL</code></td><td>OpenFlower API service URL</td><td><code>http://localhost:8080</code></td></tr></tbody></table>

### ENV Variables for the web frontend image

<table><thead><tr><th width="360">Environment variable</th><th width="263">Description</th><th>Default-Value</th></tr></thead><tbody><tr><td><code>LOWCODER_PUID</code></td><td>ID of user running services. It will own all created logs and data.</td><td><code>9001</code></td></tr><tr><td><code>LOWCODER_PGID</code></td><td>ID of group of the user running services.</td><td><code>9001</code></td></tr><tr><td><code>LOWCODER_MAX_QUERY_TIMEOUT</code></td><td>OpenFlower max query timeout (in seconds)</td><td><code>120</code></td></tr><tr><td><code>LOWCODER_MAX_REQUEST_SIZE</code></td><td>OpenFlower max request size</td><td><code>20m</code></td></tr><tr><td><code>LOWCODER_API_SERVICE_URL</code></td><td>OpenFlower API service URL</td><td><code>http://localhost:8080</code></td></tr><tr><td><code>LOWCODER_NODE_SERVICE_URL</code></td><td>OpenFlower Node service (js executor) URL</td><td><code>http://localhost:6060</code></td></tr></tbody></table>

## Health checks

The API Service has an included health check endpoint from v2.4.1 on.

You can check the health of the running API Service and it's connected MongoDB & Redis by the following HTTP Call:

````bash
```
GET /api/status/health HTTP/1.1
```

In response, you will get a 200 Status code if the service is up and running and a JSON like this:

{
  "status": "UP",
  "components": {
    "mongo": {
      "status": "UP",
      "components": {
        "reactiveMongoSlaveTemplate": {
          "status": "UP"
        },
        "reactiveMongoTemplate": {
          "status": "UP"
        }
      }
    },
    "ping": {
      "status": "UP"
    },
    "redis": {
      "status": "UP"
    }
  }
}

Download the configuration file by clicking or running the curl command:

Visit and click Sign up. OpenFlower will automatically create a workspace for you, then you can start building your apps and invite members to your workspace.

🆕
Single Docker Image
Docker Compose
HELM Charts
Heroku based deployment
Google Cloud Platform
all-in-one image
Docker
Docker Compose
docker-compose.yml
http://localhost:3000