UI Bakery is a low-code platform to build apps and automations you never had time for
Get Started • Docs • Tutorials • What's new • Roadmap
Deploying UI Bakery on-premise
Deploy UI Bakery locally to manage your data from your private network
We understand that you might have lots of data accessible from your private network, that’s why you can use UI Bakery self-hosted version for your benefit.
On-premise version grants you:
- A quick setup process
- Custom branding
- Custom domain hosting
- Google SSO
- SAML-based identity providers
- Data is stored securely under your own VPS
✔️ UI Bakery on-premise version license key can be obtained here
⚠️ If you have already installed UI Bakery on-premise version, follow this guide to update your version.
Table of contents
- Installation
- Deploying on Azure VM
- Manual installation
- Kubernetes
- Azure container instance
- Running a standalone database instance
- Running on a remote instance
- Google oauth setup
- SAML authentication setup
- Google Sheets connection setup
- Emails configuration
- Updating on-premise version
Installation
This document describes how to deploy ui-bakery on-prem via install.sh script.
⚠️ The script installs docker and docker-compose, which may upgrade some dependencies under the hood. Please be advised that if you run this script on the OS used as a server for other applications, those applications may break due to that potential dependencies upgrade.
Requirements
- ⚠️ OS Linux Ubuntu 18.04 and above.
- Must have full rights to use "sudo".
Installation steps
-
Run this command preferably from
/homeLinux directory to download, install and launch UI Bakery:curl -k -L -o install.sh https://raw.githubusercontent.com/uibakery/self-hosted/main/install.sh && bash ./install.sh -
In the process, upon request, enter the previously received license code, hosting URL and port.
-
Once the installation is completed, open the browser using URL and port provided earlier. By default it is http://localhost:3030/.
NOTE: If Docker of the version less than the required (minimum 20.10.11) is already installed on the server, and/or Docker Compose (minimum 1.29.2), the script will be stopped. You need to update the versions of components manually and run the script again.
Deploying on Azure Virtual Machine
-
Open Azure Portal and on the search field at the top type in
Virtual machinesand select this item in the result search window -
Click on the
+ Createbutton in the top left corner and selectAzure Virtual machinein the menu -
Select an image of
Ubuntu 18.04or higher -
For instance size, select minimum
Standard_F2s_v2 - 2 vCPUs, 4 GiB memory -
In the
Administrator accountsection in theAuthentication typemenu item selectSSH public keyand it will generate the keys after VM creation -
In
Inbound port rulesleaveSSH(22)as by default -
In the
Networkingtab select existing or create a new Virtual Network and Subnet used by this VM -
In
NIC network security groupselectAdvanced -
In
Configure network security groupclickCreate new -
Click
+ Add an inbound rule -
Add {BakeryPort} (use 3030 by default, you will need to select the same port during UI Bakery installation later) in the
Destination port ranges -
In
ProtocolChooseTCP -
Click
Add -
Check that
SSH (TCP/22)is configured by default. If not, add it manually using the same algorithm as for {BakeryPort} -
Click
Okto finish creating a Network security group -
Click
Review + create -
Click
Create -
After creating and running the virtual machine, connect to it from outside using SSH protocol.
-
Run this command preferably from the
/homeLinux directory to download, install and launch UI Bakery:curl -k -L -o install.sh https://raw.githubusercontent.com/uibakery/self-hosted/main/install.sh && bash ./install.sh -
Upon request, enter the previously received license code, hosting URL - Azure Virtual Machine IP address, and port ({BakeryPort} which you selected in the earlier steps 3030 by default).
-
After the installation is completed and launched, enter the bakery from a browser on your local machine at http://{Public IP address Azure VM}:{BakeryPort}
Manual installation
⚠️ MySQL instance is included into the out of the box container and doesn't require any additional setup. If you need to have a standalone database, read Running a standalone database instance
-
Install docker 20.10.11 version or higher and docker-compose 1.29.2 version or higher
-
Start docker daemon
-
Get on-premise сonfiguration files:
mkdir ui-bakery-on-premise && cd ui-bakery-on-premise && curl -k -L -o docker-compose.yml https://raw.githubusercontent.com/uibakery/self-hosted/main/docker-compose.yml && curl -k -L -o docker-compose-external-db.yml https://raw.githubusercontent.com/uibakery/self-hosted/main/docker-compose-external-db.yml && curl -k -L -o setup.sh https://raw.githubusercontent.com/uibakery/self-hosted/main/setup.sh
-
Get the license key from UI Backery Team. You'll get a key like of the following format:
eyJhbaj8es9fj9aesI6IkpXVCJ9.eyJsjioOHGEFOJeo0JSe98fJEJSEJFImVtYWlsIjoibmlrLnBvbHRvcmF0c2t5QGdtYWlsLmNvbSJ9.2n9q1LmjnBn62KyAM3FlYZ8PzQcxmIK0_mptNv38ufM -
Run
./setup.sh:- Enter the license key
- Enter the port (leave empty for local installation, 3030 port will be used)
- Enter the server URL (leave empty for local installation)
-
Run
docker-compose up -dto start the containers -
Wait until all containers are up and running
-
Open port
3030orUI_BAKERY_PORT(if it was modified in.envfile or entered in./setup.sh) to access UI Bakery instance, then you can create a new account.
Kubernetes
- Clone the repository
git clone git@github.com:uibakery/self-hosted.git - Open the
kubernetesdirectory - Edit the
ui-bakery-configmap.yaml, and set the required variables inside the{{ ... }}, where:
UI_BAKERY_APP_SERVER_NAME- your {server ip address}:3030, for examplehttp://123.123.123.123:3030UI_BAKERY_LICENSE_KEY- get it from UI Bakery team- You either have to run a standalone database instance or make sure standard
PersistentVolumeClaimexists in your cluster.
- Run
kubectl apply -f .
Please note that the application will be exposed on a public ip address on port 3030, so DNS and SSL have to be handled by the user.
Azure container instance
- Login docker to azure.
- Create docker context.
docker context create aci uibakery
- Use new context.
docker context use uibakery
- Clone ui bakery self-hosted repository.
git clone https://github.com/uibakery/self-hosted.git && cd self-hosted
-
UI Bakery requires db to persist its data. So we have to create one. We suggest you using Azure Database for MySQL.
-
Set
UI_BAKERY_LICENSE_KEYvariable in docker-compose-azure-container-instances.yml forbakery-backservice.
- UI_BAKERY_LICENSE_KEY=${UI_BAKERY_LICENSE_KEY:-eyJhbGciOiJIUz}- Set
UI_BAKERY_DB_*variables in docker-compose-azure-container-instances.yml forbakery-backservice.
- UI_BAKERY_DB_HOST=${UI_BAKERY_DB_HOST:-azure-container-instance-test-db.mysql.database.azure.com} - UI_BAKERY_DB_PORT=${UI_BAKERY_DB_PORT:-3306} - UI_BAKERY_DB_DATABASE=${UI_BAKERY_DB_DATABASE:-bakery} - UI_BAKERY_DB_USERNAME=${UI_BAKERY_DB_USERNAME:-uibakeryuser@azure-container-instance-test-db} - UI_BAKERY_DB_PASSWORD=${UI_BAKERY_DB_PASSWORD:-uibakerypassword}
- Up azure container instance.
docker compose -f docker-compose-azure-container-instances.yml up
-
Find assigned IP address. Run
docker psand in colum PORTS you'll find assigned IP address. -
Replace all occurrences of
UI_BAKERY_APP_SERVER_NAMEwith the IP address retrieved in the previous step.
- UI_BAKERY_APP_SERVER_NAME=https://123.123.123.123:80- Restart instance to apply new configuration.
docker compose -f docker-compose-external-db.yml up
Running a standalone database instance
In case when a 3rd party MySQL instance is required:
-
Provide the following environment variables:
UI_BAKERY_DB_HOST=192.168.0.1 UI_BAKERY_DB_PORT=3306 UI_BAKERY_DB_DATABASE=bakery UI_BAKERY_DB_USERNAME=username UI_BAKERY_DB_PASSWORD=password
-
Run
docker-compose -f ./docker-compose-external-db.yml upto start the containers, alternatively,docker-compose -f ./docker-compose-external-db.yml up -dto run containers in the background.
Running on a remote instance
If you would like to run UI Bakery not on localhost, but on a server, you need to provide the following variables:
UI_BAKERY_APP_SERVER_NAME=http://YOUR_DOMAIN_OR_IP:3030 UI_BAKERY_PORT=3030
⚠️ UI_BAKERY_PORT variable must match port in UI_BAKERY_APP_SERVER_NAME variable
In your DNS provider, configure the following records:
- A or CNAME record with UI Bakery instance host
Then modify your environment variable with the following values:
UI_BAKERY_APP_SERVER_NAME=https://YOUR_DOMAIN UI_BAKERY_PORT=80
Google OAuth setup
-
Create OAuth Client ID in Google Developer Console
- Create or choose an existing project.
- Click on “Create credentials”.
- Choose “OAuth Client ID”.
- Choose “Web Application” Application type.
- Specify
http://localhost:3030orUI_BAKERY_APP_SERVER_NAMEfor authorized javascript origin. - Specify
http://localhost:3030/auth/oauth2/callbackorUI_BAKERY_APP_SERVER_NAME/auth/oauth2/callbackfor authorized redirect URLs. - Click “Create”.
- Copy “Your Client ID”.
-
Provide
UI_BAKERY_GOOGLE_CLIENT_ID=Your Client IDenvironment variable. -
Provide
UI_BAKERY_APP_SERVER_NAME=http(s)://youdomain.comenvironment variable in case you want to run UI Bakery on a custom domain/IP. -
Run
docker-compose upif you want to use the embedded database. -
Or run
docker-compose -f ./docker-compose-external-db.ymlup with environment variables described in Running a standalone database instance above in case you want to use an external database.
SAML authentication setup
-
Configure your Identity provider. In identity provider settings, set Sign on URL and Reply URL to
https://APP_LOCATION/api/auth/login/saml. ReplaceAPP_LOCATIONwith UI Bakery instance URL. Configure name and role attributes. You can set claim name in identity provider settings or in UI Bakery env variablesUI_BAKERY_SAML_NAME_CLAIMandUI_BAKERY_SAML_ROLE_CLAIM. -
Provide URL of your identity provider metadata and entity ID via the following env variables:
UI_BAKERY_SAML_METADATA_URL=https://your.identityprovider.com/federationmetadata/2007-06/federationmetadata.xml. UI_BAKERY_SAML_ENTITY_ID=http://appregestry.com/myapp/primary
-
Set variable
UI_BAKERY_SAML_ENABLED=true -
You can add a role mapping from identity provider role to UI Bakery role via env variable:
UI_BAKERY_ROLE_MAPPING=identityRoleName->bakeryRoleName,identityRoleName2->bakeryRoleName2
-
You can set the variable
UI_BAKERY_SAML_LOGIN_AUTOto true to enable automatic login. Any unauthorized user will be redirected to SAML login flow.
Other authentication setting
-
You can disable email authentication by providing the environment variable
UI_BAKERY_GOOGLE_AUTH_ONLY=true -
Provide
UI_BAKERY_AUTH_RESTRICTED_DOMAIN=domain.comenvironment variable to restrict Google login only to the specified domain.
Limitations
-
Emails won’t be sent from the local instance, although the invitation system works in a way that any invited email can access the organization by creating an account.
-
Google Sheets connection requires additional setup.
Google Sheets connection setup
Start with creating OAuth Client ID in Google Developer Console. Then, follow the below steps:
- Create a new or choose an existing project.
- Go to API & Services section.
- Click ENABLE APIS AND SERVICES and enable Google Sheets API.
- Click on Create credentials and choose Create OAuth client ID.
- Select Web Application.
- Add Authorized redirect URI with value
http://YOUR_IP_OR_DOMAIN/gsheet-oauth-callback - Click Create.
- Set credentials in
UI_BAKERY_GSHEET_CLIENT_IDandUI_BAKERY_GSHEET_CLIENT_SECRETvariables. - Go to OAuth consent screen and create it with an external type.
- Publish your consent screen.
Configuring email provider
By default, UI Bakery On-Premise comes with a noop email provider that will only log emails to the backend logs.
Configure Sendgrid
We suggest using Sendgrid email provider to send the emails:
-
Create a Sendgrid account or use an existing account
-
Generate an API Key with the Mail Send access enabled
-
Set the following environment variables:
UI_BAKERY_MAILING_PROVIDER=sendgrid SENDGRID_API_KEY=YOUR_API_KEY SENDGRID_EMAIL_FROM=your@company.com # make sure this domain is authorized to send emails in your sendgrid account -
Restart the containers.
Once configured, your instance will start using your account to send the user invitation, password reset, and other emails.
Change email templates
By default, email templates and subjects are provided as environment variables, so you can adjust the emails by modifying their content:
# tells that email will be sent as plain text/html UI_BAKERY_MAILING_TEMPLATES_MODE=custom UI_BAKERY_MAILING_WELCOME_TEMPLATE=Hello userName,<br> Welcome to UI Bakery workspace. UI_BAKERY_MAILING_WELCOME_SUBJECT=Welcome to UI Bakery workspace UI_BAKERY_MAILING_RESET_PASSWORD_TEMPLATE=Hello userName,<br> Here's your <a href="resetPasswordUrl">password reset link</a>. UI_BAKERY_MAILING_RESET_PASSWORD_SUBJECT=Reset password request UI_BAKERY_MAILING_CONFIRM_EMAIL_CHANGE_TEMPLATE=Hello userName,<br> Here's a link <a href="changeEmailUrl">to change your email</a>. UI_BAKERY_MAILING_CONFIRM_EMAIL_CHANGE_SUBJECT=Change email request UI_BAKERY_MAILING_SHARE_WITH_USER_TEMPLATE=Hello userName,<br> Here's a <a href="organizationUrl">link to access the organizationName workspace</a>. UI_BAKERY_MAILING_SHARE_WITH_USER_SUBJECT=You are invited to UI Bakery workspace
You can use the following built-in email variables to add user values to your emails:
# All emails userName, userEmail, subject, userId # Reset password request resetPasswordUrl # Invitation email organizationUrl, organizationName # Change email request changeEmailUrl
Alternatively, you can set up email temples using SendGrid dynamic templates and put template ids instead of plain HTML emails:
# tells that email will be sent using dynamic templates
UI_BAKERY_MAILING_TEMPLATES_MODE=provided
UI_BAKERY_MAILING_WELCOME_TEMPLATE=d-c3f84d76543941c084ff2de0exxxxxxx
UI_BAKERY_MAILING_RESET_PASSWORD_TEMPLATE=d-c3f84d76543941c084ff2de0exxxxxxx
UI_BAKERY_MAILING_CONFIRM_EMAIL_CHANGE_TEMPLATE=d-c3f84d76543941c084ff2de0exxxxxxx
UI_BAKERY_MAILING_SHARE_WITH_USER_TEMPLATE=d-c3f84d76543941c084ff2de0exxxxxxx⚠️ Note, that in this case an email subject will be taken from a dynamic template configuration and variables such as UI_BAKERY_MAILING_WELCOME_SUBJECT will be ignored.
This way, you don't need to manage templates content inside of your environment variables and can build more advanced email with images and custom styles.
Updating on-premise version
Once an update to the on-premise version is available, we will notify you via email.
To update your UI Bakery on-premise version, follow the steps below:
- Take a full backup of UI Bakery instance.
- Go to your
ui-bakery-on-premisefolder:
cd ./ui-bakery-on-premise- Run
./update.shthat will download new images and restart your instance:
