- Cloudflare is used with MT5 in two ways: Cloudflare Spectrum protects MT5 access servers (a MetaQuotes partnership announced in June 2020), and Cloudflare Workers deliver the web terminal on the broker’s own domain.
- A Worker serves the MT5 web terminal on an address such as trade.yourbrand.com with automatic SSL, WebSocket support and edge delivery from a network Cloudflare says spans 348 cities.
- The Worker improves delivery, branding and access control; your MT5 trading server still holds accounts, prices and execution, so you still need your own MT5 access.
- DDoS protection at the edge covers the terminal hostname; desktop and mobile apps that connect straight to access servers need separate protection such as Spectrum or your provider’s measures.
- Settings such as company details, legal links, trading server name, upstream and allowed login ranges live in Cloudflare environment variables, so changes do not require new code.
- Each brand gets its own Worker and configuration, which keeps multi-brand set-ups clean and auditable.
Can MT5 run on Cloudflare? The short answer
Yes, the MT5 web terminal can be delivered through Cloudflare Workers on your own domain, but the MT5 trading server itself does not run on Cloudflare. A Worker sits in front of your platform, serves the browser terminal under your brand with automatic SSL, carries its live WebSocket traffic and applies rules such as which account ranges may log in. Execution, accounts and price feeds stay on the MT5 servers you access through your own licence or a white label provider.
That distinction matters for every decision in this guide. Cloudflare can make the terminal faster to load, harder to knock offline and simpler to operate, but it does not replace MetaQuotes software, does not grant MT5 access and does not change how orders are filled. If you keep that boundary in mind, the rest of the picture is straightforward.
How is Cloudflare used with MetaTrader 5?
When brokers search for “Cloudflare MT5” they usually mean one of two separate things. They solve different problems and they can be used together.
- Protecting MT5 access servers. In June 2020 MetaQuotes announced a partnership with Cloudflare: “Cloudflare Spectrum for brokers” protects MetaTrader endpoints from DDoS attacks and routes traffic over Cloudflare’s network. Spectrum works at the network level, in front of the access servers that desktop and mobile terminals connect to.
- Delivering the web terminal. Cloudflare Workers run code on your domain at Cloudflare’s edge. They can serve the MT5 web terminal under your brand, apply access rules and pass live traffic to your platform. This is what FXPTrader does.
| Question | Cloudflare Spectrum for MT5 | Cloudflare Workers for the web terminal |
|---|---|---|
| What it sits in front of | MT5 access server endpoints | The browser terminal on a hostname such as trade.yourbrand.com |
| Main job | Absorb DDoS attacks and route traffic over Cloudflare’s network | Serve, brand and control access to the web terminal, and pass its WebSocket traffic |
| Who benefits | Clients on desktop, mobile and web | Clients who trade in a browser |
| Typical owner | The party operating the MT5 servers | The broker, in its own Cloudflare account |
| Changes execution? | No | No |
A broker on a white label usually does not control the access servers, so Spectrum is a question for the platform operator. The web terminal address, by contrast, is something the broker can own outright, which is why Workers are the more practical lever for most firms.
What are Cloudflare Workers, in plain terms?
Cloudflare Workers are a serverless platform: you deploy code and Cloudflare runs it in its data centres around the world. There is no server to choose, size or patch. A request from a trader in Dubai is handled in or near Dubai; one from São Paulo is handled nearby. Cloudflare reports a network spanning 348 cities in more than 100 countries, with about 95% of internet users within 50 milliseconds and over 13,000 network interconnections.
A few terms come up repeatedly when brokers evaluate Workers:
- Edge. The Cloudflare location closest to the visitor. Code that runs “at the edge” runs there rather than in one central data centre.
- Worker. A small program that receives an HTTP request and decides what to return: a page, a redirect, an error, or a response fetched from another server.
- Custom domain. A hostname you own, such as
trade.yourbrand.com, attached directly to a Worker. Cloudflare creates the DNS record and the certificate for it. - Environment variables. Named settings stored with the Worker in the Cloudflare dashboard. The code reads them at run time, so you change behaviour without changing code.
- Upstream. The server the Worker forwards traffic to. For an MT5 web terminal this is your platform’s web terminal endpoint.
- WebSocket. A long-lived, two-way connection used for streaming prices and order updates. Workers can accept and proxy WebSockets.
For a broker, the practical result is that the terminal address behaves like any other part of your website: it is on your domain, managed in your account and protected by the same network that sits in front of your other Cloudflare properties.
How does a Worker deliver the MT5 web terminal?
The flow of a single session looks like this:
- The client opens
trade.yourbrand.com. DNS points to Cloudflare, and the nearest Cloudflare location answers over HTTPS with a certificate issued for your domain. - The Worker reads its environment variables: your company name, contact details, licence and privacy links, trading server name and the upstream address.
- It returns the terminal under your brand, with your legal details and end-user text in place.
- When the client logs in, the Worker checks the account number against the allowed login ranges. Accounts outside those ranges are refused before they reach your platform.
- For permitted sessions, the Worker opens the WebSocket connection to the upstream and relays live quotes, order requests and account updates in both directions.
- Your MT5 servers authenticate the account, execute orders and stream prices exactly as they would for any other MT5 client.
| Layer | What runs there | Who operates it |
|---|---|---|
| Client browser | MT5 web terminal interface | Your client |
Cloudflare Worker on trade.yourbrand.com | Serves the terminal, applies branding, legal links and login rules, passes WebSocket traffic | You, in your Cloudflare account (FXPTrader sets it up) |
| MT5 access and trading servers | Accounts, prices, order execution | Your MT5 licence or white label provider |
The Worker does not replace the trading server and does not change execution. It improves how the terminal is delivered and presented. This also fits how MetaQuotes reshaped the product: since October 2022 the MT5 web terminal operates as an individual terminal that works only with a specific broker’s platform and runs on the broker’s access server. A Worker gives that terminal a clean, branded front door on your own domain. For the domain side in more depth, see running the MT5 webtrader on a custom domain.
MT5 DDoS protection: what Cloudflare covers and what it does not
DDoS attacks are a well-known risk for online trading platforms, and an outage during a volatile session hurts most. That is why MetaQuotes chose a network-level partner in 2020. When the terminal is served through a Worker, every browser request reaches Cloudflare first, and Cloudflare’s network-level DDoS protection applies before traffic gets anywhere near your platform.
The useful question is not “is Cloudflare protecting me?” but “which of my entry points does it sit in front of?”
| Entry point | Protected by a Worker on your domain? | What to do |
|---|---|---|
Web terminal hostname (trade.yourbrand.com) | Yes, traffic passes through Cloudflare’s network | Keep the hostname proxied through Cloudflare; do not publish a direct alternative |
| Desktop and mobile MT5 apps | No, they connect to access servers directly | Ask your platform operator about Spectrum or equivalent protection |
| Upstream web terminal endpoint | Only if attackers cannot reach it directly | Avoid advertising the upstream address; restrict it where your operator allows |
| Marketing site and client portal | Only if they are also on Cloudflare | Put them behind the same account and review settings together |
Three practical points follow. First, a web terminal on Cloudflare means a flood aimed at the trading address hits Cloudflare’s edge, not a single VPS. Second, the account-range check runs at the edge, so login attempts with account numbers that are not yours never reach your servers. Third, protection is only as good as the weakest route: if the upstream address is printed in old emails, help articles or a legacy subdomain, an attacker can go around the edge. Our MT5 webtrader security checklist covers this in more detail.
Why do Workers suit a trading web terminal?
- Custom domains with automatic SSL. Cloudflare creates the DNS record and certificate when you attach a custom domain to a Worker, and renews certificates without manual work. Expired certificates are a common cause of “site not secure” warnings that frighten clients away.
- WebSockets. Workers support WebSocket connections, including proxying them to another server, which the terminal uses for live quotes and order updates. Cloudflare documents a 32 MiB message size limit, far above what quote and order messages need.
- Security. HTTPS and network-level DDoS protection are built into Cloudflare’s network, and login control by account range adds an application-level filter.
- Elasticity. Traffic spikes around news events or a marketing campaign do not require new servers; the platform scales with requests.
- Configuration without redeploying. Branding, legal links and access settings live in environment variables you change in the dashboard.
- Ownership. The Worker lives in your Cloudflare account. You control the domain, the logs and the settings, and you can see exactly what is deployed.
Together these turn the web terminal from a piece of infrastructure into a configuration. That is why a Worker-based terminal is typically live the same day, provided your domain is already on Cloudflare and your MT5 web terminal endpoint is available.
Which settings does a broker control in the Worker?
With FXPTrader every broker-specific value is a Cloudflare environment variable. Nothing is hard-coded, so a compliance update or a new address is a dashboard change rather than a development task.
| Setting | What it controls | Example of when you change it |
|---|---|---|
| Company name | The brand shown in the terminal | Rebrand or new trading name |
| Address, email, telephone | Contact details shown to clients | Office move or new support mailbox |
| Website | Link back to your main site | New marketing domain |
| Trading server name | Which MT5 server clients connect to | Server migration or separate live and demo set-ups |
| Upstream | Where the Worker forwards terminal traffic | Platform operator changes the web terminal endpoint |
| Licence URL, privacy URL | Regulatory and privacy links in the footer | Updated policy or new licence page |
| End-user text | Risk warning or notice shown to clients | Regulator requests revised wording |
| Allowed login ranges | Which account numbers may log in | New account group, IB range or prop programme |
Login ranges deserve special attention. If you share a server with other brands or run several programmes, ranges let one terminal accept only the accounts that belong to it. The guide to restricting MT5 webtrader login ranges explains how to plan them, and compliance details for broker web terminals covers what the legal fields should contain.
How to set up the MT5 web terminal on Cloudflare Workers
The sequence below reflects a typical FXPTrader deployment. The broker keeps ownership throughout; FXPTrader does the set-up in the broker’s own account.
- Confirm MT5 access. You need a working MT5 platform through your own licence or a white label, and a web terminal endpoint for it. FXPTrader is not an MT5 licence or white label and does not provide one.
- Put the domain on Cloudflare. The domain that will host the terminal must be managed in Cloudflare. If it is not, move its nameservers first; our subdomain and DNS set-up guide walks through it.
- Choose the hostname. Pick a clear address such as
trade.yourbrand.comorwebtrader.yourbrand.com. Keep it short, and avoid names that look like a third party. - Deploy the Worker. The Worker is deployed into your Cloudflare account, not a shared one, so you keep control of it.
- Attach the custom domain. Cloudflare creates the DNS record and certificate automatically.
- Enter the environment variables. Company details, trading server name, upstream, licence and privacy URLs, end-user text and login ranges.
- Test. Log in with a demo or test account inside the permitted range, then try one outside it. Check quotes stream, orders reach the server and the legal links open correctly on desktop and mobile browsers.
- Publish the link. Add it to your website, client portal and welcome emails. If you embed the terminal, see embedding the MT5 web terminal on your website.
For a broader readiness list that includes support and marketing tasks, use the branded webtrader launch checklist.
Cloudflare Workers vs a VPS for the MT5 web terminal, including cost
A VPS with a reverse proxy also works, but it is one location your team must maintain: operating system updates, proxy configuration, certificates, monitoring and scaling. With Workers those tasks largely disappear and delivery happens close to each trader.
| Criterion | Cloudflare Worker | Single VPS with reverse proxy |
|---|---|---|
| Location | Runs at the edge near each visitor | One data centre you choose |
| SSL certificates | Issued and renewed automatically | You install and renew them |
| Patching | None for the broker | Operating system and proxy updates |
| Traffic spikes | Scales with requests | Limited by the machine’s capacity |
| DDoS exposure | Behind Cloudflare’s network | Depends on the hosting provider and extra services |
| Custom logic | Within Workers runtime limits | Anything the server can run |
| Skills needed | Cloudflare dashboard | Linux, web server and certificate administration |
A VPS still makes sense if you need software that cannot run in a Worker, or if your policy requires a specific hosting jurisdiction for the proxy layer. For most brokers whose goal is a branded, secure address for the terminal, the Worker removes a server they would otherwise have to babysit. See Cloudflare vs AWS vs a VPS for a three-way comparison.
What about running costs?
Cloudflare offers a free Workers plan with a daily request allowance and paid plans with higher limits. Many brokers’ web terminal traffic fits within these plans; check Cloudflare’s current Workers pricing for exact limits. The cost drivers to look at are the number of active browser sessions, how many brands you run, and whether you want additional Cloudflare products on the same account.
The bigger line items usually sit elsewhere: your MT5 licence or white label, liquidity and the people who support clients. The FXPTrader service itself is quoted on request. See cost factors for a branded MT5 webtrader.
What Cloudflare Workers cannot do for an MT5 broker
- They do not host the MT5 trading server; execution stays with your platform.
- They do not by themselves reduce the distance between your trading server and liquidity, so they should not be sold to clients as “faster execution”.
- They do not provide MT5 access. If your licence or white label ends, the terminal has nothing to connect to.
- Wildcard custom domains are not supported for Workers custom domains, so each terminal address is set up explicitly.
- Your domain must be managed in Cloudflare.
- They do not protect desktop or mobile app connections, which go straight to access servers.
Common pitfalls when brokers plan a Cloudflare set-up:
- Leaving an old direct link live. A forgotten subdomain that points straight at the upstream undermines both branding and DDoS protection.
- Login ranges set too wide. A range that covers another brand’s accounts on a shared server lets the wrong clients log in under your name.
- Stale legal text. Because changes are easy, assign an owner for the licence, privacy and risk text so it is reviewed when policies change.
- Confusing delivery speed with execution speed. The terminal loads faster from the edge; order fills depend on the trading server. Our latency and uptime guide separates the two.
Running several brands or programmes on Cloudflare
Groups with more than one brand, prop firms with separate programmes and introducing brokers with their own front ends often need several terminal addresses. The clean pattern is one Worker and one configuration per brand. Each gets its own hostname, its own legal details and its own login ranges, while all of them can point at the same MT5 platform.
This keeps responsibilities clear: a change to one brand’s privacy policy cannot leak into another’s footer, and an auditor can see each brand’s settings in isolation. It also means a brand can be paused by detaching its domain without touching the others. More on the model is on the multi-brand webtrader page.
When deciding between one shared terminal and several, ask three questions: do the brands have different regulators or legal entities, do they target different client groups, and do they use separate account ranges? If the answer to any is yes, separate Workers are the safer choice.
Sources
- MetaTrader 5: Cloudflare against DDoS attacks (June 2020)
- MetaTrader 5: new WebTerminal for brokers (October 2022)
- MetaTrader 5 Web Terminal
- Cloudflare global network
- Cloudflare Workers: WebSockets
- Cloudflare Workers: custom domains
Frequently asked questions
Does MetaQuotes work with Cloudflare?
Yes. In June 2020 MetaQuotes announced Cloudflare Spectrum for brokers to protect MetaTrader endpoints from DDoS attacks. Spectrum sits in front of access servers, and arrangements are typically made by whoever operates those servers.
Can the MT5 web terminal run on Cloudflare Workers?
A Worker can serve and brand the web terminal on your domain and pass its WebSocket traffic; the trading server remains on your MT5 platform. In practice the Worker is the front door and your MT5 servers do the trading.
Do Cloudflare Workers support WebSockets?
Yes. Workers can accept and proxy WebSocket connections, which the terminal uses for live prices and order updates. Cloudflare documents a 32 MiB message size limit, which is well above what trading messages need.
Does Cloudflare protect MT5 from DDoS attacks?
It protects whatever is routed through it. A web terminal on a Worker is behind Cloudflare’s network, but desktop and mobile apps connect directly to access servers, so those need Spectrum or your platform operator’s own protection.
Do I need my own MT5 licence to use a Cloudflare Worker terminal?
You need MT5 access, either through your own licence or a white label provider. FXPTrader delivers the web terminal on your domain; it is not an MT5 licence or white label and does not replace one.
Will a Worker make execution faster?
It brings delivery of the terminal closer to each client, but execution speed depends on your trading server and liquidity connections. Avoid describing an edge-delivered terminal as faster execution in client marketing.
Do I need a paid Cloudflare plan?
Many brokers start on the free plan; larger client bases may choose a paid Workers plan for higher limits. Check Cloudflare’s current pricing page against your expected number of sessions.
Does my domain have to be on Cloudflare?
Yes. Workers custom domains require the zone to be managed in Cloudflare, which means pointing the domain’s nameservers to Cloudflare. Your existing website can stay where it is hosted; only DNS management moves.
How long does setup take?
A Worker-based terminal is typically live the same day once the domain is on Cloudflare and your MT5 web terminal endpoint is available. Most of the time goes into agreeing the hostname, legal text and login ranges.
Can I restrict who logs in to the terminal?
Yes. The Worker checks the account number against allowed login ranges stored as an environment variable, and refuses accounts outside them before they reach your platform. This is useful on shared servers and for separate programmes.
Can I use a wildcard domain for several brands?
No. Workers custom domains do not support wildcards, so each terminal address is attached explicitly. For several brands the usual pattern is one Worker and one configuration per brand.
Who owns the Worker and its settings?
The Worker is deployed in your own Cloudflare account, so you own the domain, the configuration and the logs. FXPTrader sets it up, but you can see and change the environment variables in your dashboard.