Set up an on-premise container

Step-by-step setup of a local BE-Code container on a Windows server using Docker Compose.

Purpose

This page describes the recommended approach for running BE-Code as an on-premise installation on a Windows server with Docker Compose.

Prerequisites

  • Windows Server build 22H2 or later with at least 1 CPU core, 1 GB RAM, and 10 GB of free disk space.
  • Installed and configured Docker Engine and Docker Compose.
  • Access to the BE-terna Azure Container Registry becode.azurecr.io; authentication uses ACR tokens, one token per customer.
  • A valid SSL certificate as cert.pfx in a host directory (for example C:\certs).
  1. Create an application folder, for example C:\be.code.
  2. Create the files docker-compose.yml and .env in that folder.
  3. Fill in docker-compose.yml.
  4. Fill in .env and set passwords.
  5. Start the container and verify availability.

Setup building blocks

Maintain the Docker Compose file

In the application folder, create docker-compose.yml with the following content:

services:
    becode:
        image: becode.azurecr.io/becode:latest
        container_name: becode
        restart: always
        expose:
            - "1880"
        ports:
            - "1880:1880"
        volumes:
            - C:\certs:C:\certs
        env_file:
            - .env

The path before the colon in the volumes entry points to the host directory that holds the cert.pfx file.

Set environment variables in the .env file

Create the file .env in the same folder. The certificate file must be named exactly cert.pfx. Replace userPw with a strong password:

title="BE-terna"
port="1880"
flowfile="C:\\data\\flow.json"
settingsfile="C:\\data\\settings.js"
userPw=""
certificateName="C:\certs\cert.pfx"
certificatePw=""

Start the container

Open a terminal in the application folder and start the container:

docker compose up -d

After startup, BE-Code is available at https://<hostname>:1880/becode. Use the same URL in the BE-Code setup in Business Central.

Process Operational notes Key points for running the on-premise installation securely.
  • Use an individual password in the .env file; the default demo password is only intended for testing.
  • Protect the .env file and the certificate against unauthorized access.
  • Keep the image up to date and plan a maintenance window for docker compose pull and restart.
  • Verify availability after each restart using the Check connection action in Business Central.