Accounting, inventory, sales, and HR data are among a company's most valuable assets, and the ERP system is the main gateway to them. That is why many organizations want to be sure that only people connecting from the office, a VPN, or other trusted locations can log in to Odoo. In this article, we show how to restrict login IPs in Odoo 19, which methods you can choose from, and what to watch out for during implementation.
Before you start configuring, try Odoo in your own environment and see what the user management panel looks like.
Does Odoo have a built-in allowlist of IP addresses?
In the standard settings of Odoo 19, you will not find an option such as "allowed IP addresses per user." Odoo does not filter IP addresses on its own, and network access control is handled at higher infrastructure layers: in a proxy server, a firewall, or a VPN. An alternative is a dedicated module that checks the client's IP address during authentication.
Odoo's built-in mechanisms (access rights, two-factor authentication, session management) are still an important complement, though. IP restriction is one layer of security, not the only safeguard.
Methods for restricting login IPs in Odoo
1. Reverse proxy (Nginx) – the most common solution
If Odoo runs on your own server (on-premise or in a private cloud), the simplest approach is an allow/deny rule in Nginx. This way, requests from unauthorized addresses are rejected before they reach the application.
Keep in mind that in Odoo 19 the backend interface runs under the /odoo path, but you can also log in and retrieve data through RPC and API endpoints (including /jsonrpc, /xmlrpc, /json/2). If you secure only /odoo, anyone who knows valid credentials can still connect to the system through the API from any address. That is why your rules must cover these paths as well. Example configuration (we assume the upstream odoo block is already defined):
# Database manager – most restrictive (this block must come before the general one)
location ~ ^/web/database {
allow 203.0.113.10; # office
deny all;
proxy_pass http://odoo;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Backend and API endpoints
location ~ ^/(odoo($|/)|jsonrpc|xmlrpc|json/) {
allow 203.0.113.10; # office
allow 198.51.100.0/24; # VPN network
allow 192.0.2.25; # external system using the API
deny all;
proxy_pass http://odoo;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
Order matters: Nginx picks the first matching regex location, so we place the database manager block before the general one. If another proxy, load balancer, or CDN sits in front of Nginx, configure set_real_ip_from and real_ip_header so that the allow/deny rules compare the client's real address rather than the intermediary's. Paths such as /web/dataset are used by the backend, but some public website features rely on them too, so add them to your rules only after testing.
In the odoo.conf file, set proxy_mode = True so that Odoo correctly reads the headers passed by the proxy. Also disable the public database list (list_db = False), set a strong master password (admin_passwd), and restrict listening to the local interface (http_interface = 127.0.0.1) so that nobody can bypass Nginx by connecting directly to port 8069.
2. Firewall and security groups
The second option is to filter traffic at the firewall level (e.g., UFW, iptables, nftables) or with security groups at your cloud provider. You can allow connections on ports 80 and 443 only from specific addresses. This is an effective solution, but it blocks the entire service, so it also affects customers and vendors using the portal as well as visitors to your website. Whichever method you choose, close ports 8069 and 8072 to the outside so that traffic always goes through the proxy.
3. VPN or Zero Trust
If employees connect from various locations, instead of maintaining a long list of addresses it is better to expose Odoo only through a VPN or a Zero Trust solution. The allowlist then contains only the VPN's egress address, and you grant and revoke access centrally.
4. Custom Odoo module
When you need per-user rules (e.g., an accountant only from the office, a salesperson from anywhere), you can build a module that extends the authentication process (e.g., by overriding methods of the users model). The module checks the client's IP address read from the request (with proxy_mode enabled, this is the address forwarded by the proxy) and compares it with a list assigned to the user or group. This does require development skills and testing after every version upgrade.
For more complex requirements, it is worth consulting an experienced partner on the architecture to avoid locking the entire team out.
What to watch out for when restricting IPs
- Portal users – customers log in through the same /web/login address, so do not block the entire login page if you use the portal. Block the backend and API paths instead. You can read more about the differences between account types in the article Odoo Public and Portal Users: How Do They Work?.
- Integrations and API – external systems connect through API endpoints (e.g., /jsonrpc, /xmlrpc, /json/2). Add their addresses to the allowlist or define separate rules. You can find configuration details in the guide How to Set Up API Access for a User in Odoo 19.
- Dynamic IP addresses – regular home connections often change addresses. In that case, a VPN is the better choice.
- Emergency access – always keep administrative access through the server console or another channel so you do not lock yourself out of the system after a faulty rule.
- Odoo Online and Odoo.sh – in these environments you do not have access to the server configuration, so you cannot deploy your own Nginx or firewall rules. Rely primarily on two-factor authentication, least-privilege access rights, and a session policy, and consider self-hosting if your requirements are strict.
Strengthen IP restriction with additional safeguards
An allowlist works best when combined with other mechanisms:
- Two-factor authentication (2FA) – users enable it in their preferences (it also works in the Community edition), and an administrator can enforce its use across the entire organization in the security settings.
- Session control – shortening the inactivity timeout reduces the risk of an open session being hijacked. See: Odoo 19 Session & Timeout: Setup and Account Security.
- Least privilege – grant only the access that is needed. These articles will help How to Restrict Module Access in Odoo 19 and How to Manage Users in Odoo 19 Enterprise.
- Login monitoring – regularly check where users are connecting from. We described how to do this in the post Odoo Login History: How to View It.
- Fail2ban – once a filter is configured on the Odoo log, it automatically blocks addresses that generate many failed login attempts.
How to implement the restriction step by step
- Collect the list of IP addresses for your offices, VPN, and external systems.
- Decide which paths should be protected (backend, database manager, API) and which remain public (portal, website, online store).
- Configure the rules in a test environment and check logging in from an allowed and a disallowed address, as well as how API integrations and the portal behave.
- Verify that Odoo sees the client's real address (correct proxy headers and
proxy_mode). - Close direct access to Odoo ports (8069 and 8072) from the internet.
- Deploy the changes to production outside business hours and have a rollback plan ready.
- Enable 2FA and monitor the login history.
Want to first see how user access rights and logins work? Launch your own Odoo test environment and practice the configuration without any risk to your company's data.
FAQ – frequently asked questions
Can I set allowed IPs for a single user in the settings in Odoo 19?
No, standard Odoo settings do not offer such a feature. A restriction for the entire installation is usually implemented in Nginx, on a firewall, or through a VPN, while per-user rules require a dedicated module.
Will IP restriction block customers who use the portal?
Yes, if you block the entire service or the login page. To avoid this, restrict only the backend paths, the API, and administration tools, and leave the portal publicly accessible.
Is blocking the /odoo path enough?
No. The /odoo path serves the backend interface, but data can also be accessed through RPC and API endpoints. Your rules should cover these paths as well, and the addresses of trusted integrations must be added to the allowlist.
Can I restrict IPs in Odoo Online?
In Odoo Online you do not have access to the server configuration, so you cannot deploy your own Nginx rules. However, two-factor authentication, access rights management, and session control are available. If you need strict IP filtering, consider self-hosting or consulting a partner.
Summary
Although Odoo does not offer a built-in allowlist of addresses, you can effectively restrict login IPs in Odoo using a reverse proxy, a firewall, a VPN, or a dedicated module. The key is to apply your rules not only to the backend interface but also to API endpoints, and to close direct access to the application ports. The strongest security comes from combining these methods with 2FA, a sensible session policy, and regular reviews of login activity.
Need help implementing secure access to Odoo? Contact the KK Innovations team, and we will design a solution tailored to your company.