|
EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
|
This document provides a comprehensive guide to setting up and configuring MeshCentral in a Docker environment.
It includes available options, security measures, and deployment instructions.
MeshCentral provides a couple different Docker container variants:
These variants are pulled through 3 main channels: master and latest.
If you want to target versions, you can also target individual versions; such as 1.1.53.
| Variant | Image tag | Full path |
|---|---|---|
| All database backends | "" (empty) | ghcr.io/ylianst/meshcentral:<version> |
| No database backens (local only) | slim | ghcr.io/ylianst/meshcentral:<version>-slim |
| MongoDB backend included | mongodb | ghcr.io/ylianst/meshcentral:<version>-mongodb |
| PostgreSQL backend included | postgresql | ghcr.io/ylianst/meshcentral:<version>-postgresql |
| Mysql/MariaDB backend(s) included | mysql | ghcr.io/ylianst/meshcentral:<version>-mysql |
So for a quick example: if you want to get the bleeding edge code with a PostgreSQL backend: ghcr.io/ylianst/meshcentral:master-postgresql
So for another quick example: if you want to get a complete image at the latest released version: ghcr.io/ylianst/meshcentral:latest
So for another quick example: if you want to get a released version with a MongoDB backend: ghcr.io/ylianst/meshcentral:latest-mongodb
So for another quick example: if you want a very slim image with the latest code and only a local database: ghcr.io/ylianst/meshcentral:master-slim
So as a last example: if you want to get a MariaDB/MySQL backend with MeshCentral version 1.1.53: ghcr.io/ylianst/meshcentral:1.1.53-mysql
The Docker image has since recently removed its default creation of volumes. It might not be what you want.
If you still want to use volumes to make data persist across containers use Docker volumes (or Kubernetes PVCs).
For examples of how to use these volumes, see the examples below. Most data resides inside:
Below is a breakdown of environment variables used in this setup.
| Variable | Default Value | Description |
|---|---|---|
| NODE_ENV | production | Specifies the Node.js environment. |
| CONFIG_FILE | /opt/meshcentral/meshcentral-data/config.json | Path to the configuration file. |
| DYNAMIC_CONFIG | false | Enables/disables dynamic configuration. This means config is being rechecked every container restart. False if you want to use your own config.json |
| ALLOW_PLUGINS | false | Enables/disables plugins. |
| ALLOW_NEW_ACCOUNTS | false | Enables/disables new account creation. |
| ALLOWED_ORIGIN | false | Enables/disables allowed origin policy. |
| ARGS | "" | Additional arguments for MeshCentral. |
| HOSTNAME | localhost | Specifies the hostname. |
| PORT | 443 | Specifies the port. |
| REDIR_PORT | 80 | Specifies the redirection port. |
| IFRAME | false | Enables/disables embedding in an iframe. |
| LOCAL_SESSION_RECORDING | true | Enables session recording. |
| MINIFY | true | Minifies the JavaScript and HTML output. |
| REGEN_SESSIONKEY | false | Regenerates the session key on each restart of the container. |
| REVERSE_PROXY | "" | Configures reverse proxy support through certUrl. |
| REVERSE_PROXY_TLS_PORT | "443" | Configures reverse proxy TLS port, will be combined with: REVERSE_PROXY. |
| WEBRTC | false | Enables/disables WebRTC support. |
| Variable | Default Value | Description |
|---|---|---|
| USE_MONGODB | false | Enables MongoDB usage. |
| USE_POSTGRESQL | false | Enables PostgreSQL usage. |
| USE_MARIADB | false | Enables MariaDB usage. |
| Variable | Default Value | Description |
|---|---|---|
| MONGO_HOST | "" | MongoDB server hostname. |
| MONGO_PORT | 27017 | MongoDB server port. |
| MONGO_USERNAME | "" | MongoDB username. |
| MONGO_PASS | "" | MongoDB password. |
| MONGO_URL | "" | Overrides other MongoDB connection settings. |
| Variable | Default Value | Description |
|---|---|---|
| PSQL_HOST | "" | PostgreSQL server hostname. |
| PSQL_PORT | 5432 | PostgreSQL server port. |
| PSQL_USER | "" | PostgreSQL username. |
| PSQL_PASS | "" | PostgreSQL password. |
| PSQL_DATABASE | "" | PostgreSQL database name. |
| Variable | Default Value | Description |
|---|---|---|
| MARIADB_HOST | "" | MariaDB server hostname. |
| MARIADB_PORT | 3306 | MariaDB server port. |
| MARIADB_USER | "" | MariaDB username. |
| MARIADB_PASS | "" | MariaDB password. |
| MARIADB_DATABASE | "" | MariaDB database name. |
Create a .env file:
Then run Docker Compose:
If you want to add a custom healthcheck post-compilation/with precompiled images, then do the following:
This all is based on Docker documentation.
Add the following lines to your compose.yaml:
And if you ever change the port on which MeshCentral INTERNALLY runs on please also change the healthcheck either in your compose or self-compiled Dockerfile.
Also relevant if you change scheme, such as HTTP to HTTPS or vice versa.
This document explains the build process for the MeshCentral Docker image, along with details on various build arguments and how to use them.
The following build arguments are available for customizing the build process:
Here are the shell commands to build the Docker image with different configurations.
If you want to disable both HTML/JS minification and translation during the build process, use the following command:
While in the root git location.