Publishing Open WebUI with Cloudflare Tunnel and Access

An outbound Cloudflare Tunnel can make a self-hosted Open WebUI reachable to staff without opening inbound ports, with Cloudflare Access deciding who gets in. The trade-off is that prompts cross Cloudflare's network before they reach your origin.

On this page

How Cloudflare Tunnel with Access publishes Open WebUI without open ports

A team wants staff to reach Open WebUI from home, on the road or from another office, but the firewall has no public inbound port and the office has no static public IP. Cloudflare Tunnel addresses this by running a connector inside your network that opens outbound connections to Cloudflare. Users connect to a hostname on Cloudflare's edge, and Cloudflare relays those requests back through the connector to the internal address where Open WebUI listens. Nothing in your firewall needs an inbound rule for web traffic, and the Open WebUI host does not need a public address. The connector runs close to Open WebUI, so it should be deployed on a host that can reach the Open WebUI service and be monitored like any other piece of production infrastructure.

Cloudflare Access sits in front of that hostname as the login gate. Before a request reaches the tunnel, Access checks the user against an identity policy, such as membership in an identity provider group, and only then passes the request on. Open WebUI still performs its own sign-in, so the two layers should be planned together: decide which group may reach the hostname, which Open WebUI roles those users receive, and whether Open WebUI should trust the identity provider through its own SSO settings. This pattern fits best when staff are remote, the office has no static public IP, and the organization already uses a Cloudflare account and an identity provider it can connect to Access. It fits less well when traffic must stay on your own network paths or when no Cloudflare account exists yet.

The Open WebUI facts available for this topic describe the application, including its SSO, roles and scaling requirements. They do not describe how Cloudflare Tunnel, its connector or Access behaves, including supported platforms, connector versions, streaming or WebSocket handling, timeouts and pricing. Confirm each of those points against current Cloudflare documentation before the design is approved, and test long streaming conversations through the tunnel, because a long-lived response is where proxy timeouts usually appear first.

Every hop after Cloudflare sees the prompt in clear text unless the model runs inside the network

The request starts in the user's browser, passes the Cloudflare edge where the Access policy is checked, and reaches the tunnel connector inside the client network. The connector forwards it to the Open WebUI origin, which calls the model provider or local model service. Check at each boundary who can read the prompt and response in clear text, because TLS ends at Cloudflare's edge and again at the origin. The arrow from the Cloudflare edge to the connector is outbound from the client network, so no inbound port is opened.

Request path and where prompts are readable in clear text at each hop.

Which publishing option fits which team

This table compares a Cloudflare Tunnel with Access, a public reverse proxy with your own certificates and identity layer, and a VPN or private network path for staff only. Read each row as a question you must answer before choosing, and treat the operational burden column as the figure that tends to decide the matter.

OptionWho can reach itWhat must be opened on the networkWho holds the TLS keys and the operational burden
Cloudflare Tunnel with AccessUsers who pass the Access policy, such as an identity provider login, applied in front of the hostnameNo inbound ports. A connector on your network makes outbound connections to CloudflareCertificates are terminated at Cloudflare's edge. Burden is policy design, connector hosting and reviewing where prompts pass through Cloudflare
Public reverse proxy with your own certificatesAny client that reaches the public address, so access control depends on Open WebUI login, SSO and any added identity layerInbound HTTPS on a public address, plus firewall, rate limiting and WAF rules you configureCertificates are held by you, for example through Let's Encrypt or an internal CA. Burden is patching, certificate renewal, exposure monitoring and edge hardening
VPN or private network pathOnly staff whose devices join the VPN or private networkInbound VPN or private gateway ports, with routing and client enrollment managed by your teamCertificates can be internal, and the path stays inside your network. Burden is client enrollment, VPN capacity and support for remote or contractor access
Fits a team that needs external access without inbound portsYes, with a defined user group and Access policyNo inbound portsChoose this when your security team accepts a third-party edge in the data path and can review that policy
Fits a team that must keep TLS termination in-houseDepends on the identity layer you place in frontInbound HTTPSChoose this when certificate lifecycle and perimeter hardening are staffed and documented
Fits a staff-only deploymentStaff with enrolled devices onlyInbound VPN or private gatewayChoose this when external users are not needed and enrollment is manageable
Confirm before choosingAsk whether Open WebUI sessions, websockets and streaming responses behave as expected through your chosen pathConfirm connector and gateway requirements with Cloudflare documentation and your network teamConfirm log retention, data location and Cloudflare terms for prompt traffic with your privacy and legal teams

Decisions to settle before you publish Open WebUI

Publishing Open WebUI through a Cloudflare Tunnel puts two layers of sign-in and one shared state model in front of your users. Each decision below changes what the next one has to support, so settle them in this order before any connector is installed. Your answers determine how many replicas you can run and how quickly a sign-out takes effect.

Choose the identity provider for Access

Cloudflare Access needs an identity provider that users already sign in to, such as your corporate directory or an OIDC provider. Confirm which provider holds the groups you care about and whether it is reachable from Cloudflare's login flow. Decide this first, because the group claims it returns drive every later access rule.

Decide whether Open WebUI SSO also applies

Open WebUI documents SSO through OIDC and LDAP, so users may face Access sign-in and then a second Open WebUI sign-in. Decide whether Open WebUI's own SSO should point at the same identity provider, so one login covers both layers. Check that the two layers do not disagree about who a user is or what group they belong to.

Open WebUI features

Map Access policies to Open WebUI groups

Decide whether Access policies only admit users to the hostname, or also reflect the groups Open WebUI uses for role-based access. Open WebUI supports groups and per-resource permissions, so mismatched group definitions can grant a user access in one layer and deny it in the other. Write down which group is the source of truth before you create policies.

Place and staff the connector

The cloudflared connector runs inside your network and makes outbound connections, so it needs a host with a stable location and a named owner. Decide whether your platform team or DeployOpen operates it, who patches it, and who responds when the tunnel drops. Confirm that the host can reach the Open WebUI origin and nothing else it does not need.

Confirm single instance or several replicas

A single Open WebUI instance can sit behind one tunnel with SQLite on locally attached SSD or NVMe storage, but only for single-replica, evaluation or small team use. Several replicas require PostgreSQL instead of SQLite, because SQLite does not handle concurrent writes from multiple processes well. Decide the replica count now, since it determines the database and state design.

Scaling Open WebUI

Require Redis and shared storage for replicas

Multiple replicas need Redis for sessions, websocket connections and application state, plus shared file storage so uploads and knowledge stay reachable from every replica. Without Redis, signing out does not revoke tokens, which stay valid until expiry, by default after 4 weeks. Decide whether Redis and shared storage are in place before publishing, and set a token lifetime your security team accepts.

Setup sequence for an Open WebUI origin behind a Cloudflare Tunnel

This sequence takes Open WebUI from a pinned release on a private address to a tested, signed-in session published through an outbound Cloudflare Tunnel with Cloudflare Access in front. Each step ends with a check that confirms the origin stays closed to direct internet traffic.

  1. Confirm the release and pin the image tag

    Your team checks the current Open WebUI release notes on the project's GitHub releases page and selects one specific version to run. Record that exact tag in your deployment configuration instead of using a floating tag such as latest, so every restart and upgrade is a deliberate change. Read the release notes for any license or configuration changes that affect your version. Done when the chosen tag is written in version control and the release notes review is signed off by the owner of the deployment.

  2. Run Open WebUI on a private address

    Start Open WebUI on a host or cluster network that the connector host can reach but the internet cannot, using your chosen install method (Docker, Compose, Helm or pip). For a team deployment, configure PostgreSQL, a persistent data volume and a stable secret key before users arrive, because the tunnel does not change how the application stores data. Confirm the service answers on its private address from the connector host. Done when a health request from the connector host succeeds and a request from outside your private network fails.

  3. Install the connector and create the tunnel

    A network or platform administrator installs the Cloudflare connector (cloudflared) on a host inside your network and creates a tunnel in the Cloudflare account that owns the domain. The connector opens outbound connections to Cloudflare, so no inbound firewall rule is added for Open WebUI. Follow Cloudflare's current documentation for the exact installation and tunnel creation commands, since they change over time. Done when the tunnel shows as connected in the Cloudflare dashboard and the host has no new inbound listening port for Open WebUI.

  4. Route a hostname to the local service

    Add a public hostname to the tunnel and point it at the private Open WebUI address as the origin service. Use a hostname your users already expect, and confirm the DNS record that Cloudflare creates for it. Test the route from an external network. Done when the hostname reaches the Open WebUI login page through Cloudflare, and a direct request to the origin's private address from the internet still fails.

  5. Define the Access application and allow policy

    In Cloudflare Access, create an application for the hostname and attach an allow policy that names the groups or identities permitted to reach it. Keep the policy narrow and avoid broad rules such as allowing any email domain unless that is the intended audience. Decide whether the application should cover only the web interface or also API paths, since API keys and tool calls can bypass a browser login flow. Done when an unlisted test identity is blocked at the Access prompt and a listed identity reaches the application.

  6. Configure identity in Access

    Connect Access to your identity provider so people sign in with their corporate accounts, and enable multi-factor authentication in that provider where your policy requires it. Separately, decide how Open WebUI itself authenticates users, whether through its own OIDC or LDAP settings or local accounts, so that users do not face two unrelated sign-in models without a reason. Confirm the group claims Access uses match the groups in your policy. Done when a test user signs in through the identity provider and Access passes them to Open WebUI with the expected role.

  7. Test sign-in, streaming and sign-out

    Run a scripted test plan with a few real accounts of different roles. Confirm that a prompt streams token by token without stalling, which shows WebSocket and streaming traffic passes the tunnel and Access. Then sign out of Open WebUI and of Access, reload the page, and confirm that the session no longer works. Also verify that tokens are revoked on sign-out in your setup, since the scaling guidance notes that without Redis, sign-out does not revoke tokens and they remain valid until expiry. Done when each test case is recorded with its result and any failure has an owner.

  8. Record the data path and rerun checks after changes

    Document where prompts and responses travel: from the user's browser through Cloudflare's network, through the tunnel to Open WebUI, and onward to the model provider you configured. Cloudflare terminates TLS on its network, so decide whether that path is acceptable for the sensitivity of your prompts or whether a different publishing model is required. Repeat the external reachability and sign-out checks after every upgrade or policy change. Done when the data path diagram and the check list are approved and stored with the deployment record.

Where sensitive prompts travel when the tunnel path is used

With a Cloudflare Tunnel in front of Open WebUI, every prompt and response from a signed-in user crosses Cloudflare's edge before it reaches the outbound connector and then the Open WebUI origin. The traffic is encrypted in transit, but Cloudflare terminates the user's TLS session at its edge, so the data is handled by a third party in the request path. The first decision is whether that path is acceptable for each data class the team expects to type into the interface. That answer depends on the contracts covering the data, any terms that govern processing by the provider, and what the applicable regulators and internal policies say about third-party processing of that category. Confirm these points with the provider's current documentation and your own legal and compliance advisers, not from this page.

If the model is a remote provider such as OpenAI or Anthropic, prompts take a second hop. Open WebUI sends them from your network to that provider, so the tunnel question and the model question are separate. A team can accept the edge path for internal assistants while still prohibiting certain data from reaching a remote model, or the reverse. Map each model connection in the Open WebUI admin settings to its data classes and its provider terms, and record the result next to the tunnel decision. Where a local model is used through Ollama or another self-hosted server, the second hop stays inside your infrastructure, but the tunnel hop still applies.

The alternative is to keep the Open WebUI origin on a private network and reach it through a VPN, a zero-trust client, or another internal path, so that user traffic never leaves infrastructure you operate. This costs more in client rollout, network design and support for remote users, and it removes the external access controls that Cloudflare Access provides. Some organizations use both: the tunnel for lower-sensitivity users and an internal path for regulated groups. Whichever option is chosen, the decision belongs to the organization's risk owner, who should record the accepted data classes, the review date and the conditions that would reopen the question.

How Access policies differ for employees, contractors and administrators

General staff are the largest group and should match the identity source the company already uses for daily work. The Access policy should accept only that identity provider, scope the application to the company's domain or groups, and map to the ordinary Open WebUI user role, with access to models and knowledge bases granted through Open WebUI groups rather than through the Access policy itself.

  • Identity source: the corporate identity provider connected to Cloudflare Access, such as an OIDC or SAML directory the company already runs.
  • Access policy: an Allow rule for the staff group, with a default deny for everyone else.
  • Open WebUI role: the standard user role, with groups assigned through SSO or SCIM provisioning where supported.
  • MFA expectation: require the same phishing-resistant or app-based MFA the identity provider enforces for corporate sign-in, confirmed in the identity provider rather than assumed.
  • Session length: a working-day session length to confirm with the security team, balanced against how often users must re-authenticate in long conversations.

Confirm that the group claim in the identity token matches the group names Open WebUI expects before rollout, since a mismatch usually shows up as users who sign in but receive no access.

Security controls to layer on top of the tunnel

A tunnel and an access policy only protect Open WebUI if the origin stays unreachable from the internet and identity sessions are managed end to end. The controls below cover the network path, the application's own settings, sign-in visibility and the offboarding steps that the tunnel does not handle for you.

Keep inbound firewall rules closed

With a Cloudflare Tunnel, the connector opens outbound connections to Cloudflare, so the origin needs no inbound rules for the public hostname. Check that security groups, host firewalls and the network edge in front of the origin do not expose the Open WebUI port or the host's administrative ports to the internet. Confirm this from outside your network, not only from the configuration files.

Restrict the origin to the connector

Even with no open inbound ports, a second route to the origin, such as a forgotten load balancer, a public IP on a replacement host or a direct DNS record, would bypass Access. Limit the origin so it accepts requests only from the host running the connector, for example by binding Open WebUI to a private interface and filtering traffic at the host. Test by requesting the origin address directly and expecting it to fail.

Set a strong secret key and pin the image

Open WebUI signs its sessions with a secret key, so set a long random value from your secrets store rather than leaving a default, and keep it unchanged across restarts so sessions behave predictably. Pin the container image to a specific release tag instead of a floating tag, so the version you tested is the version that runs behind Access. Record both in your change log.

Require MFA for Open WebUI admins

Access can require a second factor before users reach the hostname, but administrators also sign in to Open WebUI itself, where they can change models, users and connections. Turn on authenticator-app MFA for admin accounts inside Open WebUI, and confirm that break-glass admin accounts are either protected the same way or disabled. Check the setting with a test admin account after each upgrade.

Log sign-ins at both layers

Access records authentication events at the edge, and Open WebUI records its own sign-ins and admin actions, so you need both to reconstruct who reached the application. Send both log streams to your central log platform, retain them for the period your policy requires, and test that a sample sign-in appears in each source with the same user identifier. Ask your vendor and auditor what retention applies to each.

Revoke Access and Open WebUI tokens

Ending an Access session blocks new requests at the edge, but Open WebUI tokens stay valid until they expire. Without Redis in a multi-replica setup, signing out does not revoke tokens, and by default they remain valid for 4 weeks. Write an offboarding runbook that removes the user from the identity provider, ends Access sessions, disables the Open WebUI account and deletes its API keys, and confirms the result with a test request.

Scaling docs

Limits to confirm in your Cloudflare plan and your environment

Treat every limit in this path as something to confirm in writing, not something to assume. The first checks are streaming and long-running responses through the tunnel. Open WebUI sends model output as it is generated, and a long reasoning or document-analysis answer can run far longer than a typical web request. Run a test conversation that streams for several minutes through the tunnel and watch for cut-off or buffered output. Then confirm WebSocket support for the chat interface under your Cloudflare plan and settings, since Open WebUI relies on websocket connections for live updates. Ask Cloudflare to state in writing which plan features apply to your account, because feature availability differs by plan.

Next, confirm the upload size limits at the edge. Users attach documents and images, and a limit set at Cloudflare can reject uploads before they reach Open WebUI, producing errors that look like application faults. Measure the largest file your users will send, then compare it with the edge limit and the Open WebUI upload settings. For Access, confirm how session lifetime and re-authentication work for long sessions, and whether an idle or expired Access session interrupts a conversation in progress. Test this with a session left open past your intended policy window.

On the data side, ask Cloudflare for its current documentation on regional data handling, request logging and retention for the products you use, and confirm whether any traffic inspection or logging applies to prompts and responses. Your compliance team should review these terms against your obligations, because the tunnel carries the same sensitive prompt content as your application. Finally, confirm that the connector host can be patched and monitored on your schedule, since it is a server that must stay running and current. If you plan multiple Open WebUI replicas, the Open WebUI scaling guide sets the shared requirements for Redis, PostgreSQL and file storage, which sit behind the tunnel and must be sized separately. This section assumes no latency or throughput figures; measure them in your own environment.

What does publishing Open WebUI through Cloudflare cost and take to set up?

What does the Cloudflare Tunnel and Access work include?

The work covers an outbound connector on a host inside your network, a published hostname that routes to the Open WebUI service, an Access application with an identity policy in front of it, and documented rules for who may reach each audience. Effort rises with the number of hostnames and audiences, the identity provider integration, and whether Open WebUI runs as one instance or several replicas behind it. Each Access policy and each published route needs a named owner and a review date, so the setup is as much configuration and governance as it is installation.

What drives the effort up or down?

Four factors move the effort most:

  • Identity integration: a single OIDC or SAML provider with clean group claims is simpler than several providers or directories that must map to Access rules.
  • Number of audiences: separate hostnames for users, administrators and API clients each need their own policy and testing.
  • Multi-replica state: if Open WebUI runs with several replicas, Redis, PostgreSQL and shared file storage must already be in place, because the tunnel does not solve those needs.
  • Logging and offboarding: access logs must reach your retention store, and removing a leaver must end both Access sessions and Open WebUI sessions.
Can our own team set this up without a partner?

A team that already runs Open WebUI behind a reverse proxy and administers its identity provider can usually build the first working route alone, provided someone has time to test policy changes and failure cases. The harder parts are the ones teams underestimate: writing the policy model, proving that a revoked user loses access, and deciding how sensitive prompts travel through Cloudflare's network. An outside team is most useful when those decisions need an independent review or when the internal team lacks time to test them before the go-live date.

What must our organization provide before work starts?

Plan to provide four things:

  • A DNS zone you control, with permission to add records for the chosen hostnames.
  • Administrative access to your identity provider, including the ability to create applications, groups and test accounts.
  • A Linux host or VM inside your network to run the connector, with a supported operating system, outbound HTTPS access and a patching window.
  • A named owner for the data path decision, who can approve whether prompts and responses pass through Cloudflare's network before any user is onboarded.
What recurs after go-live?

Some costs are one-time, such as the initial build, testing and documentation. Recurring work includes reviewing Access policies when groups change, patching the connector host and updating the connector software, checking token and session lifetimes against your identity policy, and reviewing access logs. Open WebUI upgrades also need a retest, because a new release can change the routes or headers the tunnel depends on. Ask any partner whether these are included in a fixed-scope build or offered under an ongoing retainer.

Which Cloudflare plan and terms apply to our use?

The Cloudflare plan, feature availability and commercial terms must be confirmed directly with Cloudflare for your account and region, since they can change and depend on your contract. Before you budget, ask Cloudflare which Access and tunnel features your plan includes, how it handles logs and retention, and what data it processes on the traffic path. The answers determine whether the design in your written scope is possible as planned.

What should we ask for in a written quote?

Ask for a quote that lists the scope in writing before work starts. It should state the number of hostnames and audiences, the identity provider integration, the replica and state assumptions, the testing and retest scope, the documentation and handover items, and the offboarding and log review steps. Ask which items recur after go-live, who owns each one, and what happens if the Open WebUI version or your Cloudflare plan changes during the engagement. DeployOpen does not publish a price list, so the quote follows from that written scope.

How DeployOpen scopes and delivers a Cloudflare Tunnel publishing project

DeployOpen plans, builds, documents and supports the Cloudflare Tunnel and Cloudflare Access layer in front of your self-hosted Open WebUI, inside your own infrastructure and accounts. The work starts with a written scope that states which users, identity provider and data path are in view, so the publishing decision is made deliberately before anything is exposed.

How we scope

  • We confirm where Open WebUI runs, which hostnames users will reach, and which Cloudflare account and zone the tunnel will use.
  • We document the identity provider and the Access policies that decide who may reach the login page at all.
  • We record the data path decision for sensitive prompts, including where TLS terminates and what Cloudflare can see in transit.

How we build

  • We install and configure the outbound connector on hosts you control and map each published hostname to its internal Open WebUI service.
  • We apply Access policies and confirm that no inbound ports on the origin network are needed for user traffic.
  • We test sign-in through Access, streaming responses, WebSocket behavior and the failure path when the tunnel connector is stopped.

How we hand over

  • You receive the written configuration record, including tunnel and connector ownership, hostnames, policy list and rollback steps.
  • You receive a test log showing the checks run, the results and any open items agreed in the written scope.
  • Your team is walked through the runbook for rotating connector credentials and changing Access policies.

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrades and continuous testing for the publishing layer are available as a retainer.
  • Confirm with DeployOpen during scoping which changes, such as new hostnames or policy edits, fall inside the retainer.

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.