Configuring the Rocket.Chat rate limiter

Rocket.Chat's API and DDP rate limiters slow scraping, brute force and registration abuse, but only when they are keyed correctly and sit behind a proxy that passes the real client address. This page covers the options, the setup sequence and the proxy settings that can silently disable them.

On this page

What the Rocket.Chat rate limiter protects and when to configure it

If your self-hosted Rocket.Chat workspace is reachable from the internet or from a partner network, you need deliberate rate limits before someone else sets the pace. The common threats are scraping of message and user data through the API, repeated login attempts against local accounts, and account creation floods when registration is open. Rocket.Chat handles these with two separate mechanisms. The API rate limiter applies to REST endpoints, and the DDP rate limiter applies to the real-time connection that clients use for subscriptions and method calls. Both need settings that match your workspace's traffic, because a limit that suits a 40-person internal team can break a busy integration or a mobile client that reconnects often.

Before you change anything, confirm the setting names, default values and per-endpoint coverage for your release line. These details differ between Rocket.Chat versions, and the rate limiter settings live in the workspace admin area under the relevant security section. Check the release notes and documentation for your exact version, and record the current values so you can roll back. Also confirm which requests pass through a reverse proxy or load balancer, since the limiter keys on client identity and a misconfigured proxy can make every user look like one address. The Rocket.Chat version durability documentation explains which lines still receive security fixes, which matters because hardening settings on an unsupported version may not behave as the current docs describe.

Decide three things before you tune the limits: which endpoints and methods your integrations depend on, how many legitimate clients sit behind each IP address, and what your monitoring will show when a limit is hit. Test in a staging copy of the workspace with a load profile that resembles production, including bots, bridges and mobile reconnect behavior. Plan a review after go-live, because blocked legitimate traffic often appears first as support tickets from users rather than as alerts. Ask your team or partner to document the final values, the owner of each setting, and the process for changing them during an incident.

Rate limit options and when each one fits

This table compares the main Rocket.Chat limiter scopes: REST endpoints, IP address, user, connection, DDP method and registration. For each one it shows the abuse it targets, the legitimate traffic it can block, and what to confirm in your own version before you tune it. Use it to decide which scopes to enable first and where to test before production.

Limiter scopeAbuse it targetsWhat it can break and what to confirm
Per-endpoint REST limitsScripted bursts against specific API methods such as login, message posting or user lookupBusy integrations and bots can hit a single endpoint hard and fail. Confirm which endpoints your version exposes to rate limiting and the rule names in its admin settings.
Limits keyed by IP addressCredential stuffing, scraping and floods from a single sourceShared NAT gateways, corporate proxies and mobile carriers put many users behind one address. Confirm whether your proxy passes the real client address to Rocket.Chat before relying on this scope.
Limits keyed by userAccount-level abuse such as token misuse, message floods and API scraping by a logged-in accountService accounts, integration users and high-volume bots can exceed a per-user allowance during normal work. Confirm which accounts are exempt or given separate allowances.
Limits keyed by connectionClients that open many realtime connections or flood a single socketClients that reconnect after network changes, or open several browser tabs, can look like abuse. Confirm how your version counts connections and how the official clients reconnect.
Limits by DDP methodRepeated calls to specific realtime methods, such as message sends or subscriptionsTyping indicators, presence updates and fast message sequences from normal users can reach method limits. Confirm the method list and thresholds your version applies.
Registration limitsAutomated account creation and invitation or signup abuseLegitimate bulk onboarding, SSO just-in-time provisioning and imports can trigger the limit. Confirm how registration limits interact with your identity provider and your import schedule.
Proxy headers that affect keyingAttackers who forge forwarding headers to rotate the address the limiter seesIf the proxy trusts client-supplied forwarding headers, limits keyed by IP can be bypassed. Confirm which headers your reverse proxy overwrites and which headers Rocket.Chat trusts.

Where the limiter counts a request from depends on the proxy headers it trusts

The diagram follows one request from the client across the internet to the load balancer or reverse proxy, which marks the trust boundary, then into the Rocket.Chat instance where the API and DDP limiters run, and finally to MongoDB. The key check is the hop where the forwarded client address is added or accepted. If Rocket.Chat trusts a X-Forwarded-For value that the client can set, every request may appear to come from a different address, so the per-IP limit does nothing. Confirm which header your proxy overwrites and which proxy addresses Rocket.Chat is configured to trust before you set limits.

Shows which hop sets the client address that the limiter counts.

Which limiter to tune for each abuse pattern

Scraping usually appears as one client, often using a valid token, walking through user lists, room lists and channel history at a steady pace. Start with the per-endpoint rules in the API rate limiter, because those rules target the endpoints that expose directory and history data.

  • Key to check first: the API rule covering the endpoints that list users, rooms and message history, and whether that rule is keyed by user, IP or connection.
  • Legitimate traffic that can be caught: integrations, bots, export jobs and migration scripts that page through history quickly, especially when they share one service account.
  • Shared IP risk: staff behind a corporate NAT or a single outbound proxy share one IP address, so an IP-keyed rule can throttle many people at once.
  • Logs and metrics: HTTP 429 responses in your reverse proxy access logs, grouped by endpoint and by the authenticated user or source address, plus any limiter messages your Rocket.Chat version writes to server logs.
  • Items to confirm: which endpoints your version's API limiter covers and whether named integration accounts can be exempted without weakening the rule for everyone else.

Before loosening any scraping rule, confirm that rejections cluster on directory and history endpoints and not on normal client sync.

How to set up and verify the limiter in order

This sequence moves the rate limiter from inventory to production in small, checked steps, so each limit is set against known client behavior and no legitimate app or integration is blocked by surprise. The result is a limiter configuration you can explain, test and monitor.

  1. Inventory endpoints, clients and automations

    List every client that talks to the workspace: web browsers, the official mobile and desktop apps, bots, custom scripts, incoming and outgoing webhooks, and third-party integrations. For each, record the REST endpoints and DDP methods it calls, how often, and from which network or address range. Ask the owner of each integration to confirm its schedule and whether it runs from a shared server, since shared addresses change how IP-based limits behave. Done when you have a written list that maps each client to its endpoints and source addresses.

  2. Record baseline traffic before changing anything

    Capture normal request volume for a representative period that includes peak working hours and any scheduled jobs. Use the reverse proxy access logs, Rocket.Chat's own logs and your monitoring stack to note requests per endpoint, error rates and the busiest source addresses. Store the numbers alongside the inventory. Done when you can state, for each major endpoint, what normal peak looks like, so any later limit can be compared against that figure rather than a guess.

  3. Confirm limiter settings and defaults in staging

    In a staging workspace running the same Rocket.Chat version as production, open the administration settings for the API and DDP rate limiters and record every key, its current value and its default for that version. Check the release notes for your installed line, since defaults can change between releases. Confirm in the vendor documentation which settings apply to REST endpoints, which to DDP connections and methods, and which to registration. Done when you have a settings sheet for staging that matches what you will change in production.

  4. Set limits one scope at a time

    Change one group of settings per change window, starting with the least disruptive scope, such as a single high-volume REST endpoint, then moving to per-user, per-IP, per-connection or registration limits. Record the old value, the new value and the reason next to each change. Keep the change in staging first and promote it only after the next step passes. Done when every changed setting appears in a change log with a before and after value and a named owner.

  5. Test with legitimate client traffic

    Run the official web, mobile and desktop clients, your bots and each integration against staging under normal and busy patterns, including reconnects after a network drop and bulk actions such as loading history or syncing many rooms. Watch for HTTP 429 responses or dropped DDP connections that a real user would see. Done when each client and integration completes its usual workflows without limiter errors, and any remaining hits are either raised limits or deliberate blocks you have documented.

  6. Test with simulated abuse

    Use a load tool or a scripted client from an approved test host to send bursts of requests to the endpoints you protected, including repeated login attempts, registration attempts and rapid DDP method calls. Confirm that the limiter returns rejections after the configured threshold and that the workspace stays responsive for legitimate users during the test. Run the test only in staging or in a window agreed with the workspace owner. Done when the simulated traffic is rejected at the limits you set and the logs record each rejection.

  7. Confirm the limiter sees real client addresses

    Send a request through the full production path, from an external test host, and check which address Rocket.Chat records for it. Confirm that the reverse proxy and load balancer forward the client address in the header your configuration trusts, and that no client can supply its own forwarded address to bypass per-IP limits. Test a request with a spoofed forwarding header to see whether it changes the recorded address. Done when the logged address matches the test host, and spoofed headers from outside the trusted proxy are ignored.

  8. Roll out and review limiter logs

    Promote the verified settings to production in the same order you tested them, one scope at a time, and watch the first full business cycle closely. Review rejection logs daily at first, grouping them by endpoint, user, address and client version to separate abuse from legitimate clients that need a higher limit. Schedule a recurring review and repeat this sequence whenever you upgrade Rocket.Chat or add an integration. Done when production rejections match the expected pattern, and the review owner has signed off the log summary.

How proxy headers can defeat the limiter

If Rocket.Chat sits behind a reverse proxy or load balancer, the limiter may see every request coming from the proxy's address. When that happens, all users share one bucket and a single noisy client can exhaust the limit for everyone. The fix is to have the proxy pass the real client address in a forwarding header, and to have Rocket.Chat trust that header only when the request arrives from a proxy you control. Confirm the exact header name, how your Rocket.Chat version reads it, and which trusted proxy settings apply to your release before you change anything, because the names and options have changed between lines and the official documentation for your version is the authority.

The first risk is trusting a client-supplied forwarding header. If Rocket.Chat accepts the forwarding header from any caller, an attacker can send a different value on each request and appear to come from a new address every time, which defeats per-IP limits entirely. The proxy should overwrite or strip any forwarding header that arrives from outside, rather than appending to a value the client supplied. The second risk runs the other way: if the proxy is misconfigured or the trusted proxy list is too broad, many unrelated users may share one address, such as a corporate NAT or a mobile carrier gateway, and they will be limited together. Plan for that with per-user and per-connection limits, not only per-IP limits.

Test from outside the proxy before you rely on the limiter. Send repeated requests from one client, then from a second client on a different network, and confirm that each is counted separately. Then send requests with a spoofed forwarding header directly to the application port, and to the proxy, and confirm that the spoofed value is ignored. Keep these results with your change record, and repeat the tests after every proxy change, Rocket.Chat upgrade or load balancer migration, since any of these can silently alter which address the application sees.

Security risks and operational pitfalls of rate limiting

Rate limits protect a self-hosted Rocket.Chat workspace only when they are set for real traffic, cover the endpoints that matter, and stay tuned across changes. The cards below describe the failures that most often undo a limiter, with a check you can run before and after each change.

Limits too low for real traffic

A limit set from a single test session can block a busy user, a shared office address or an integration that posts many messages in a short burst. The symptom is users reporting intermittent errors or bots failing with too-many-requests responses during business hours. Before you tighten a rule, record normal request rates per user and per integration for a week, then set the threshold above that baseline. Use the limiter's log or error output in a test workspace to confirm that a legitimate client stays under the limit.

Spoofed forwarding headers

If Rocket.Chat trusts a forwarding header such as X-Forwarded-For from clients that bypass your reverse proxy, an attacker can send a new address with every request and the IP-based limit never triggers. The symptom is a scraper or brute-force script that keeps a high request rate with rotating addresses in the logs. Confirm that only your proxy can reach the Rocket.Chat port and that the proxy overwrites forwarding headers instead of appending client-supplied values. Then test the limit from an address that is not your proxy.

Uneven endpoint coverage across versions

The set of REST endpoints and DDP methods that a limiter covers can differ between release lines, so a rule that protected an endpoint on one version may not on another. The symptom is a limit that works in staging but leaves a sensitive method open after an upgrade. Build a list of the endpoints and methods you depend on, then test each one against the running version and record the result. Ask your vendor or check the release notes for the version you run to confirm which endpoints the limiter covers.

No alerting on limited requests

A limiter that rejects requests without notifying anyone hides both attacks and misconfigurations. A blocked user who opens a ticket is often the first signal, and a sustained scraper can run for days unnoticed. Route rate-limit rejections to your log pipeline and set an alert on a sustained rise in rejections for one address, user or endpoint. Test the alert by triggering a controlled burst from a test account and confirming that it fires within your agreed response window.

Production changes without rollback

Editing limiter settings directly in production makes it hard to know which value caused a new outage, and a mistake can lock out the whole workforce. The safe pattern is to record the current values before any edit, apply the change in a staging copy with the same proxy configuration, and keep a written revert step. Confirm that an administrator can restore the previous values quickly and that the revert has been tested once in staging.

Limits not reviewed after upgrades

Rocket.Chat upgrades can change default settings, endpoint behavior and proxy requirements, so limits that were correct on the previous version may no longer fit. The symptom is a sudden rise in blocked requests after an upgrade window, or a protected endpoint that behaves differently after the change. Add a limiter review to every upgrade checklist, compare the settings before and after, and rerun your endpoint tests. The Rocket.Chat version durability documentation explains how long each release line stays supported, which sets how often you must repeat this review.

Version durability docs

What changes when the workspace runs on several instances

A rate limit that counts correctly on one instance may not count correctly across several. The reference architectures suggest moving to multiple load-balanced instances linked by NATS once a workspace grows beyond 500 concurrent users, and multi-instance designs require a paid plan. Once requests from one client can land on different instances, the question is whether the limiter's counters are shared across them or kept separately on each instance. If they are kept per instance, a client can effectively multiply its allowed rate by the number of instances behind the load balancer. Rocket.Chat's documentation for the version you run is the authority on this, so confirm with Rocket.Chat how REST and DDP limits are counted, whether the counts are shared through the cluster's messaging layer, and whether the answer differs for login attempts, registration and method calls.

The answer also depends on the architecture and the version, so do not carry settings over from a single-instance build without checking. Ask your Rocket.Chat contact which limits are enforced by the application, which are better enforced at the reverse proxy or load balancer, and how the two layers interact. Record the expected effective rate per client IP and per user under your chosen topology, and confirm that the proxy passes the client address the way the limiter expects, since a mismatch here can make every request appear to come from the load balancer.

Treat every change to the instance count, the load balancer, the proxy or the NATS layer as a trigger for a limiter test. Run a controlled burst from a single client through the real public path, then from several clients, and compare the observed block point with the one you documented. Repeat the test on a staging environment that matches production topology before any scaling change goes live, and retest after each Rocket.Chat upgrade, because limiter behavior can change between releases.

Questions buyers ask about rate limiter configuration

How much effort does configuring the Rocket.Chat rate limiter take?

Effort depends on how many endpoints and clients your workspace serves, how many instances sit behind the load balancer, and how complex the proxy chain is. A single instance with a few known clients is a small, contained change. A workspace with several web, desktop and mobile client versions, custom integrations calling the REST API, and two or three reverse proxies takes longer because each limit must be tested against real traffic patterns. The main drivers are the number of endpoints in use, client diversity, proxy complexity, number of instances, and how far testing goes. Ask any partner to break the estimate down by these five factors.

Can our own team configure the Rocket.Chat rate limiter without a partner?

Yes, if your team can read the API and DDP traffic, has administrative access to the workspace settings, and understands how your reverse proxy sets client IP headers. The risk lies in the details: a limit set too low can break integrations, mobile sync or bots, while a limit that trusts a spoofed forwarding header can be bypassed entirely. Teams that lack a staging workspace or someone who can verify limits under load often find the work takes longer than expected. A partner can add an outside review of the configuration and a test pass, but the decision about your own traffic stays with your team.

What does the work need from us before it starts?

Plan to provide four things. First, traffic data from your current workspace or proxy logs, showing which endpoints and methods are called, from which IP ranges, and at what volume. Second, access to the reverse proxy configuration and its forwarding headers, so the trusted proxy chain can be confirmed. Third, a staging workspace that mirrors production settings closely enough to test limits. Fourth, a change window agreed with your operations team, because some limit changes need a restart and client behavior should be watched afterward. Ask for a written list of these inputs in any proposal.

How long does the rate limiter work take?

The duration depends on scope rather than a fixed figure. A single instance with one proxy and a short list of endpoints to tune will finish far sooner than a multi-instance deployment with custom integrations, several client versions and a formal test plan. Schedule risk comes from waiting for traffic data, proxy access and the change window, so those dependencies should be confirmed before a timeline is accepted. Any written plan should list the phases, the endpoints in scope and what each phase is expected to deliver, and it should state which items the client must supply.

What would a partner deliver for rate limiter configuration?

A typical scoped deliverable includes a review of the current proxy and forwarding header setup, a documented set of API and DDP limits with the reasoning for each value, the registration and login limits, and the change records needed to apply them. It should also include test results showing how the limits behave for normal clients and for abusive patterns, plus a short runbook describing how to adjust limits and read the related logs. Ask for these items to be named in the statement of work so acceptance is clear.

How do we keep rate limits current after Rocket.Chat upgrades?

Treat rate limit settings as part of your upgrade checklist. Each Rocket.Chat release can change endpoints, client behavior or default settings, so limits should be re-checked in staging before production upgrades. Standard releases are supported for 6 months and LTS releases for 12 months, and unsupported versions stop receiving security fixes, so upgrades are part of operating the system. Keep a versioned record of your limit values, rerun the test set after each upgrade, and review the logs for blocked legitimate traffic during the first days in production. Confirm the retainer or support terms that cover this recurring work.

Which proxy settings can defeat Rocket.Chat rate limits?

The most common failure is trusting forwarding headers such as X-Forwarded-For from clients who can set them directly. If the reverse proxy does not overwrite these headers, an attacker can present a different address on each request and avoid IP-based limits. Confirm that only your proxy sets the header, that the trusted proxy addresses are listed, and that the application sees the real client address in its logs. Check this on every proxy layer, including any load balancer or CDN in front of Rocket.Chat, because a single misconfigured hop is enough to undermine the limits.

Limits and what to confirm in your environment

The rate limiter behaves differently across Rocket.Chat release lines, deployment shapes and proxy setups, so the settings in this page are a starting point rather than a finished policy. The cards below list what to confirm in your own environment before you count on any limit protecting your workspace.

Exact limiter settings and defaults

Confirm the names, default values and units of each API and DDP limiter setting for the exact release you run. Limiter options have changed between lines, so a key copied from a blog post or an older install may do nothing. Check the admin settings screen and the documentation for your version before changing anything, and record the values you start from so you can roll back.

Version durability docs

Endpoints and DDP methods covered

Establish which REST endpoints and DDP methods each limiter actually matches. A limit on one route does not protect another route that does similar work, and some methods may sit outside the rules you expect. Build a short list of the endpoints your clients and integrations call most, then test each one against a low threshold to see whether it returns a limited response.

Instance count and load balancer effects

Confirm whether counters are kept per process or shared across instances. In a multi-instance design, a limit that counts per node can allow roughly the configured rate multiplied by the number of nodes, and sticky or round-robin balancing changes what each node sees. Check your reference architecture and test with traffic spread across all nodes.

Reference architectures

Proxy passes the true client address

Verify that your reverse proxy sets forwarded client address headers and that Rocket.Chat trusts only the proxy hops you control. If every request appears to come from the proxy address, IP-based limits will throttle all users together. If clients can set forwarded headers themselves, they can spread requests across fake addresses and bypass the limit. Test from two external addresses and confirm each one is counted separately.

Logging of limited requests

Confirm where limited requests are recorded, how long those logs are kept, and whether your monitoring alerts on a spike of limited responses. Without this, a scraping attempt can look like ordinary slowness, and you cannot tell whether a limit is too tight for real users. Ask who receives the alert and what action follows it, and check that the log entries include the client address and the endpoint.

Client behavior under limits

Test how the desktop, mobile and web clients, and your bots or integrations, react when they receive a limited response. Some clients retry immediately, others drop messages silently, and custom integrations may fail without a clear error. Set thresholds only after you know whether each client backs off, and confirm that legitimate bursts such as reconnects after a network outage do not lock users out.

How DeployOpen scopes and tests Rocket.Chat rate limits

DeployOpen treats rate limiting as part of the Rocket.Chat deployment, not an afterthought. We scope the limits against your reverse proxy, identity setup and user population, then test them against the abuse patterns your team is most worried about before handing over the configuration.

How we scope

  • We map which REST endpoints, DDP methods and registration paths your workspace exposes and which need limits.
  • We confirm how traffic reaches Rocket.Chat, including proxy and load balancer headers, before any IP-based limit is set.
  • Engagements are fixed-scope, with the limit targets, test cases and deliverables agreed in writing before work starts.

How we build

  • We configure the API and DDP rate limiter settings in your environment, changing one group at a time so effects stay traceable.
  • We test limits from inside and outside your network, including forwarded-header spoofing attempts that try to defeat IP-based rules.
  • We check that legitimate clients, including the official mobile and desktop apps, still work under the agreed thresholds.

How we hand over

  • You receive a written configuration record listing each limit, its value, its scope and the reason it was chosen.
  • You receive a test report with the scenarios run, the observed results and any residual risk we agreed to accept.
  • We walk your administrators through monitoring signals, so they can spot rejected traffic and tune thresholds safely.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, covering retesting after Rocket.Chat version changes.
  • Retesting after proxy, identity or infrastructure changes can be included in the written scope or added later.
  • Ask any provider to confirm in writing which limits, tests and documents are included in the quote and which are optional.

Sources and further reading

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.