Server in Docker

Docker is an open-source platform designed to simplify and speed up application development. The main idea behind Docker is to create an environment in which applications can run independently of the operating system or infrastructure. The Stimulsoft Server image we have developed for Docker doesn’t require any complex configuration and is almost immediately ready for use. The image already contains and configures everything needed to run and operate the Server on any operating system that supports Docker.

Launch the container

To launch the Server from the image, simply run the "docker" command with the arguments shown below:
docker run --name=stimulsoft-server -p 8080:8080 stimulsoft/server:latest
This command will perform the following actions:
  • create a new container with the name "stimulsoft-server";
  • map the internal port 8080 to the local port 8080;
  • download the latest version of the Server from Docker Hub;
  • start the container with the specified parameters.

After that, you can go to http://localhost:8080 and see the Server running. At this stage, it is not yet possible to fully evaluate the Server, since a database connection is required for its operation.

Preparing the database

For the Server to operate properly, a database is required. The Server supports working with MS SQL, MySQL, and PostgreSQL databases. At this stage, the chosen database server must already be up and running. First, you need to create a separate empty database (data schema) with the selected name, and grant the user permissions to create and modify tables in this database. In the example, the data schema is named "server", and the "root" user has access to all tables.

To pass the database connection string to the Server, you can use environment variables. To do this, add the following arguments to the run command:
docker run --name=stimulsoft-server -p 8080:8080 -e Storage__DatabaseType="MySql" -e Storage__MySqlConnectionString="Server=host.docker.internal; port=3306; Database=server; UserId=root; Pwd=123456;" stimulsoft/server:latest
This command sets the following environment variables:
  • Storage__DatabaseType: the database type, in this case "MySql";
  • Storage__MySqlConnectionString: the connection string for the MySQL database.

In the example, the database server address is set to "host.docker.internal", which is reserved in Docker for connecting a container to applications running on the local computer (the host). If a MySQL server is running on the local computer and is available at "localhost", it will be available inside the container at "host.docker.internal".

To connect to MS SQL or PostgreSQL databases, set the type to "MsSql" or "PostgreSql" and use the corresponding environment variables:
  • Storage__MsSqlConnectionString
  • Storage__PostgreSqlConnectionString

After executing this command, you can go to http://localhost:8080 and see the Server Administrator creation screen. If the administrator has already been created, the login screen will be displayed.

Specifying the Server working directory

The Server requires a location for storing its log files and service files. By default, this directory is located inside the container at the following path:
/var/lib/stimulsoft-server
The easiest way to access the Server’s service files is to map this directory to a directory on the local computer. To do this, simply add one parameter to the run command:
docker run --name=stimulsoft-server -p 8080:8080 -v "c:\docker\stimulsoft-server:/var/lib/stimulsoft-server" -e Storage__DatabaseType="MySql" -e Storage__MySqlConnectionString="Server=host.docker.internal; port=3306; Database=server; UserId=root; Pwd=123456;" stimulsoft/server:latest
The "-v" parameter maps the Windows directory "c:\docker\stimulsoft-server" on the local computer (host) to the internal container directory "/var/lib/stimulsoft-server". All Server service files will now be located in this directory. Even after deleting and recreating the container, or copying the directory with its contents to a new computer, all data will be preserved until this directory is manually deleted.

Configuring HTTPS

For a secure connection to the Server, it is recommended to use the HTTPS protocol, which can also be easily configured using environment variables. Let’s add several required arguments to the run command:
docker run --name=stimulsoft-server -p 8080:8080 -v "c:\docker\stimulsoft-server:/var/lib/stimulsoft-server" -e Storage__DatabaseType="MySql" -e Storage__MySqlConnectionString="Server=host.docker.internal; port=3306; Database=server; UserId=root; Pwd=123456;" -e ASPNETCORE_HTTPS_PORTS=8081 -e Urls="https://*:8081;http://*:8080" -e ASPNETCORE_Kestrel__Certificates__Default__Path="/var/lib/stimulsoft-server/aspnetapp.pfx" -e ASPNETCORE_Kestrel__Certificates__Default__Password="123456" stimulsoft/server:latest
This command sets the following environment variables:
  • ASPNETCORE_HTTPS_PORTS: specifies the internal port that will be used for the HTTPS protocol;
  • Urls: specifies the allowed URL addresses that the internal Kestrel server will listen to, in this case all URLs for ports 8081 and 8080;
  • ASPNETCORE_Kestrel__Certificates__Default__Path: the path to a PFX certificate that should be obtained from a trusted certificate provider. This certificate must be available in the container; the easiest way is to copy it to the Server working directory "c:\docker\stimulsoft-server" and specify the internal path to this directory;
  • ASPNETCORE_Kestrel__Certificates__Default__Password: the certificate password provided by the certificate authority.

After executing this command, you can open https://localhost:8081 in your browser and see the Server Administrator creation screen. If the administrator has already been created, the login screen will be displayed.

If you don’t yet have a certificate, you can generate a local certificate for development and testing purposes. To do this, run the following command:
dotnet dev-certs https -ep "c:\docker\stimulsoft-server\aspnetapp.pfx" -p 123456
A local certificate will be created in the Server working directory using the specified password.

Using the "docker compose" command

To create and manage a container, as well as to launch multiple containers simultaneously and configure connections between them, it is more convenient to use the "docker compose" command. To use it, you need to create a docker-compose.yml file in the "c:\docker" directory, where all parameters for running the Docker container will be defined.

As an example, we can reproduce the equivalent of the "docker" run command described above. Create the file "c:\docker\docker-compose.yml", which in this case will look as follows:
name: stimulsoft-server
services:
  server:
    image: stimulsoft/server:latest
    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=host.docker.internal; port=3306; Database=server; UserId=root; Pwd=123456;"
After that, go to the "c:\docker" directory and run the command "docker compose up". This command will configure the container based on the instructions in docker-compose.yml and start the virtual machine.
The advantage of this approach is the simplicity of editing container parameters, as well as the ability to run several containers and configure connections between them. For example, you can run a separate container with a MySQL database server and configure the Server to work with this container. To do this, simply add the "mysql" image from Docker Hub in the file and change the connection string:
name: stimulsoft-server
services:
  server:
    image: stimulsoft/server:latest
    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=123456;"
  
  mysql:
    image: mysql:8.0
    ports:
      - 3306:3306
    volumes:
      - './mysql:/var/lib/mysql'
    environment:
      MYSQL_ROOT_PASSWORD: "123456"
      MYSQL_DATABASE: "server"
This configuration sets up the container as follows:
  • uses the MySQL Server image version 8.0;
  • maps the local directory "c:\docker\mysql" to the internal directory "/var/lib/mysql" in the MySQL container, where all database tables are stored;
  • maps the local port 3306 to the internal port 3306 of the container for database access;
  • uses environment variables to set the database password and the data schema name, which will be automatically created after the MySQL container starts.

In the connection string, the address of the MySQL server should be specified as the container name, in this case "mysql". After running the "docker compose up" command, two containers will be started and a connection between them will be established. You can then open https://localhost:8081 in your browser and see the Server Administrator creation screen. If the administrator has already been created, the login screen will be displayed.

Additional server settings

In addition to the previously discussed database connection and HTTPS configuration, the Server provides many other settings, grouped into different categories. You can configure email sending parameters, customize elements of the Server web interface, set login options, and define general report generation settings.

Example of some Server settings:
name: stimulsoft-server
services:
  server:
    image: stimulsoft/server:latest
    ports:
      - 8080:8080
      - 8081:8081
    volumes:
      - ./stimulsoft-server:/var/lib/stimulsoft-server
    environment:
      LoginUi__ShowSignUp: false
      Reports__AllowReportCompilation: false
      Smtp__UserName: "Stimulsoft"
      Smtp__Password: "123456"
      NavigationUi__ShowData: false
      MainUi__ShowDownload: false
      Storage__DatabaseType: "MySql"
      Storage__MySqlConnectionString: "Server=host.docker.internal; port=3306; Database=server; UserId=root; Pwd=123456;"
A complete list of all available Server settings with detailed descriptions is available in the documentation on our website.

Updating the Server

One of the advantages of using Docker is the simple version control of the Server. In the example, the "latest" tag is used as the version tag, which always corresponds to the most recent release of the Server and is updated with every new release. If for any reason you need to use a specific version of the Server, you can simply specify it as a tag, choosing one of the versions available in the Docker Hub repository.
name: stimulsoft-server
services:
  server:
    image: stimulsoft/server:2025.3.1
After changing the version, or if you want to re-download the latest "latest" version, you need to pull the updated image from the repository before starting the container. This can easily be done using the "docker compose pull" command. After that, the container can be started again and it will be automatically updated.

To save disk space on your computer, you can remove outdated and unused images. This can be done using the "docker image prune" command. If any of the removed images are required again in the future for creating and running a container, they will be automatically re-downloaded from Docker Hub.

What's next?

Our lessons and technical documentation will help you make your work more efficient. Subscribe to our YouTube channel to receive new videos regularly and find answers to all your queries in our online documentation.

Video lessons

We have prepared many video materials for the designing reports and dashboards. All tutorials are grouped by specific topics and regularly updated and supplemented.

Documentation

Our online user guides describe both the general functionality of the product and provide advice and suggestions for the report design and hints of setting components for reporting.
By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.