In version 2025.3.1, we added the ability to run Stimulsoft BI Server in a Docker container. In this article, we will explain how to configure data transfer over the HTTPS protocol.
HTTPS certificate
An HTTPS certificate (SSL/TLS) provides a secure connection between the client and the server, verifies the authenticity of the website, and encrypts transmitted data. In .NET, you can use either a local self-signed certificate or one purchased from a certification authority. The certificate is essential for data protection, user trust (the lock icon in the web browser), and compliance with standards. During development, it is acceptable to use local certificates, which can be obtained for free.For generating a local .pfx certificate in .NET, you should run the following command:
terminal
dotnet dev-certs https -ep d:/aspnetapp.pfx -p 123456
This command defines the path to save the certificate and the password. Please note!This certificate is intended for development and testing purposes only. For production use, you must obtain a certificate from a trusted certificate authority.
Connecting the certificate
Go to the folder with the Docker container and create a folder ‘stimulsoft-server’. Copy the generated certificate into this folder.Next, edit the docker-compose.yml file to add the parameters required for HTTPS. Specify the port for HTTPS requests, the internal URLs (for production, we recommend to use real domains or IP addresses instead of *), as well as the path to the certificate and its password:
docker-compose.yml
...
ASPNETCORE_HTTPS_PORTS: 8081
Urls: "https://*:8081;http://*:8080"
ASPNETCORE_Kestrel__Certificates__Default__Path: "/var/lib/stimulsoft-server/aspnetapp.pfx"
ASPNETCORE_Kestrel__Certificates__Default__Password: 123456
...
If the directory with the server files has not yet been added, this can be done in docker-compose.yml using the volumes: section:docker-compose.yml
...
volumes:
- ./stimulsoft-server:/var/lib/stimulsoft-server
...
We launch the container using the following command: terminal
docker-compose up
Now Stimulsoft BI Server will be available via HTTPS on port 8081 at https://localhost:8081. For the HTTP protocol, the server is available at http://localhost:8080. The docker-compose.yml file
Here is a full listing of the contents:docker-compose.yml
services:
server:
image: stimulsoft/server:dev
ports:
- 8080:8080
- 8081:8081
volumes:
- ./stimulsoft-server:/var/lib/stimulsoft-server
environment:
ASPNETCORE_HTTP_PORTS: 8080
ASPNETCORE_HTTPS_PORTS: 8081
Urls: "https://*:8081;http://*:8080"
ASPNETCORE_Kestrel__Certificates__Default__Path: "/var/lib/stimulsoft-server/aspnetapp.pfx"
ASPNETCORE_Kestrel__Certificates__Default__Password: 123456
Storage__DatabaseType: "MySql"
Storage__MySqlConnectionString: "Server=mysql; port=3306; Database=server; UserId=root; Pwd=root;"
mysql:
image: mysql:8.0
ports:
- 3306:3306
volumes:
- './mysql:/var/lib/mysql'
environment:
MYSQL_ROOT_PASSWORD: "root"
MYSQL_DATABASE: "server"
Setting up HTTPS in a Docker container for Stimulsoft BI Server enables a secure connection to the server. For testing, you can use locally created certificates, but for a production environment, a valid certificate from a trusted certification authority is required. By following the provided instructions, you can quickly configure secure access to your server. The port settings, certificate name, password, and URLs are given as examples and should be replaced with the values appropriate for your setup.