What you’ll need
- An ngrok account.
- The ngrok Agent CLI installed.
- Odoo running locally (default:
http://localhost:8069). - (Recommended) Admin access in Odoo to change System Parameters.
1. Reserve a static domain
A static domain ensures your URL doesn’t change across restarts (important for Odoo links, redirects, and webhooks). In the ngrok dashboard, go to Domains → New +. Reserve a domain (this example useshttps://your-odoo.ngrok.app) and save it as an environment variable:
Why a static domain?
Odoo stores and uses absolute links.
A stable host prevents broken links in emails, reports, and third-party callbacks.
2. Start the ngrok endpoint for Odoo
Expose Odoo on port8069 at your static domain:
https://$NGROK_DOMAIN to see the Odoo login page (/web/login).
3. (Recommended) Configure Odoo for a proxy and stable URLs
Make sure Odoo generates correct HTTPS links and doesn’t rewrite your base URL.Enable proxy mode
If ngrok (or any reverse proxy) terminates TLS, enable Odoo’s proxy mode:odoo.conf
Freeze the base URL
Odoo updatesweb.base.url based on the host used at login. To keep it stable:
In Odoo, go to Settings → Technical → System Parameters (enable developer mode if needed).
Create or update:
web.base.url→https://$NGROK_DOMAINweb.base.url.freeze→True
4. Apply a Traffic Policy (secure your admin)
Protect sensitive paths like/web and /web/login using Traffic Policy.
Create a policy file (such as odoo-policy.yaml) and run the agent with --traffic-policy-file.
Option A: Restrict admin to your IP
odoo-policy.yaml
/web*; other requests are blocked before they hit Odoo.
Option B: Require Basic Auth on admin
odoo-policy.yaml
--traffic-policy-file flag.
Visitors to /web* must pass HTTP Basic Auth before Odoo’s own login.
5. Test your endpoint
From a terminal:/web/login) when loaded in a browser.
Troubleshooting
- Blank or mixed-content pages: Ensure
proxy_mode = Trueand you’re visitinghttps://$NGROK_DOMAIN. - Redirect loops or wrong links: Verify
web.base.urlis exactlyhttps://$NGROK_DOMAINandweb.base.url.freeze = True. - 403 when applying policy: Confirm your IP/CIDR is correct or disable the policy while debugging.
- Port issues: Odoo defaults to
8069; double-check the port if customized.
What’s next?
- Layer additional policies (OAuth/OIDC, rate limits, IP allow/deny lists) as needed.
- Use the ngrok dashboard’s Traffic Inspector to watch live requests and responses while testing.
- Reserve a custom domain you own and enable HTTPS via ngrok for a branded URL.