Setting up SSL on Ubuntu

Set up secure connection to your UI Bakery on-prem instance

The easiest way to secure connection to your UI Bakery instance with an SSL certificate is to use an additional web server that would proxy requests to your UI Bakery instance. Below you can find the instructions on how to do that using a popular web server Nginx, a free SSL certificate that is generated by Let's Encrypt, and a tool to rotate SSL certificates called Certbot.

This tutorial assumes that you would like to configure your UI Bakery instance to be run at the domain and that your environmental variable UI_BAKERY_APP_SERVER_NAME is set to

Install and configure Nginx

On Ubuntu machine run:

sudo apt update
sudo apt install nginx

This would install Nginx on your machine and run it on port 80.

After Nginx is installed, you need to create a configuration for your UI Bakery platform in its configuration. Assuming, that you would like to run UI Bakery at the domain name you need to create the following file located at /etc/nginx/sites-enabled/

server {
        listen 80;
        listen [::]:80;

        index index.html index.htm index.nginx-debian.html;

        client_max_body_size 50M;

        location / {
                proxy_pass http://localhost:3030;

Afterward, you can verify the syntax of your config file using the following command:

sudo nginx -t

If you get any error, open your configuration file and check that the syntax is correct.

Install Certbot

Certbot is a tool that helps you automate the process of acquiring and rotating of SSL certificates. The Certbot team suggests installing the tool using snap. Install it if you don't have it installed already.

sudo snap install core; sudo snap refresh core

Afterward, you can install the Certbot tool:

sudo snap install --classic certbot

Finally, you can link Certbot to the directory available in PATH so you could easily run this tool from the command line without using the full path to the executable:

sudo ln -s /snap/bin/certbot /usr/bin/certbot

Configure Certbot

The easiest way to obtain a certificate and use it in your Nginx configuration is through the Certbot Nginx plugin:

sudo certbot --nginx -d

After you run this command, the SSL certificate would be generated and the Nginx configuration file will be updated. So the only thing left to do is to reload the Nginx server:

sudo systemctl reload nginx

Last updated