EspoCRM security hardening

A practical guide for security and platform teams on locking down a self-hosted EspoCRM instance, the decisions it forces, the build sequence, the effort involved and how to verify the result.

On this page

Why EspoCRM security hardening is a project of its own

EspoCRM security hardening means configuring the application's own controls, the web server and TLS, the database and file system, and the update process together, as one piece of work. A self-hosted CRM holds customer contacts, pipeline values and account history, so the security team will expect evidence that each layer was set deliberately, not left at whatever the installer produced. Defaults alone are not enough for that review, because the defaults cover a working installation, not a hardened one.

The ownership is split across several places. Most of the application settings live in the admin interface, including password policy, two-factor authentication, authentication token lifetime and IP restrictions. Other items sit outside the application: TLS configuration and HTTP headers in the web server, database account privileges, file permissions on the server, and the cron job that runs background tasks. A change in one layer can weaken another, so the hardening record should name who owns each setting and where it is stored.

The EspoCRM security documentation recommends enforcing a password policy, requiring two-factor authentication, keeping admin accounts separate from daily work accounts, limiting auth token lifetime, disabling password recovery for admins and restricting access by IP address. Confirm which of these your version exposes in its admin settings and which need configuration outside the UI before you write the control list. Treat that list as the starting baseline for the security review, and agree in advance who signs off each item.

Which EspoCRM components carry the security settings

Hardening an EspoCRM instance spreads across the application, the web server, the database, the host and the upgrade process. Each area below names where the setting lives and who should own it, so that controls are not assumed to be covered by someone else.

Authentication settings

Password policy, two-factor authentication and auth token lifetime are set in the EspoCRM administration area and apply to every user who signs in locally. If you use OpenID Connect or LDAP, confirm which controls stay in the identity provider and which remain in EspoCRM, because EspoCRM's own 2FA is not compatible with OIDC. Your identity team should own the sign-in policy, and your CRM administrator should own token lifetime and fallback login settings.

Security docs

Admin account controls

Administrator accounts carry full configuration and data access, so the EspoCRM security docs recommend keeping them out of daily work and disabling password recovery for admins. Check which named people hold the admin role, whether each has a separate standard account, and whether the admin sign-in path is restricted. The CRM administrator owns this list and should review it on a fixed schedule.

IP access restrictions

EspoCRM can restrict access by IP address, which reduces exposure of the login page and the admin area to networks you control. Before enabling it, confirm the addresses your users, VPN gateways and integration servers actually use, and test a lockout path. Network security owns the allowed ranges, and the CRM administrator owns the EspoCRM configuration that enforces them.

API users and authentication

Each integration should use a dedicated API user with a role limited to the entities and actions it needs. The EspoCRM API docs describe HMAC as the most secure method and basic authentication as not recommended, so confirm which method each integration uses. The integration owner should manage API user roles, and the platform team should review them whenever an integration changes.

API docs

Transport, server and database

TLS is usually terminated at Nginx, Apache or a reverse proxy, and HTTPS should be enforced for all traffic. On the host, check file permissions so the web server user can read the application and write only to the directories it needs, confirm the user that runs cron, and give the database account only the privileges EspoCRM requires. The infrastructure team should own TLS, host and database settings.

Server configuration docs

Update discipline

Upgrades change security behavior, so each release needs a tested path and a rollback plan. UI upgrades are disabled by default as of version 10.0, which means upgrades run from the command line under a controlled change process. Check custom code and extensions before each upgrade. The platform owner should schedule updates, and the vendor release page is the reference for security fixes.

EspoCRM releases

Decisions to make before changing settings

This table compares the five choices that shape an EspoCRM hardening plan: authentication, integration authentication, network restriction, certificates and upgrade method. Read each row against your identity provider, integration estate and patching capacity, then decide before changing any setting, since several choices are hard to reverse without rework.

DecisionOption and when it fitsOperational cost and trade-off
Built-in 2FA or OIDC with IdP MFABuilt-in 2FA fits teams without a central identity provider. OIDC with identity provider MFA fits organizations that already enforce MFA centrally.EspoCRM's own 2FA is not compatible with OIDC, so you cannot layer both. Recovery depends on the chosen path: confirm how locked-out users and admins regain access under each.
HMAC, API key or basic auth for integrationsHMAC fits integrations that can sign requests and need the strongest method the docs describe. API keys fit simpler clients with dedicated API users.Basic authentication is not recommended by the docs. Moving an existing integration to HMAC means changing the client code, so budget rework time for each connected system.
IP restriction in EspoCRM or at firewall or proxyRestriction at the firewall or reverse proxy fits organizations that already manage network allowlists centrally and want one place to audit them.Application-level IP rules are easy to change but spread policy across tools. Proxy rules need to account for forwarded client addresses, and remote staff or partners may need a change process.
Let's Encrypt from the installer or a corporate certificateLet's Encrypt via the installation script fits small, internet-reachable deployments using the Docker stack. A corporate certificate fits organizations with internal certificate authorities or strict issuance rules.Automated renewal reduces manual steps but depends on public DNS and inbound access during validation. Corporate certificates need renewal tracking and a process to install new certificates on the web server.
Command-line or UI upgradesCommand-line upgrades fit version 10 onward, where UI upgrades are disabled by default. UI upgrades are only an option if you deliberately re-enable them.Command-line upgrades need an operator with server access and a tested backup routine. Plan patching effort for each release, and confirm how custom code and extensions are checked before upgrading.

How to build the hardened configuration in sequence

This sequence takes a self-hosted EspoCRM instance from a supported platform baseline to a locked-down configuration covering transport, accounts, authentication, network access, API access and upgrades. Each step ends with a check your team can run before moving on.

  1. Confirm supported platform and scheduled jobs

    Confirm the stack against the server configuration docs: PHP 8.3 to 8.5, MySQL 8.0 or newer, MariaDB 10.6 or newer or PostgreSQL 15, served by Apache, Nginx or IIS. Then set up the cron job or scheduled task that EspoCRM needs for background jobs, so queued work runs on a schedule rather than being skipped. Record the exact PHP, database and web server versions in your build record. Check: the installed versions match the documented list, and a background job runs and appears in the job log after the scheduler fires.

  2. Terminate TLS and limit HTTP exposure

    Serve EspoCRM only over HTTPS, with a valid certificate issued for the production hostname. If you use the installation script, it can request Let's Encrypt certificates, but confirm that choice against your certificate policy. Redirect plain HTTP to HTTPS, expose only the web server ports required, and keep the database and internal services off the public interface. Check: a scan from outside your network shows only the intended ports open, and a request to the HTTP address redirects to HTTPS.

  3. Set file permissions and the web server user

    Run the web server as a dedicated, non-login account. Give that account write access only to the directories EspoCRM needs at runtime, such as data, cache and upload locations, and keep application code read-only for it. Restrict configuration files that contain database credentials. Document the ownership model so upgrades and restores do not quietly reset it. Check: the web server user cannot write to application code, and a test file placed in a read-only directory is rejected.

  4. Create named admins and move daily work off them

    Create one named administrator account per person who needs admin rights, and remove shared or generic admin logins. Have each administrator use a standard user account for daily sales and service work, and sign in as admin only for configuration tasks. Disable password recovery for admin accounts, as the security docs recommend. Check: every admin account maps to a named person, no admin account is used for routine records work in the audit trail, and an admin password reset request is refused.

  5. Set password policy, 2FA and token lifetime

    In the administration settings, enforce a password policy, require two-factor authentication, and shorten the auth token lifetime to a value your security policy sets. Confirm that your identity model does not conflict with built-in 2FA: EspoCRM's own 2FA is not compatible with OpenID Connect, so if you plan SSO, decide the MFA approach at the identity provider first. Check: a new user is forced through the password rules and 2FA enrollment, and an expired token forces a fresh sign-in.

  6. Restrict access by IP address

    Define the IP addresses or ranges allowed to reach the instance, based on office networks, VPN egress or a reverse proxy. Apply the restriction in EspoCRM's settings and, where possible, at the network or proxy layer so it does not depend on one application setting. Keep a documented break-glass path for administrators who lose access. Check: a request from an address outside the allowed list is refused, and a request from an allowed address succeeds.

  7. Create API users with least-privilege roles and HMAC

    Create a dedicated API user for each integration, assign a role that grants only the entities and actions that integration needs, and avoid reusing interactive user accounts. The REST API docs describe HMAC as the most secure method and basic authentication as not recommended, so choose HMAC for each integration and avoid basic authentication. Store the secrets in your secrets manager. Check: each API user can read and write only its approved entities, and a basic authentication request is refused under your configuration.

  8. Lock down the upgrade path and record the baseline

    Keep upgrades under change control. As of version 10, upgrading through the UI is disabled by default, so plan upgrades from the command line and test them on a copy first. Store the configuration baseline, role definitions, IP rules and API user list in version control or your change record, and schedule a periodic review against the security docs. Check: a restore of the baseline into a test environment reproduces the settings, and an upgrade attempt from the UI is blocked unless you have enabled it deliberately.

How requests cross the EspoCRM trust boundaries

A request starts at the user's browser or an integration client and meets the IP allowlist and TLS termination at the web server before it reaches EspoCRM. Interactive users sign in through local login or an identity provider, while API integrations authenticate with a dedicated API user using HMAC signing. Check that the allowlist applies to both paths, that admin accounts are kept off daily work, and that the database and file storage are reachable only from the application tier. Cron jobs run inside the same boundary and need the same review.

Trust boundaries in an EspoCRM deployment and where each control applies.

What drives hardening effort and how to keep it down

This table lists the factors that change how much work an EspoCRM hardening project takes, how each one raises effort, and what keeps it contained. Read it before requesting a quote so you can see which drivers apply to your environment. The main takeaway is that a single identity provider, standard roles and a written baseline usually shrink the work more than any other choice.

DriverWhy it raises effortHow to keep it down
Users and rolesEach role needs its own permission review, and custom roles multiply the checks needed for access control and team scope.Start from a small set of standard roles, add custom roles only where a real business need exists, and review them on a fixed schedule.
API integrations and authentication methodEach API user needs its own role, credentials and testing. Basic authentication is not recommended, and HMAC needs extra client-side signing work.Limit the number of API users, scope each one to the entities it needs, and standardize on HMAC where the integration partner can support it.
SSO and existing MFAWithout an identity provider, EspoCRM's own 2FA, password policy and token settings must all be configured and tested. EspoCRM's 2FA is not compatible with OIDC, so the two designs must be planned together.Use one identity provider that already enforces MFA, confirm the fallback login path for admins, and document which controls the provider owns.
Hosting modelA script-based Docker stack, a server you manage yourself and a multi-server setup each have different TLS, file permission, cron and network controls to verify.Choose one hosting model early, record its baseline, and avoid mixing approaches across environments. Confirm supported platform versions in the server configuration docs.
Compliance evidence requirementsAssessors often ask for proof of settings, access reviews, change records and logs, which means each control must be documented and captured, not just configured.Agree the evidence list before work starts, map each item to a control owner, and set up the audit log and review records during the build.
Customizations and extensionsCustom code, formula scripts, layouts and extensions can change security behavior, so each change may need a permission and regression check.Keep customizations few and documented, check extensions before each change, and retest the hardening baseline after every change to the custom directory or extensions.
Number of environmentsStaging, test and production each need the same settings, so every control is applied and verified more than once, and drift between them is common.Keep one configuration baseline and apply it to every environment through a repeatable process, then compare settings after each release.

How 2FA, OIDC and admin accounts interact

Decide the sign-in model before you touch any individual setting, because enforcing 2FA inside EspoCRM and signing in through OpenID Connect are separate control paths. A password policy and a 2FA requirement configured in EspoCRM govern local accounts only. When users sign in through an identity provider, the identity provider's own multi-factor rules apply, and EspoCRM's own 2FA is not compatible with OIDC. Confirm with your identity team which MFA methods the provider enforces for every group that can reach EspoCRM, and confirm that conditional access or session policies at the provider match what you document for auditors. Once OIDC is in place, the local password controls become a fallback, not the primary gate.

OIDC configurations usually keep a fallback login so that an administrator can still reach EspoCRM if the identity provider is down or misconfigured. That fallback is a local account path, so it must be hardened to the same standard as the admin account itself: a strong unique password, 2FA enabled where EspoCRM allows it for that path, IP restriction where your network allows it, and a short list of named holders. Test the fallback login during go-live and again after any identity provider change, and record who can use it and when it was last exercised.

Keep the admin account separate from daily work. Each administrator should have a named admin account used only for configuration and a standard account used for sales and service, and the security docs advise against using admin accounts for daily work. Disable password recovery for admin users, so a reset cannot be triggered by email alone. Finally, review the group to team mapping that the identity provider pushes into EspoCRM. A group that grants a team membership can expose records far beyond what the user needs, so compare each mapped group against the roles and teams you intend and remove any mapping that is broader than its purpose. The full integration build, including provider setup and logout behavior, is covered in the EspoCRM SSO and identity integration topic.

How hardening changes by deployment model

The installation script for Ubuntu, Debian and Linux Mint deploys a Docker-based stack with Nginx and MariaDB, and can request Let's Encrypt certificates. That bundle decides several controls for you, so hardening starts by confirming what the script set up rather than assuming defaults. TLS is usually terminated at the Nginx container, so certificate renewal, cipher settings and HTTP to HTTPS redirects live in that container configuration and must survive a stack rebuild. Background jobs run from the stack, so confirm which container runs cron and that it is not exposed. Backups created by the bundled command.sh utility are files on the host, so their permissions and off-host copies need explicit control.

  • TLS termination: Confirm where certificates are installed, who can read the private key, and whether HSTS and modern protocol versions are set in the Nginx configuration.
  • Container exposure: Publish only the web port. Make sure MariaDB and the application containers are not reachable from outside the Docker network.
  • Backup files: Restrict read access to backup archives on the host, since they contain customer data and password hashes.
  • Script upgrades: Pin the stack version you tested and plan updates through the documented upgrade path, not ad hoc image pulls.
  • Secrets in compose files: Check that database passwords generated by the script are stored with restricted permissions.

Confirm the script's current default settings, certificate renewal behavior and container layout with EspoCRM's installation documentation and your own test build before you sign off.

How to verify the hardening and confirm it fails safely

The fastest way to know whether the hardening holds is to try to break it from outside the application, the way an attacker or a misconfigured integration would. Start with the password policy: attempt logins with passwords that violate each rule you configured, and confirm each attempt is refused without a hint about which account exists. Then confirm two-factor authentication is enforced for every user role, including admins, by signing in with a test account that has not enrolled a second factor and checking that the application forces enrollment before granting access. Test token lifetime by signing in, leaving the session idle for longer than your configured limit, and confirming the next request is rejected and requires a fresh login. Repeat the check for an active session that is in use, since that is the case users notice when it breaks.

Next, test the network and recovery controls. From a host outside your IP allowlist, attempt to reach the login page, the REST API and any integration endpoint, and confirm each is refused at the web server or load balancer, not only by the application. Confirm that password recovery is unavailable for admin accounts by requesting a reset for one and verifying that no reset link arrives and the account cannot be reset another way. For the API, send a request using basic authentication to an endpoint an integration would use and confirm it is refused for integration users, since the EspoCRM documentation does not recommend basic authentication. Then send an HMAC-signed request with a deliberately wrong secret and confirm it is rejected with an authentication error, not processed with reduced permissions. Use a dedicated API user with a narrow role for each positive test, and confirm that user cannot reach records outside its role.

Finish on the server and in the logs. From the server, check the TLS configuration with an external scanner, confirm that only the intended protocol versions and ciphers are offered, and verify that certificates are valid and renewing. Review file permissions on the configuration directory, the data directory and anything holding credentials, confirming the web server user can write only where EspoCRM needs it. Then review the audit trail: confirm that admin actions such as role changes, user creation, authentication settings and API user edits are recorded with a user and timestamp, and that the log is stored where admins cannot quietly delete it. Treat every control that fails as a defect to fix before go-live, and rerun the full set of checks after each EspoCRM update, configuration change or certificate renewal, because an upgrade can reset settings or file permissions without warning.

What to monitor, back up, upgrade and document after hardening

Hardening settings drift unless someone reviews them. The cards below cover the recurring work that keeps an EspoCRM instance locked down after go-live: reviewing privileged activity, rotating credentials, testing restores, upgrading safely and recording what was decided. Each one feeds the next, so a gap in one tends to show up in the others.

Review admin and API user activity

Admin accounts and API users are the most privileged paths into EspoCRM, so their activity deserves a regular look. Check who signed in as an administrator, which API users made changes, and whether any activity came from unexpected IP addresses or outside maintenance windows. Compare the results with the IP restrictions and admin account rules you set. Agree in advance who reviews the log, how often, and what counts as an exception that needs follow-up.

Security docs

Rotate API secrets and review roles

API users authenticate with keys or HMAC secrets and carry role-based permissions, so a leaked secret or an over-broad role can expose customer data without any login prompt. Set a rotation schedule for each API user, record who holds each secret, and remove users that no longer back an integration. Review role assignments at the same time, confirming that each API user can read and write only the entities its integration needs.

Back up and test restores

A backup that has never been restored is an assumption, not a control. Back up the database and the file storage together, because attachments and database records must match after a restore. Run a restore into a separate environment on a schedule, then confirm that users can sign in, records and attachments open, and cron jobs resume. Record how long the restore took and what was missing, and keep the backup copies outside the server they protect.

Plan command-line upgrades

Upgrading through the UI is disabled by default as of version 10.0, so each upgrade becomes a planned change run from the command line. Before starting, review the release notes, confirm your PHP and database versions still meet the server requirements, and take a fresh backup. Check custom code and installed extensions for compatibility first, since changes in the custom directory and third-party extensions are the most common source of upgrade breakage. Test the upgrade on a copy before touching production.

Server requirements

Track release notes

Security fixes and behavior changes appear in EspoCRM release notes, and the two major versions in this period, 9.0.0 and 10.0.0, each changed how installations are maintained. Watch the project's releases page, assign someone to read each new release, and note which fixes apply to your version and configuration. Treat security-related entries as priority items for the next maintenance window rather than waiting for the next scheduled upgrade cycle.

EspoCRM releases

Maintain a baseline document

A baseline records the hardened state of the instance: password policy, 2FA, token lifetime, IP restrictions, admin accounts, API users, TLS settings, file permissions and backup schedule. For each setting, name the owner, the date it was last checked and any approved exception with its reason and expiry. Auditors and security reviewers can then compare the live configuration against the document. Keep it in version control or a managed document store, and update it after every upgrade or configuration change.

Questions buyers ask about EspoCRM security hardening

Can our own team harden EspoCRM without a partner?

Yes, a capable internal team can work through the hardening steps using the EspoCRM configuration and security documentation, provided it names one owner for the server and one owner for the application. The server owner covers TLS, file permissions, the PHP and database stack, cron and backups. The application owner covers password policy, 2FA, token lifetime, IP restrictions, admin accounts and API users. Teams without someone who can read the server logs and test API calls usually find the API and integration review is where internal effort stalls.

How long does EspoCRM hardening take, and what drives the duration?

Duration depends on how many integrations, API users and identity providers the instance already has, and on how many customizations need review before a change is made. A single-server instance with few integrations is much shorter to harden than one that feeds a website, an ERP and a telephony system through API keys. Each integration needs its own test window, because a permission change can stop a sync without an obvious error. Ask any partner for a written schedule that separates inventory, changes, testing and handover so you can see which phase drives the timeline.

What does the work need from our side?

Hardening needs access to the identity provider if single sign-on or group mapping is in scope, shell access to the server, and a database account that can be used for review. It also needs named owners who can approve password and session policy changes, and an inventory of every API user, webhook, import job and external system that calls EspoCRM. Without that inventory, the hardening team cannot tell which API user is a live integration and which is an abandoned account, so the inventory is usually the first deliverable to request.

Does hardening EspoCRM make us compliant?

No. Hardening puts controls in place, such as password policy, 2FA, restricted admin use, limited token lifetime and documented update discipline, and it helps you collect the records that show those controls operate. Independent auditors and certification bodies decide whether your controls meet a given framework, and DeployOpen does not issue audit reports, attestations or certifications. Confirm with your assessor which evidence they expect, such as configuration exports, access reviews and change records, before the hardening project starts.

Does hardening break existing integrations?

It can. Changes to API user roles, HMAC or API key settings, IP restrictions and token lifetime may cause integrations to fail or return permission errors. Inventory every API user and the systems that use it before changing anything, then test each integration in a non-production copy and confirm that failed calls surface in logs. Plan a rollback for each change, and schedule changes outside peak sales or service hours so that any sync failure is found and corrected quickly.

What does a partner add beyond the configuration docs?

A partner adds a scoped review of your current configuration, a plan that sets which controls change first, a test pass against the hardened instance, and a handover that leaves your team with runbooks. Under a fixed-scope engagement, scope, deliverables and timelines are agreed in writing before work starts, so you can compare the offer against doing the work internally. Ask the partner what testing covers, whether it includes API permission checks and authentication tests, and how the handover is documented.

Should we keep EspoCRM updated after hardening?

Yes. Hardening is a starting point, and the EspoCRM security documentation points to update discipline as part of a secure setup. Note that upgrading through the UI is disabled by default as of version 10.0, so the upgrade process needs a command line procedure, a tested backup and a named owner. Ongoing support and upgrades can be handled by a retainer, which is recurring work separate from the one-time hardening project.

How DeployOpen scopes, hardens and hands over EspoCRM

DeployOpen hardens EspoCRM inside your own infrastructure, whether cloud accounts, data centers or air-gapped networks. We start from a written scope, configure and test the controls against your access model, and hand over documentation and evidence your security and compliance teams can review.

How we scope

  • Review the current EspoCRM version, hosting layout, login methods and which teams and API clients use the instance.
  • Agree in writing which controls are in scope, such as password policy, 2FA, token lifetime, IP restrictions and TLS.
  • Confirm which admin, API user and file permission changes need sign-off from your identity and infrastructure owners before work starts.

How we build

  • Configure password policy, 2FA or OIDC sign-in, auth token lifetime and IP restrictions to match the agreed scope.
  • Separate admin accounts from daily users, disable admin password recovery, and set API users with role-based permissions and HMAC authentication.
  • Verify TLS settings, file permissions on the web root and config, and the update path, then test each control against the written scope.

How we hand over

  • Deliver a configuration record listing each hardening setting, its value, its owner and the reason it was chosen.
  • Provide test results and the steps your team needs to repeat them after changes, upgrades or certificate renewals.
  • Document a routine for reviewing admin accounts, API users, extensions and EspoCRM releases so the controls stay in place after handover.

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrades and continuous testing are available as a retainer, covering changes to the hardened configuration.
  • Ask for the retainer scope in writing, including who reviews EspoCRM security releases and how configuration changes are retested.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.