Skip to main content
Version: DeepHub 2024 R2 - 2.6.0

Running the DeepHub® Locally

Getting Started

This tutorial is designed for partners and customers as a step-by-step guide when working with the DeepHub®. It includes the following sections:

  • System Prerequisites for the DeepHub® - This section provides information on prerequisites of the system in terms of the software tools and technical knowledge needed for the DeepHub® installation.
  • Install the DeepHub® - This section provides step-by-step instructions on how to install the DeepHub®.
  • User Instructions for the DeepHub® - This section provides essential information on how to operate the DeepHub® from the end user perspective.

System Prerequisites

Docker

Docker is an open-source project for automating the deployment of applications as portable, self-sufficient containers that can run on the cloud or on-premises. Docker image containers can run natively on Linux and Windows. Developers can use development environments on Windows, Linux, or macOS. On the development computer, the developer may run a Docker host where Docker images are deployed.

  • Image: A Docker image is a file, comprised of multiple layers, that is used to execute code in a Docker container. It is a package that contains all necessary files for a containerized application to run. When the Docker user runs an image, it can become one or multiple instances of the container.

  • Container: An instance of a Docker image. A container represents the execution of a single application, process, or service. It consists of the contents of a Docker image, an execution environment, and a standard set of instructions.

  • Docker Compose: A tool for defining and running multi-container Docker applications.

Based on your operating system, you can download and install Docker Desktop here: Docker Desktop. While installing Docker on your machine, ensure you allow the installation to bypass any firewall settings (if prompted). Once the installation process is complete, your machine will restart.

note

With "Docker Desktop for Windows", Docker is not only available within the Windows OS itself, but also inside an installed WSL ("Windows Sub-System for Linux") Linux distribution.


If you only want to use WSL, you could skip Docker Desktop for Windows and simply install docker within the WSL Linux distribution. In this case, make sure to install all recommended additional packages as well. Specifically, docker compose is highly recommended to easily run the DeepHub and the DeepHub UI.

info

For security reasons, we recommend running Docker in the so-called "Rootless mode" on Linux operating systems. See the official Docker in Rootless mode documentation for details.

Windows PowerShell or Command Prompt

A shell is a user interface that gives you access to various services of an operating system. A shell can be command-line based, or it can include a graphical user interface (GUI). Windows PowerShell is a shell developed by Microsoft for task automation and configuration management. It is cross-platform and consists of a command-line shell and scripting language. PowerShell capabilities allow users to simplify and automate repetitive tasks by creating scripts and combining multiple commands. The Windows operating system comes with Windows PowerShell pre-installed. However, Windows PowerShell can be installed for other operating systems here: Windows PowerShell. Aside from Windows PowerShell, the classic Windows Command Prompt is also pre-installed and can be used.

Terminal for Linux & macOS

A terminal is a program that allows the use of the command-line in a graphical environment. In a Linux system, the shell is a command-line interface that interprets a user’s commands and script files, and notifies the server’s operating system what to do with them. Terminal is pre-installed on Linux and macOS. For more information, please read e.g. Ubuntu Tutorials.

Docker and Docker Compose

Using Docker or Docker Compose on Windows and Linux is done via a command line shell and is almost identical on both platforms. You can use PowerShell or Command Prompt on Windows and a shell like bash or zsh on Linux. Refer to DeepHub System Prerequisites for details.

Using Docker or Docker Compose

We recommend using Docker Compose because this way you will get a completely configured "system" consisting of the DeepHub®, the DeepHub® UI and a containerized web server, acting as a reverse proxy, to simplify the overall usage and interaction of these components.

We provide a Docker Compose file that configures the necessary orchestration between these containers. Refer to the next section for more details.

Nevertheless, you are able to pull just the Docker container that you need instead of all of them.

docker pull flowcate/deephub:<tag of release you want to pull>
info

The DeepHub® itself, as well as the corresponding DeepHub® UI, are available at Docker Hub: Flowcate@docker.

Getting the Latest Docker Compose File

We provide a docker-compose.yml file and additional configuration files for orchestration of the DeepHub® itself, as well as the corresponding DeepHub® UI, in our GitHub repository: deephub-basic-setup by Flowcate@github.

We recommend creating a dedicated local directory on your filesystem where you store the docker-compose.yml and the aforementioned configuration files. This happens automatically if you use git clone to pull the complete repository.

The DeepHub® needs to create some additional files during operations and writes them to directories mounted from your host filesystem. This is done relative to the location of the docker-compose.yml file and will therefore happen within some of the directories that are part of the deephub-basic-setup repository.

Explanation of the Docker Compose File

Our Docker Compose file consists of three "services":

  • "deephub"
  • "deephub-ui"
  • "deephub-apache"

Each corresponds to one Docker image (indicated by the name) and a resulting Docker container when started. Within each service section, Docker-specific details can be configured as well as environment variables for the processes running within a container. Let's pick an example section:

deephub:
image: flowcate/deephub:latest
restart: unless-stopped
read_only: true
logging:
driver: 'json-file'
options:
max-file: '2'
max-size: '10m'
environment:
- DEEPHUB_PORT=7081
- DEEPHUB_CORS=true
- DEEPHUB_LICENSE_KEY=50f7eb6d-4b4c-4a7b-8d60-0c439328214c
- SQLITE_TMPDIR=/data
ports:
- '7081'
volumes:
- './hub-data/:/data'
networks:
- deephub-net

First of all, there is the service name. In this case, it is "deephub". Next are Docker-specific parameters, such as the image name and tag, the restart policy, and whether the container should run in read-only mode. If the latter is set to "true", no process running within the container is allowed to write to the Docker container's own filesystem. After this comes Docker parameters for logging.

The environment key begins the section containing the environment variables that are made available within the Docker container. You'll notice DeepHub-specific ones, such as the port on which the DeepHub should listen. All DeepHub-specific environment variables start with DEEPHUB, and are followed by an underscore and the capital spelling of the parameter as specified in Server Configuration.

The SQLITE_TMPDIR variable specifies a path to which the SQlite DB can write temporary information. The path has to be a known path from the point of view of the container and has to be writable.

DEEPHUB_PORT refers to the port number within the Docker container. However, it is not necessarily identical to the port on which the process is reachable from outside the container. It is the following section, ports, that makes this port available from the outside. In this particular case, it is the same port the DeepHub process uses within the container. Instead of that simple entry, a "port mapping" could have been specified - including the outside port number and the corresponding inside port number to which it should be mapped.

The volumes section presents the mapping/mounting of external directories to internal directories within containers. In the example above, the external/host directory called "hub-data", relative to the location of the docker-compose.yml file, is mapped to the absolute path /data within the container. The read-only container can write to this external directory if the user and group permissions on the host filesystem are set appropriately.

Start a DeepHub®

  • Open a shell (PowerShell or Command Prompt on Windows, a terminal on Linux or macOS)
  • Change to the directory where your docker-compose.yml file resides. Docker Compose won't work if invoked outside this directory.
  • Invoke Docker Compose. It will take a few minutes to download the Docker images and set up the DeepHub®.

Example:

cd <directory where the docker-compose.yml is>
docker compose up -d
note

On Linux, it may be necessary to call docker compose as superuser via the sudo command.

Now you have your own running DeepHub® instance that can be accessed with any modern web browser at the address: http://localhost:8081

The DeepHub UI

To complement the DeepHub UI shown above, you may also make API calls to the DeepHub REST API while running the DeepHub locally. This can be done with a tool such as Postman or cURL.

The containerized web server included in the Docker Compose bundle acts as a reverse proxy - forwarding requests to either the DeepHub UI or DeepHub containers.

To interact with the REST API, you will need to use the following baseURL: http://localhost:8081/deephub/v1

For example, retrieve an array of all zones:

curl http://localhost:8081/deephub/v1/zones/summary | json_pp

Stop a running DeepHub®

Please make sure you are in the same directory where you invoked docker compose.

To stop a running DeepHub®, execute docker compose down. This ensures the running DeepHub® is stopped and allows the user to modify the configuration data.

Example
cd <directory where the docker-compose.yml is>
docker compose down
note

On Linux, it may be necessary to call docker compose as superuser via the sudo command.

Install Specific Version

It is possible to switch to a specific version of the DeepHub® instead of the latest one, if required.

note

Before installing a specific version of the DeepHub®, it is mandatory to stop a running DeepHub as described above.

Pulling Specific Docker Images

Open the “docker-compose.yml” file. Edit the version of the DeepHub® from “latest” to the desired version. For example, it can be modified from "latest" to “2.5.0”. Similarly, the version of DeepHub® UI can be adapted accordingly.

docker-compose.yml file


Now, the specified version is pulled when executing the following command:

docker compose pull

To start the pulled version, use the typical command described above in Start a DeepHub®.