Mautic module for NethServer 8 (NS8). This repository packages Mautic, an open-source marketing automation platform, with a MariaDB database and exposes it through the NS8 gateway (Traefik) with optional Let's Encrypt TLS.
- Image:
ghcr.io/geniusdynamics/mautic:latest - Orchestrator: NS8 modules (podman-based)
- Status: Stable for evaluation and lab use
- Overview
- Prerequisites
- Quick Start
- Configuration Reference
- Update the Module
- Uninstall
- Smarthost Discovery (SMTP)
- Debugging
- Testing
- UI Development and Translation
- Troubleshooting
- Contributing
- License
This module integrates Mautic into NethServer 8, providing a complete marketing automation solution. It includes:
- Mautic application container
- MariaDB database for data persistence
- Traefik reverse proxy for secure access
- Optional Let's Encrypt SSL certificates
- UI components for NS8 management interface
The module supports dynamic SMTP configuration via smarthost discovery and includes comprehensive testing with Robot Framework.
Before installing the ns8-mautic module, ensure you have:
- A running NethServer 8 (NS8) node with admin access
- A public DNS record pointing to your NS8 gateway (e.g.,
mautic.example.com) - Ports 80 and 443 reachable from the internet if using Let's Encrypt for automatic HTTPS
- Basic familiarity with NS8 module management and Podman containers
Follow these steps to install, configure, and access Mautic on NS8:
Install the module image and create an instance:
add-module ghcr.io/geniusdynamics/mautic:latest 1This command returns a JSON object. Note the module_id, for example:
{
"module_id": "mautic1",
"image_name": "mautic",
"image_url": "ghcr.io/geniusdynamics/mautic:latest"
}Replace mautic1 with your instance ID and adjust the domain and options:
api-cli run configure-module --agent module/mautic1 --data - <<'EOF'
{
"host": "mautic.example.com",
"http2https": true,
"lets_encrypt": false
}
EOFThis configuration:
- Starts and configures the Mautic instance
- Sets up a virtual host for Traefik to route HTTP/HTTPS traffic to Mautic
- Enables HTTP to HTTPS redirection if
http2httpsis true
Get the current configuration to ensure everything is set up correctly:
api-cli run get-configuration --agent module/mautic1- URL:
http(s)://mautic.example.com - If
lets_encryptistrue, a certificate will be requested automatically - If
lets_encryptisfalse, provide your own TLS certificate or use HTTP for internal testing - Set
http2httpstotrueif you plan to terminate TLS at the NS8 gateway
Once configured, you can log in to Mautic using the default credentials (check Mautic documentation for initial setup).
These inputs are accepted by configure-module:
- host (string, required): Fully qualified domain name for public access
- http2https (boolean, default: true): Redirect plain HTTP to HTTPS at the gateway
- lets_encrypt (boolean, default: false): Issue a Let's Encrypt certificate for host
Example without Let's Encrypt (internal lab):
api-cli run configure-module --agent module/mautic1 --data - <<'EOF'
{
"host": "mautic.lab.local",
"http2https": false,
"lets_encrypt": false
}
EOFExample with Let's Encrypt:
api-cli run configure-module --agent module/mautic1 --data - <<'EOF'
{
"host": "mautic.example.com",
"http2https": true,
"lets_encrypt": true
}
EOFTo update the instance to the latest image:
api-cli run update-module --data '{"module_url":"ghcr.io/geniusdynamics/mautic:latest","instances":["mautic1"],"force":true}'To remove an instance and its data:
remove-module --no-preserve mautic1Caution: --no-preserve deletes the instance data.
Some configuration, like outbound SMTP (smarthost), is not passed directly to configure-module. Instead, it is discovered dynamically through Redis keys.
On every Mautic start, the command bin/discover-smarthost refreshes state/smarthost.env with values from Redis to keep the module aligned with the centralized smarthost setup:
- If the smarthost is changed while Mautic is running, the handler events/smarthost-changed/10reload_services restarts the main module service
- See also systemd/user/mautic.service
This mechanism is an example implementation and can be adapted or replaced.
Useful commands when working with an instance named mautic1.
- Inspect environment from the root terminal (loads agent env from /home/mautic1/.config/state):
runagent -m mautic1 env- Enter the agent environment for testing scripts and inheriting module variables:
runagent -m mautic1Your PATH will include:
/home/mautic1/.config/bin:/usr/local/agent/pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/
- Inspect containers:
podman ps
# Example output
# CONTAINER ID IMAGE COMMAND STATUS NAMES
# ... docker.io/library/mariadb:10.11.5 --character-set-s... Up mariadb-app
# ... docker.io/library/nginx:stable-alpine3.17 nginx -g daemon o... Up mautic-app- Print environment variables inside the app container:
podman exec mautic-app env- Open a shell in the app container:
podman exec -ti mautic-app shRun the end-to-end tests with Robot Framework using the helper script:
./test-module.sh <NODE_ADDR> ghcr.io/geniusdynamics/mautic:latestSee: https://robotframework.org/
For detailed UI development instructions, see the NS8 UI Developer Manual.
Translations are managed on Weblate: https://hosted.weblate.org/projects/ns8/
To set up translation syncing:
- Install the GitHub Weblate app: https://docs.weblate.org/en/latest/admin/continuous.html#github-setup
- Add the repository on https://hosted.weblate.org (or ask a NethServer developer to include it in the NS8 Weblate project)
Translation files are located in ui/public/i18n/ and support multiple languages including English, German, Spanish, and more.
- DNS and certificates: ensure the host value has a valid public DNS A/AAAA record pointing to your NS8 gateway before enabling Let's Encrypt
- HTTP to HTTPS redirection: set http2https to true when a certificate is available at the gateway
- Connectivity: verify that port mappings and the Traefik route are active; use podman ps and journal logs
Issues and pull requests are welcome! When submitting changes, please include:
- A short description of the change and the motivation
- Test notes (how you verified the change)
- Any related documentation updates
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes and test thoroughly
- Run tests:
./test-module.sh <NODE_ADDR> ghcr.io/geniusdynamics/mautic:latest - Submit a pull request with a clear description
This project is licensed under the GPL-3.0 License. See the LICENSE file for details.