Platform Services
It is recommended to install certain third-party software for use by digital twins running inside the DTaaS software. These services can only be installed in secure (TLS) mode.
The following services can be installed:
- Influx time-series database and dashboard service
- Grafana visualization and dashboard service
- RabbitMQ AMQP broker and its management interface The MQTT plugin of this broker has been enabled. So, it can also be used as MQTT broker.
- MongoDB database server
- ThingsBoard IoT device management and data visualization platform (with PostgreSQL backend)
- GitLab OAuth2 identity provider and Git repository service
DTaaS Services CLI
A command-line tool for managing DTaaS platform services including MongoDB, InfluxDB, RabbitMQ, Grafana, ThingsBoard, and GitLab.
Features
- Project Initialisation: Generate project structure with config and data directories
- Automated Setup: One command setup of TLS certificates and permissions
- Service Management: Start, stop, and check status of all services
- User Management: Easy creation of user accounts in InfluxDB, RabbitMQ, MongoDB, PostgreSQL, ThingsBoard, and GitLab
- Cross platform: Works on Linux, macOS, and Windows
- Configuration-driven: Reads settings from
config/services.env
Prerequisites
- Python 3.10 or higher
- Docker and Docker Compose
- TLS certificates
Installation
Install the package inside a Python virtual environment:
This installs the dtaas-services command.
To verify the installation:
Quick Start
- Navigate to the desired setup location and generate the project structure:
This creates:
* config is used for storing the service configuration
* data is used by the services for storing data
* certs is used for storing the TLS certificates needed by the services
* compose.services.yml for main services
* compose.thingsboard.yml for ThingsBoard and PostgreSQL
- Update
config/services.envwith the environment values: HOSTNAME: Public hostname of the DTaaS server (used for certificate paths)GITLAB_PORT: Port for the local GitLab instance (default:8090)GITLAB_ROOT_NEW_PASSWORD: Strong password to set for the GitLab root adminTB_SYSADMIN_NEW_PASSWORD: New password for the ThingsBoard system admin- Port numbers for each service
TB_TENANT_ADMIN_PASSWORD: New password for the tenant adminSERVICES_UID: User ID for service file ownership-
SERVICES_GID: Group ID for service file ownership -
Update
config/credentials.csvwith user accounts (format:username,password,email)
Options:
--pathDirectory to generate project structure (default: current directory)
Example:
Usage
Service Setup
After generating the project and configuring the settings:
This command will:
- Copy TLS certificates to the correct locations
- Set up MongoDB certificates and permissions
- Set up InfluxDB certificates and permissions
- Set up RabbitMQ certificates and permissions
- Set up PostgreSQL and ThingsBoard certificates and permissions
Ensure the clean command is run right after:
Managing Services
Now services can be managed by simple commands such as start, stop, remove, restart, and status.
Example:
A specific service can be specified:
Remove services and their volumes:
User Account Management
-
Edit
config/credentials.csvwith user accounts (format:username,password,email) -
Add users to all supported services:
This creates user accounts in InfluxDB, RabbitMQ, MongoDB, PostgreSQL, ThingsBoard, and GitLab (each service is skipped gracefully if it is not running). For GitLab, a Personal Access Token is created for each new user and saved to
config/gitlab_user_tokens.json. -
Add users to a specific service:
ThingsBoard
It is recommended to install the third-party software ThingsBoard for use by digital twins running inside the DTaaS software. This service can only be installed in secure (TLS) mode.
The steps given above install two services:
- ThingsBoard is an IoT device management and data visualization platform
- PostgreSQL is a database server for ThingsBoard
ThingsBoard Installation
Warning: Running
dtaas-services install -s thingsboardmore than once will re-run the ThingsBoard schema migration against an already-populated PostgreSQL database, which can corrupt it. To reinstall from scratch, rundtaas-services clean -s "postgres,thingsboard"first to wipe all data before re-running the install command. Note: It is recommended to specify the service explicitly with-s <service>when installing. Ensure that the clean command has been run before the installation.
Reset the ThingsBoard sysadmin and tenant admin passwords using values
configured in config/services.env:
This command:
- Changes the sysadmin password from the default (
"sysadmin") toTB_SYSADMIN_NEW_PASSWORD - Changes the tenant admin password from the default (
"tenant") toTB_TENANT_ADMIN_PASSWORD
GitLab Installation
Prerequisites:
- The GitLab container joins the
dtaas-servicesDocker network (platform-services), which is created automatically when the other platform services are running. Start them first withdtaas-services startbefore installing GitLab. - Set
REACT_APP_AUTH_AUTHORITYin the client config file to match the local GitLab authority URL used by your DTaaS deployment.
Note: The DTaaS client uses
react-oidc-context, which forces redirects to use HTTPS. GitLab must therefore be served over HTTPS athttps://<hostname>:<GITLAB_PORT>/gitlab
To install and configure the local GitLab instance:
GitLab takes 5 to 10 minutes to become healthy after the first start. The install command checks GitLab readiness and returns immediately:
- If GitLab is healthy: the command runs post-install setup
(password reset, PAT creation, OAuth app registration) and
saves the access token to
config/gitlab_tokens.json. - If GitLab is still starting: the command prints a status hint
and exits. Check progress with
dtaas-services status -s gitlaband re-rundtaas-services install -s gitlabonce the status showshealthy.
Note: After a successful setup,
config/gitlab_tokens.jsonis backed up toconfig/backup_gitlab_tokens.jsonand theroot_passwordentry is removed from the live tokens file. If the GitLab installation becomes corrupted before the root password is changed, the initial password can be found in the backup file:config/backup_gitlab_tokens.json. If that file is also missing, re-install GitLab to generate a new initial password. Warning:config/password.env.currentis managed automatically by the CLI and tracks the current service passwords. Do not edit or delete this file manually, as doing so may cause password reset commands to fail.
To complete the OAuth2 integration with DTaaS and set up GitLab Runner, follow the integration guide and the runner setup guides for either Linux or Windows.
Reset the GitLab root admin password using the value configured in
config/services.env (GITLAB_ROOT_NEW_PASSWORD):
The command reads the new password to GITLAB_ROOT_NEW_PASSWORD
and applies it via the GitLab API.
GitLab Post-Install Flow
The dtaas-services install -s gitlab command performs the following steps
automatically:
- Starts the GitLab Docker container.
- Checks whether GitLab is healthy.
- Reads the auto-generated root password from the container
(
/etc/gitlab/initial_root_password). - Creates an initial Personal Access Token and saves it to
config/gitlab_tokens.json. - Creates server and client OAuth application tokens.
Manual Compose Operations
After generating a services project, services may be operated manually with compose files:
compose.services.ymlcompose.thingsboard.ymlcompose.gitlab.yml
Start manually:
Stop manually:
Troubleshooting
Permission Issues (Linux/macOS)
Docker connectivity
ThingsBoard connection error
After starting ThingsBoard and before adding users or changing passwords, allow some time for initialisation before adding users.