Mautic security hardening starts before the first login
A team that has installed Mautic, or is about to, needs to decide what to lock down before anyone signs in. Mautic is PHP on the Symfony framework, and it holds contact personal data, consent records, segment logic and the credentials it uses to reach CRMs such as HubSpot and Salesforce. Its public tracking and form endpoints must be reachable from the internet by design, because that is how visitor activity and form submissions arrive. The attack surface therefore includes the open endpoints, the admin area, the database and every stored integration secret, and none of them can be protected by simply placing the application behind a firewall.
Hardening is harder than it looks for three reasons. The project states that Mautic should not be installed on shared hosting and recommends a VPS or dedicated server instead, so the team owns the operating system, web server and PHP settings rather than inheriting them from a host. The stack also spans several moving parts: the web server, the PHP runtime, the database, the cron jobs that update segments and campaigns, and the messenger consumer that processes queued email. Each one needs its own configuration and its own access rules. Finally, the security posture shifts with each release cycle. Mautic publishes monthly patch releases, minor releases every three months and major releases every two years, and support windows differ by version, so a configuration that is safe today needs a patch plan behind it.
The rest of this page covers each of these components in turn: server and PHP configuration, admin access and roles, protection for tracking and form endpoints, API credential handling, consent and personal data controls, and patching. Before starting, confirm which Mautic release and PHP version you will run by checking the Mautic releases page and the Mautic requirements page, and write down who owns each component. Those two answers determine which of the controls below you can apply and which ones your upgrade process must keep working.
Which parts of a Mautic install carry security risk
A self-hosted Mautic install has several distinct surfaces, each with its own exposure. The cards below cover what each one exposes and what to confirm in your own environment before you call the install hardened.
Public web root and tracking endpoints
The web root is the only part of Mautic that anonymous visitors reach. It serves tracking pixels, form submissions, landing pages and the public URLs used for email links. Confirm that only the intended public paths are served by your web server, that administrative and installer paths are not reachable from the internet, and that form endpoints reject abuse such as spam posts and oversized payloads. Test these from outside your network.
Install docsAdmin interface and user accounts
Admin users control contacts, campaigns, integrations and system settings, so a compromised account can expose the whole contact database. Mautic uses basic authentication for its own users and can integrate SAML single sign-on, while the docs describe no LDAP option. Confirm who holds administrator roles, that shared logins are not used, that default permissions for new users are set deliberately, and how accounts are disabled when staff leave.
Authentication docsDatabase holding contact data
The database stores contact records, consent history, form submissions, campaign state and stored credentials for connected services. Anyone with database access can read personal data outside Mautic's permission model. Confirm that the database accepts connections only from the Mautic hosts, that credentials are unique and stored outside the web root, that backups are encrypted and access-controlled, and that the engine version is one still supported by your Mautic release.
Cron jobs and messenger consumer
Cron jobs update segments and campaigns, and the broadcasts command and messenger consumer send queued email. These run as background processes with access to the same database and configuration as the web application. Confirm that they run under a dedicated least-privilege system account rather than root, that their logs do not record personal data or secrets, that failed jobs are visible to operators, and that only one scheduler owns each job so duplicate sends do not occur.
API access and stored CRM credentials
API credentials and the tokens used by CRM plugins, such as HubSpot and Salesforce, let other systems read or write contacts. A leaked token can move personal data out of Mautic without a login. Confirm that each integration uses its own credential with the narrowest scope the vendor offers, that credentials are rotated and revoked when an integration changes, and that they are not stored in plain text in exports, logs or shared configuration files.
HubSpot plugin docsServer and PHP runtime
Mautic runs on PHP with Apache, Nginx or IIS and is not meant for shared hosting. The PHP version, enabled extensions, file permissions and TLS settings define the attack surface beneath the application. Confirm that the PHP version is one your chosen Mautic release supports, that debug output and directory listings are disabled, that application files are not writable by the web user where avoidable, and that the host is a dedicated VPS or server rather than shared hosting.
Requirements pageWhere the trust boundaries sit in a Mautic deployment
The diagram starts with anonymous visitors and tracked browsers reaching the public web endpoints for tracking and forms, which need network restriction and rate limiting at the web server. Staff reach the admin interface through the same web server, so it needs authentication and role control, ideally with SSO and restricted network paths. Behind the web server, the PHP runtime talks to the database, which should accept connections only from the application. Background jobs from cron and the messenger consumer run with their own credentials, and outbound connections to the email sending service and CRM plugins such as HubSpot or Salesforce should use isolated, scoped API credentials. Check each arrow for who can reach it and what credential it carries.
Trust boundaries and credentials in a self-hosted Mautic deployment.
Decisions that shape the hardening work
This table compares the four decisions that most affect how a Mautic install is hardened: installer method, admin access path, where cron and queue workers run, and whether tracking and form endpoints share the admin host. Read each row for the maintenance and exposure it creates, not as a ranking, since the right answer depends on your network and team. Most of the hardening effort follows from these choices, so settle them before configuring PHP or roles.
| Decision | Option and trade-off | When it fits |
|---|---|---|
| Installer method | Web or command-line installer on a production package: fewer moving parts at install time, but upgrades and plugin changes are handled by hand and must be tracked against your own file baseline. | A small, stable install with a documented manual upgrade path and a team comfortable maintaining file integrity. |
| Installer method | Composer project template, recommended since version 4.0: dependencies and upgrades are explicit and reviewable, but the lock file and Composer access become part of your supply chain to control. | Teams that will patch on a schedule and want dependency changes visible in version control. |
| Admin access path | Admin host on a private network or VPN: reduces exposure of the login page to the internet, but staff working remotely and campaign users need reliable network access and the VPN becomes a dependency. | Organizations with a stable corporate network and few remote administrators. |
| Admin access path | Admin behind SAML single sign-on with an identity provider: centralizes login, MFA and offboarding, but Mautic's built-in authentication stays a fallback you must still secure, and the identity provider must send email, first name and last name. | Organizations that already manage staff access through an identity provider and need account removal to follow HR processes. |
| Cron and queue workers | Co-located with the web tier: simplest to set up and monitor, but background jobs compete for the same CPU and can expose worker credentials on a host that serves public traffic. | Low volume installs where segment, campaign and email processing is light. |
| Cron and queue workers | Separate worker hosts without public routing: isolates background jobs and limits what a web compromise can reach, but adds servers to patch, monitor and keep configured to the same Mautic version. | Larger sends or regulated environments that want the public web tier kept as small as possible. |
| Tracking and form endpoints | Shared with the admin host: one hostname and one set of rules to maintain, but any rule that restricts the admin area must be checked so it does not block public tracking or form submissions. | Small installs where the admin area is already restricted by network controls. |
| Tracking and form endpoints | Separate public hostname serving only tracking, form and landing page paths: keeps the admin login off the public surface, but needs DNS, certificate and routing rules maintained for each upgrade. | Public-facing campaigns where the admin area must not be reachable from the internet. |
The hardening sequence from server to application
This sequence moves from the hosting platform inward to the application, so each layer is closed before the next one depends on it. The result is a Mautic install where the server, admin access, public endpoints, credentials, personal data settings and patching each have a documented state the team can verify.
Confirm a dedicated VPS or server
Start by confirming the host. The Mautic project states that Mautic should not be installed on shared hosting and recommends a VPS or dedicated server instead, so the team hosting the install should record the provider, instance type and who holds administrative access to the operating system. Ask the provider to confirm that the account is isolated from other tenants and that no control panel is shared with other sites. Done means a written hosting record exists and the admin list for the operating system has been reviewed and reduced to named people.
Match PHP and database versions to the target release
Choose the target Mautic release first, then set PHP and the database to versions that release supports. Check the Mautic requirements page for the PHP range and the MySQL or MariaDB minimums for that release, and confirm npm is available if you are installing a release that needs it. Do not rely on memory for version numbers. Run the PHP version command on the server and the database version query, and save the output in the change record. Done means both versions appear on the supported list for the chosen release and nothing older is still running.
Lock down web server and PHP settings
Configure Apache, Nginx or IIS so that only the Mautic document root is served, directory listing is off, and only HTTPS is accepted. In PHP, review settings such as expose_php, display_errors, and the functions that are allowed to run, and keep the Mautic application directories outside anything the web server can serve as static files. Confirm that the configuration files and the local configuration file holding database and mailer secrets are not readable by the web user beyond what is needed. Check by requesting a known configuration file and a hidden directory path from outside the network and confirming both return an error, and by checking the headers response for the PHP version disclosure.
Restrict the admin interface and create least-privilege roles
Limit access to the admin area by network path where possible, such as an allowlist at the web server or VPN-only access, and require strong passwords for all accounts. Mautic uses basic authentication for users, and the team should review whether SAML single sign-on is needed and what it would require. Create named user accounts rather than sharing one administrator, then assign roles that match each job, with administrators limited to a few people. Remove or disable accounts for people who have left. Check by listing all users with their roles and confirming every account maps to a named person and a documented need for its role.
Separate or protect public tracking and form endpoints
Tracking pixels, landing pages and form submissions are reachable by anyone, so decide how they are exposed. Route public paths through the web server with rate limiting and request size limits, and keep admin paths on a separate rule set that does not share the same public exposure. Confirm that web application firewall or reverse proxy rules are tested against the endpoints you actually use, because form behavior varies by plugin and template. Check by submitting a test form and a tracking request from outside, confirming they succeed, then confirming that admin paths return denial from the same outside source.
Store API and CRM credentials outside the web root
Place API keys, CRM tokens and mailer credentials in a location outside the web root with file permissions limited to the service account that runs Mautic. Where a CRM plugin such as HubSpot or Salesforce is used, create a dedicated integration user or app with the narrowest scopes the sync needs, and document which object types it can read or write. Plan rotation: record who can rotate each credential and how the application is restarted afterward. Check by searching the web root and the repository for the key strings and confirming no matches, and by listing permissions on the credential files.
Configure consent and personal data handling
Set the consent, contact and data retention options in Mautic to match the policy you have agreed with legal and privacy owners. Decide how contact deletion requests are fulfilled, how do-not-contact status is recorded, and how exports are handled and by whom. Document which custom fields hold personal data. This step produces configuration decisions, not legal advice, so ask your privacy counsel to confirm the consent wording and retention periods. Check by running a test contact through a consent withdrawal and a deletion request, then confirming the record is updated or removed as the policy states.
Enable patching and logging
Set up a regular patch routine that follows the Mautic release cadence: monthly patch releases, minor releases every three months and major releases every two years, as stated on the releases page. Assign an owner for reading release notes and applying patches, and test on a staging copy before production. Enable web server, PHP and Mautic logs, forward them to a location that the admin team can read, and keep them for a period your policy sets. Check by confirming the most recent patch level matches a supported release on the releases page, and by generating a failed login and confirming it appears in the logs.
Access control and secrets handling in Mautic
Mautic holds contact data, consent records and credentials for email and CRM services, so access to the admin console, the server files and the integration keys all matter. The cards below cover the controls to set and the points to confirm against the documentation for your release before you sign off the install.
Admin accounts and role assignment
Create named accounts for each marketer, developer and administrator rather than sharing one login. Give most users roles limited to the areas they actually run, and keep full administrator rights to a short list of people. Review that list at every staff change and remove accounts for anyone who has left. Confirm in your release's docs which permissions each default role grants, since role names and scopes can change between versions.
Basic authentication and SAML limits
Mautic's built-in user login is basic authentication, so password policy, lockout and multi-factor options must be checked against your release rather than assumed. The authentication docs describe a SAML single sign-on option that requires email, first name and last name attributes from the identity provider. The docs describe no LDAP option, so plan around that. Full SSO design is covered in the SSO topic.
Authentication docsProtecting the install and database credentials
The local.php configuration file holds the database password and application secrets, so it should be readable only by the web server user and never served by the web root. Keep the source tree outside directly browsable paths and block web access to configuration, logs and vendor directories in the server config. Store database credentials for a dedicated account with rights only to the Mautic schema, and confirm the file names and paths for your installed version.
API and CRM integration credentials
The HubSpot and Salesforce connectors authenticate with credentials that can read and write contact data, so treat them as high-value secrets. Use a dedicated integration user with the narrowest CRM permissions the sync needs, store keys in the configuration rather than in templates or shared documents, and record who holds them. Set a rotation schedule and test the rotation on staging first, because a failed rotation stops contact pushes silently.
HubSpot plugin docsRestricting cron and messenger entry points
Cron jobs for segments, campaigns and broadcasts, along with the messenger consumer that processes queued email, run on the server rather than through public web URLs. Run them under a dedicated system account, keep their logs readable only by administrators, and confirm that no endpoint exposes them over HTTP. Review the cron job list after each upgrade, since new jobs may be added with the release.
Cron jobs docsOutbound egress for email and CRM
Mautic needs outbound connections to your email sending service and to HubSpot or Salesforce, and nothing else. Restrict outbound traffic from the Mautic host to those destinations and the update channels you use, and log denied attempts. Confirm the exact hostnames and ports each integration uses in its current documentation, because CRM endpoints and email APIs can change over time.
How to test that the hardening holds and fails safely
Verification comes down to five claims you can test from outside and inside the server: the admin interface is unreachable from untrusted networks, a non-admin role cannot reach user management or configuration, tracking and form endpoints accept only the traffic they must, the cron and queue processes run under a non-privileged account, and a failed login or failed cron run is logged and triggers an alert. Test each one after every change to the web server, PHP settings, firewall rules or user roles, not only at launch. Start with a negative test plan that you can script and repeat: send unauthenticated requests to the admin paths from an untrusted network and confirm they are refused or redirected to login, request the configuration and user management pages with the lowest-privileged account you have, and confirm that each request returns a denial and leaves an audit trail.
Next, check for credential leakage. Search web server logs, Mautic logs and any publicly served directory for API keys, database passwords, SAML certificate material and session tokens, and confirm that the directory holding the configuration file is not served by the web server. Request the configuration and environment files directly and confirm you receive no content. For tracking and form endpoints, send malformed, oversized and unexpected-method requests and confirm the responses reveal nothing about the server or the stack beyond what the public pages already show. Confirm the cron and messenger processes run as a dedicated account that cannot write to the web root, and that a deliberately failed cron run (for example, with a database connection temporarily blocked in a test environment) produces a log entry and an alert that reaches a person.
Treat this as a baseline, not a full security assessment. The checks above confirm the configuration you intended is in place, but they do not test whether an authenticated user can escalate privileges, abuse an API token, or chain a form or plugin flaw into data access. Those questions belong in a separate authenticated application security test with a written scope, test accounts for each role, and a retest after fixes. Ask any tester to confirm in writing which Mautic version and plugins are in scope, because the findings depend on the exact release. Keep the results of this baseline with the change record so the next upgrade can be checked against the same list.
What drives the effort and how to keep it down
This table lists the factors that change how much hardening work a self-hosted Mautic install needs, why each one matters, and how to reduce it. Read each row against your own estate to see which drivers apply most to your team's scope. The main takeaway is that most effort comes from the number of accounts, integrations and environments, so limiting those early keeps both the build and the ongoing review smaller.
| Driver | Why it changes the work | How to keep it down |
|---|---|---|
| Admin users and roles | Each user account needs a role, a review and a way to be disabled. Mautic uses basic authentication for users, so every account is managed inside the platform. | Create a small set of roles mapped to real duties, remove dormant accounts, and document who approves each grant. |
| CRM and email integrations | HubSpot and Salesforce plugins hold API credentials and move personal data to another system. Each integration adds credentials, field mappings and data flows to test. | Enable only the integrations the campaign plan needs, and record the direction and fields of each data flow. |
| Custom plugins or themes | Custom code runs with the application's privileges and must be reviewed for input handling, output encoding and dependency risk before each upgrade. | Keep custom code small, pin dependencies, and review it again whenever Mautic moves to a new release. |
| Environments (production, staging, development) | Each environment holds its own configuration, credentials and sometimes copies of contact data, so each one needs the same controls as production. | Use synthetic or masked data outside production, and keep one hardening baseline applied to every environment. |
| SSO requirement | If single sign-on is required, the SAML configuration, certificates, attribute mapping and the fallback login path must all be reviewed. Confirm the exact SSO scope with the vendor docs before committing. | Decide early whether SSO is mandatory, and restrict local accounts to a short break-glass list if SSO is adopted. |
| Compliance evidence (access reviews and consent records) | Assessors often ask for periodic access reviews, change logs and proof of consent handling. These need to be collected and kept current, not built once. | Define the evidence list before go-live, and export user lists, role assignments and consent records on a fixed schedule. |
| Server estate under the install | The web server, PHP settings, database, cron host and mail path each carry their own configuration and patch cycle. The project advises against shared hosting, so a dedicated or VPS host is usual. | Standardize the server build, keep the components on supported versions, and limit which hosts can reach the database and admin interface. |
Patching, backups and records to keep after launch
Hardening decays quickly if nobody owns the upgrade calendar, the backups and the records of who can do what. The cards below cover the recurring work that keeps a self-hosted Mautic install defensible after launch, and each one ties back to a decision made during hardening.
Know the release cadence
Mautic ships monthly patch releases, minor releases every three months and major releases every two years. Each cadence carries a different amount of change, so patch windows, minor upgrades and major migrations need separate slots in the operations calendar. Assign one owner for watching releases and record who receives release notices.
- Patch releases
- Monthly
Build a patch calendar
Tie the calendar to the security support end dates on the releases page. Mautic 7.2 and 6.0 receive security support until 30 September 2026, Mautic 5.2 until 30 June 2026, and Mautic 4.4 has paid Extended Long Term Support through 31 December 2026. Mautic 7.3 is planned as the long-term support release with security support through 31 December 2027. Confirm current support status on the releases page before planning, since dates can change.
- Planned LTS security support
- 31 Dec 2027
Back up database and configuration
Back up the MySQL or MariaDB database together with the configuration file and any custom plugins, themes and cron definitions, so the install can be rebuilt on a matching version. Store copies outside the web server and encrypt them. Test a restore on a separate host at least once per cycle, because a backup that has never been restored is an assumption, not a control.
Retain and review admin logs
Set a log retention period that matches your policy and keep logs of administrator logins, role changes, user creation and exports of contact data. Review them on a fixed schedule, and send web server and PHP error logs to the same store so that suspicious changes can be traced. Confirm with your security team where these logs live and who may read them.
Run periodic access reviews
Review every Mautic user and role on a fixed schedule. Remove accounts for leavers, confirm that service or integration accounts still have a current owner, and check that only the roles needed for campaigns, reporting and administration are assigned. If you use the SAML single sign-on option, compare the Mautic user list with the identity provider so that disabled users do not keep access.
Keep a configuration decision record
Write down each hardening choice: PHP and server settings, the reason for each role grant, how API credentials are rotated, which endpoints are exposed, and the consent handling rules. Store the record next to the runbook and update it at every upgrade. Auditors and new administrators will ask for this record first, and it shortens the review each time a patch changes a setting.
Questions teams ask before hardening Mautic
Can our team harden a self-hosted Mautic install in-house?
Yes, if you have people who already run PHP applications, web servers and databases in production and who can own the work after handover. Hardening covers the web server and PHP configuration, admin access and roles, protection of tracking and form endpoints, API credential handling, consent and personal data settings, and a patching routine. Most teams need someone who can read the Mautic configuration, test changes against a staging copy and document what changed. The harder part is keeping the install patched over time, because Mautic publishes monthly patch releases, quarterly minor releases and major releases every two years. Confirm that your team can commit to that rhythm before you decide to keep the work internal.
What drives the cost and effort of an outside hardening engagement?
The scope of the environments, integrations, users and compliance evidence drives most of the effort. A single production instance with a small admin group is a very different job from several environments, a custom plugin, a SAML single sign-on connection and a CRM integration with stored API credentials. Ask the provider to list in the written scope:
- every environment in scope, including staging and any backups
- the integrations and the credentials each one uses
- the number of admin and user roles to review
- which compliance evidence, if any, you need the work to produce
Fixed-scope quotes should state what is one-time (the hardening pass and documentation) and what recurs (patching, retesting and support retainers).
How long does a Mautic hardening engagement take?
The duration depends on scope, so no fixed figure applies to every install. The main variables are how many environments you run, how many integrations and plugins touch the platform, how much of the configuration is undocumented, and how quickly your team can make decisions and test changes. Ask for a timeline tied to named deliverables in the written scope, and ask which parts depend on your inputs, such as access approvals or change windows. A timeline that does not list its dependencies is hard to hold a provider to.
What must our team provide before hardening starts?
Plan to supply server access, the current configuration, a user list with roles, and an integration inventory. Server access should cover the web server, PHP runtime, database and cron host, with a change window agreed in advance. The integration inventory should name each connected system (for example, a CRM or single sign-on provider), the direction of data flow and where its API credentials are stored. You also need a named owner who can approve decisions about roles, consent settings and change timing, because hardening choices affect marketing operations as well as IT. Confirm these items with your provider before work begins.
Can Mautic run on shared hosting if we harden it carefully?
No. The Mautic project states that Mautic should not be installed on shared hosting and recommends a VPS or dedicated server instead. Shared hosting limits control over the PHP configuration, cron scheduling, process management and file permissions that hardening depends on. Requirements also specify supported PHP versions, MySQL 5.7 or higher with InnoDB or MariaDB 10.2 or higher, and Apache, Nginx or IIS. If your current environment is shared hosting, treat the move to a VPS or dedicated server as part of the hardening scope and budget for it separately. The Mautic requirements page lists the current supported combinations.
How do we stay on a supported Mautic release after hardening?
Pick a target release from the Mautic releases page and track its support end date, then plan upgrades before that date passes. The project publishes monthly patch releases, minor releases every three months and major releases every two years. Mautic 7.2 receives security support until 30 September 2026, and Mautic 7.3 is planned as the long-term support release with security support through 31 December 2027. Check PHP compatibility for each major version, and test plugins and custom code in staging before each upgrade. Many teams schedule a retainer for patching and upgrades so that the hardening settings are reapplied and verified after each change.
Does hardening replace a security test of our Mautic install?
No. Hardening applies known controls, while a security test checks whether those controls work in your environment. A separate assessment should exercise the tracking and form endpoints, test admin and role boundaries, review API credential exposure and confirm how personal data is handled. DeployOpen runs security testing for applications and APIs and for cloud and infrastructure, and prepares findings with fixes and a retest. An independent assessment also helps you decide what to fix first. Ask any provider to state whether the test is performed by the same people who did the hardening, since that affects how independent the findings are.
How DeployOpen scopes, hardens and hands over Mautic
DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside the client's own infrastructure, including Mautic. Each Mautic hardening engagement starts from a written, fixed scope and ends with documented controls, evidence the client's security and compliance teams can review, and a clear handover.
How we scope
- Review the server, PHP, web server and database layout where the Mautic install will run, including whether it sits on a VPS or dedicated server.
- Confirm the Mautic version, PHP version and plugins in use, and which release line the install will stay on.
- Agree in writing which admin accounts, API credentials, tracking endpoints, consent records and integrations are in scope.
How we build
- Harden the server and PHP configuration, restrict access to sensitive paths, and lock down admin roles and login settings.
- Protect tracking and form endpoints, review API credential storage and rotation, and check how personal data and consent records are handled.
- Test the hardened setup against the agreed scope, fix the findings, and retest the changed areas before sign-off.
How we hand over
- Document each control, its configuration location and the reason it was set, so the client's team can maintain it.
- Provide a patching and upgrade runbook that matches the Mautic monthly, quarterly and two-year release cadence.
- Deliver the findings report, retest results and evidence that compliance assessors can review, noting DeployOpen does not issue audit reports or certifications.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after the initial hardening work.
- Retainers can cover patch review, release-line checks and retesting after plugin or configuration changes.
- Ask any partner to confirm which Mautic release lines and support dates apply to your install before you commit to a plan.

