> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/web/bim/setup-server.md).

# Setting up WebViewer BIM Server

Optimize your BIM workflow with WebViewer BIM Server. Easily set up this REST server using Docker. Configure server settings via JSON or environment variables for seamless 3D document processing. Requ

{% hint style="info" %}
New licenses for WebViewer BIM are no longer offered.
{% endhint %}

WebViewer BIM Server is a REST server for performing 3D document work.

This server comes packaged as a Docker image available for **Linux**, **MacOS Intel (not in M1)** or **Windows**.

## Prerequisites

* Server license key provided by Apryse.
* **Get a trial license key to try for free.**
* Install [Docker CLI](https://docs.docker.com/get-docker/).

## Setting up Server

Pull latest webviewer bim server image:

{% tabs %}
{% tab title="Bash" %}
{% code lineNumbers="true" %}

```bash
docker pull pdftron/webviewer-bim-server:latest
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Configuring Server

The BIM server supports both setting configuration through a `config` file and setting it directly through environment variables. To set configuration through a config file take the following steps:

The configuration file is a JSON file with the following options:

* `license` - The server license key
* `temp_directory` - The temp directory to use for processing. Defaults to `./sys/tmp`
* `log_directory` - The log directory to use for server logs. Defaults to `./sys/logs`
* `data_directory` - The directory to store cached data in. Defaults to `./sys/data`
* `log_level` - Sets the logging level. Accepts `DEBUGINFOTRACEWARN`
* `num_threads` - The number of concurrent jobs to target. Defaults to number of CPUs detected minus 1.
* `bind_address` - The server binding address. Defaults to `0.0.0.0`
* `port` - The server port. Defaults to `8085`
* `max_cache_size` - The maximum cache size before forcing cache deletion. Defaults to 90% of the available disk.
* `force_zero_cache`- Force cache to constantly be removed. Defaults to `false`
* `release_mode` - Sets HTTP to release mode, defaults to `true`.
* `request_timeout` - Maximum time to wait for an HTTP request result in seconds. Defaults to `10` seconds.
* `job_timeout` - Maximum time to wait for a job to complete . Defaults to `10` minutes.
* `use_https` - If `true`, enables HTTPS and uses the HTTPSPort. Defaults to `false`
* `https_port` - HTTPS port, defaults to `443`
* `https_cert_file` - The HTTPS public certificate location.
* `https_key_file` - The HTTPS private certificate location.
* `allowed_origins` - The origins allowed to access the server. Expects a string array `['test.com','pdftron.com']`
* `allow_credentials` - If `true`, includes the [Access-Control-Allow-Credentials](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials/) header in server responses. Required if using `withCredentials` on client-side API calls.

A sample of what the json file should look like.

{% tabs %}
{% tab title="Shell" %}
{% code lineNumbers="true" %}

```sh
{
   "license": "my_license_key",
   "allowed_origins": ["test.com", "pdftron.com"],
   "request_timeout": 30
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

In order to pass these arguments as enviroment variables, just run the docker contianer with variable with the prefix `trn_`, such as:

{% tabs %}
{% tab title="Bash" %}
{% code lineNumbers="true" %}

```bash
docker run -e trn_license="MYLICENSE" -p 8085:8085 pdftron/webviewer-bim-server
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Running Server

### Running with Docker and configuration file

{% tabs %}
{% tab title="Bash" %}
{% code lineNumbers="true" %}

```bash
docker run -p 8085:8085 -v ABSOLUTE_PATH_TO_CONFIG_JSON_FILE:/home/docjob/config pdftron/webviewer-bim-server
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Replace ABSOLUTE\_PATH\_TO\_CONFIG\_JSON\_FILE with the path of your config.json file.**
{% endhint %}

This will mount the config file to the container into the path `/home/docjob/config` where it will be loaded from.

### Running with Docker and environment variables

{% tabs %}
{% tab title="Bash" %}
{% code lineNumbers="true" %}

```bash
docker run -p 8085:8085 -e trn_license="my_license_key" pdftron/webviewer-bim-server
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Replace trn\_license with the license that Apryse provides.**
{% endhint %}

This will run the container with the `trn_license` configuration variable defined.

## Managing Docker

It's important to maintain uptime when using a Docker container. The best way to do this is with a container management tool such as `Portainer`, `Kubernetes`, `OpenShift`, `Docker`, `ECS` and much more.

When managing your container, you can use the built-in [health API](/web/bim/server-api.md#get-v1-health) to monitor its status.

## Include credentials in cross-origin BIM requests

If you enabled `withCredentials` in supported client-side APIs, the BIM server must be configured correctly:

1. Ensure `allow_credentials` is enabled.
2. Ensure `allowed_origins` is not using the default `*` wildcard.

See [client-side documentation](/web/bim/setup-client.md#include-credentials-in-crossorigin-bim-requests) for more details.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/web/bim/setup-server.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
