Data security in ERP systems is an absolute priority for every organization. Configuring HTTPS/SSL for Odoo is an essential step that ensures encrypted communication between users and the server. In this guide, we walk through all the steps required to properly secure your Odoo 17 instance, as well as older versions of the system.
Why is HTTPS/SSL essential in Odoo?
The HTTPS protocol with an SSL/TLS certificate is the standard on today's internet. For ERP systems such as Odoo, which process sensitive business data, configuring HTTPS is not optional - it is a security requirement.
Key benefits of implementing HTTPS/SSL:
- Data encryption - all information transmitted between the client and the server is encrypted
- Server authentication - the certificate confirms the identity of the server
- Protection against attacks - safeguards against eavesdropping and data tampering (man-in-the-middle)
- User trust - modern browsers flag HTTP sites as insecure
- Better SEO - search engines prefer secure HTTPS sites
- Regulatory compliance - GDPR, PCI DSS and other standards require encrypted communication
- Support for modern features - some browser APIs (e.g. geolocation, PWA) require HTTPS
Prerequisites
Before you start configuring HTTPS/SSL for Odoo, make sure you have:
- A running Odoo instance (see our guide how to install Odoo on Ubuntu)
- A domain or subdomain pointing to the Odoo server (an A or AAAA DNS record)
- Root or sudo access to a Linux server
- Ports 80 (HTTP) and 443 (HTTPS) open in the firewall
- Nginx or Apache installed as a reverse proxy
- At least 1 GB of RAM (2 GB recommended for stable operation)
Ways to obtain an SSL certificate
1. Let's Encrypt (Certbot) - free certificate
Let's Encrypt is the most popular solution, offering free SSL certificates with automatic renewal. It is the ideal option for most Odoo installations. Certificates are valid for 90 days and are renewed automatically by Certbot.
2. Commercial certificates
Paid certificates from trusted CAs (Certificate Authorities) offer extended validation (EV), financial warranties and technical support. They may be required in some regulated industries.
3. Self-signed certificates
Useful only in test and development environments - browsers do not trust them and they will trigger security warnings.
Configuring HTTPS/SSL for Odoo with Nginx and Let's Encrypt
Step 1: Install Nginx
On Ubuntu/Debian, run:
sudo apt update
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx
Check the Nginx version (1.18 or newer is recommended):
nginx -v
Step 2: Install Certbot
Certbot is a tool for automatically managing Let's Encrypt certificates:
sudo apt install certbot python3-certbot-nginx -y
Step 3: Configure Nginx as a reverse proxy
Create a new configuration file for Odoo:
sudo nano /etc/nginx/sites-available/odoo
Add the following configuration (replace twoja-domena.pl with your own domain):
upstream odoo {
server 127.0.0.1:8069;
}
upstream odoochat {
server 127.0.0.1:8072;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
server_name twoja-domena.pl www.twoja-domena.pl;
access_log /var/log/nginx/odoo.access.log;
error_log /var/log/nginx/odoo.error.log;
# Allow Certbot to verify the domain
location /.well-known/acme-challenge/ {
root /var/www/html;
}
# Redirect to HTTPS (will be added by Certbot)
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name twoja-domena.pl www.twoja-domena.pl;
access_log /var/log/nginx/odoo.access.log;
error_log /var/log/nginx/odoo.error.log;
# SSL certificates (will be added by Certbot)
# ssl_certificate /etc/letsencrypt/live/twoja-domena.pl/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/twoja-domena.pl/privkey.pem;
# SSL parameters
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 1d;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
# Security headers
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains' always;
add_header X-Content-Type-Options 'nosniff' always;
add_header X-Frame-Options 'SAMEORIGIN' always;
add_header X-XSS-Protection '1; mode=block' always;
add_header Referrer-Policy 'strict-origin-when-cross-origin' always;
# Timeouts for Odoo
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
# Proxy headers
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
# Increase limits for large requests (data import)
client_max_body_size 256M;
client_body_buffer_size 256k;
# Main Odoo location
location / {
proxy_redirect off;
proxy_pass http://odoo;
}
# Longpolling for real-time features (chat, notifications)
location /longpolling {
proxy_pass http://odoochat;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
# WebSocket for Odoo 17+
location /websocket {
proxy_pass http://odoochat;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
# Cache for static assets
location ~* /web/static/ {
proxy_cache_valid 200 90m;
proxy_buffering on;
expires 864000;
proxy_pass http://odoo;
add_header Cache-Control 'public';
}
# Cache for content
location ~* /web/content/ {
proxy_cache_valid 200 90m;
proxy_buffering on;
expires 864000;
proxy_pass http://odoo;
}
# Gzip compression
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript application/pdf image/svg+xml;
gzip_disable 'msie6';
}
Enable the configuration:
sudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
Step 4: Obtain the SSL certificate
Use Certbot to automatically obtain and configure the certificate:
sudo certbot --nginx -d twoja-domena.pl -d www.twoja-domena.pl
Certbot will automatically:
- Generate an SSL certificate from Let's Encrypt
- Modify the Nginx configuration by adding the certificate paths
- Set up the HTTP to HTTPS redirect
- Configure automatic certificate renewal
- Verify that the configuration is correct
During installation, choose the option to redirect all traffic to HTTPS (option 2).
Step 5: Configure the odoo.conf file
Edit the odoo.conf file to add proxy support:
sudo nano /etc/odoo.conf
Add or modify the following parameters:
[options]
# Enable proxy mode (REQUIRED for HTTPS through a reverse proxy)
proxy_mode = True
# Restrict direct access to Odoo (security)
xmlrpc_interface = 127.0.0.1
netrpc_interface = 127.0.0.1
# Odoo ports
xmlrpc_port = 8069
longpolling_port = 8072
# Database filter (IMPORTANT in production)
# Set a regex for allowed database names or a specific database
dbfilter = ^nazwa_twojej_bazy$
# Workers for better performance (optional, for servers with >2GB RAM)
# workers = 4
# max_cron_threads = 2
# Security limits
limit_time_cpu = 600
limit_time_real = 1200
limit_memory_hard = 2684354560
limit_memory_soft = 2147483648
Note: The proxy_mode = True parameter is crucial! It allows Odoo to correctly detect the real client IP addresses and the HTTPS protocol through the X-Forwarded headers passed by Nginx. Without this setting, sessions may not work properly, and the IP addresses in the logs will show 127.0.0.1.
Restart Odoo (if you run Odoo as a systemd service):
sudo systemctl restart odoo
Check that Odoo started correctly:
sudo systemctl status odoo
Verifying the HTTPS/SSL configuration
Once the configuration is complete, check the following:
- HTTPS access - open https://twoja-domena.pl in your browser
- Padlock icon - it should be visible in the browser's address bar (green or gray, depending on the browser)
- HTTP→HTTPS redirect - trying to connect via http://twoja-domena.pl should automatically redirect to HTTPS
- SSL test - use tools such as:
- SSL Labs - full SSL/TLS configuration analysis (target: grade A or A+)
- Security Headers - security headers verification
- Longpolling - log in to Odoo and check that:
- Notifications appear in real time
- The Discuss app works without delays
- Shared record editing syncs instantly
- Performance test - check that load times have not worsened
- Mixed content - make sure all resources are loaded over HTTPS (check the browser console)
Additional security and optimization
HTTP/2 and HTTP/3 configuration
Modern versions of Nginx support HTTP/2 (already configured above) and HTTP/3 for better performance:
# Nginx 1.25+ with HTTP/3 support
listen 443 ssl http2;
listen 443 quic reuseport;
add_header Alt-Svc 'h3=":443"; ma=86400' always;
Enforcing strong ciphers
The configuration already includes recommended ciphers, but you can additionally add:
# Diffie-Hellman parameters for increased security
ssl_dhparam /etc/ssl/certs/dhparam.pem;
Generate the DH parameters:
sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 4096
Note: Generation takes 10-30 minutes depending on the server.
Content Security Policy (CSP)
For additional protection against XSS you can add a CSP, but it requires testing with Odoo:
# Test in report-only mode first!
add_header Content-Security-Policy-Report-Only "default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data: https:; font-src 'self' data:" always;
Rate limiting
Protection against brute-force attacks on the login:
# In the http section of /etc/nginx/nginx.conf
limit_req_zone $binary_remote_addr zone=odoo_login:10m rate=5r/m;
# In the server section for Odoo
location /web/login {
limit_req zone=odoo_login burst=5 nodelay;
proxy_pass http://odoo;
}
Automatic certificate renewal
Certbot configures renewal automatically. Check that it works:
sudo certbot renew --dry-run
Check the status of the systemd timer:
sudo systemctl status certbot.timer
You can also add a hook to reload Nginx after renewal:
sudo nano /etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh
Contents:
#!/bin/bash
systemctl reload nginx
Set the permissions:
sudo chmod +x /etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh
Configuration for special environments
Odoo in Docker/Podman
If you run Odoo in a container, the Nginx configuration stays the same, but make sure that:
- Ports 8069 and 8072 are mapped from the container:
-p 8069:8069 -p 8072:8072 - In docker-compose.yml, set
PROXY_MODE=trueas an environment variable - The container can communicate with the host (use
host.docker.internalor a bridge network)
Example for docker-compose:
services:
odoo:
image: odoo:17.0
environment:
- PROXY_MODE=true
ports:
- "127.0.0.1:8069:8069"
- "127.0.0.1:8072:8072"
volumes:
- ./config:/etc/odoo
- ./addons:/mnt/extra-addons
Multi-domain (multi-tenant) environments
If you host multiple Odoo databases for different customers on different domains:
- Create separate configuration files in
/etc/nginx/sites-available/for each domain - Use the
dbfilterparameter in odoo.conf so that each domain shows only its own database:# For the domain klient1.com, show only the klient1_db database dbfilter = ^%h$ - Repeat the certificate issuance process for each domain
- Consider using a wildcard certificate for subdomains (*.twoja-firma.pl)
Configuration behind CloudFlare
If you use CloudFlare as an additional CDN/firewall layer:
- Set the SSL mode to "Full (strict)" in CloudFlare
- Install an Origin certificate from CloudFlare or use Let's Encrypt
- Add the CF-Connecting-IP header to read the real IPs:
proxy_set_header X-Real-IP $http_cf_connecting_ip;
Troubleshooting
Problem: Odoo is not accessible over HTTPS
Check the Nginx logs:
sudo tail -f /var/log/nginx/error.log
Make sure Odoo is running on port 8069:
sudo netstat -tlnp | grep 8069
Check the firewall:
sudo ufw status
sudo ufw allow 443/tcp
Problem: Certificate error in the browser
Check that the certificate was installed correctly:
sudo certbot certificates
Check the expiration dates:
sudo openssl x509 -in /etc/letsencrypt/live/twoja-domena.pl/fullchain.pem -noout -dates
Test the certificate chain:
sudo openssl s_client -connect twoja-domena.pl:443 -servername twoja-domena.pl
Problem: Mixed content warnings
Make sure that:
- The
proxy_mode = Trueparameter is set in the Odoo configuration file - Odoo was restarted after the configuration change
- The
X-Forwarded-Protoheader is passed by Nginx - You have no hardcoded HTTP links in custom modules
Check in the Odoo logs whether proxy_mode is active:
sudo grep -i "proxy" /var/log/odoo/odoo-server.log
Problem: Sessions expire too quickly or do not work
In multi-tenant environments with HTTPS, check the session_db configuration:
# In odoo.conf
db_name = False # for multi-database
session_db = postgres_db_name # optionally a dedicated database for sessions
Problem: Longpolling does not work
Check that:
- Port 8072 is open and Odoo is listening on it:
sudo netstat -tlnp | grep 8072 - Nginx correctly passes the WebSocket headers (Upgrade, Connection)
- The longpolling timeout is long enough (720s)
- In Odoo 17, also check the /websocket endpoint
Problem: 502 Bad Gateway after restart
This usually means Odoo is not ready yet. Check the Odoo logs:
sudo journalctl -u odoo -f
You may need to increase the timeout in systemd:
sudo systemctl edit odoo
Add:
[Service]
TimeoutStartSec=300
Monitoring and maintenance
SSL certificate monitoring
Set up monitoring of the certificate expiration date:
#!/bin/bash
# /usr/local/bin/check-ssl.sh
DOMAIN="twoja-domena.pl"
EXPIRY=$(echo | openssl s_client -servername $DOMAIN -connect $DOMAIN:443 2>/dev/null | openssl x509 -noout -enddate | cut -d= -f2)
EXPIRY_EPOCH=$(date -d "$EXPIRY" +%s)
NOW_EPOCH=$(date +%s)
DAYS_LEFT=$(( ($EXPIRY_EPOCH - $NOW_EPOCH) / 86400 ))
if [ $DAYS_LEFT -lt 30 ]; then
echo "WARNING: The certificate expires in $DAYS_LEFT days!"
# You can add sending an email or a notification
fi
Regularly checking the logs
# SSL errors in Nginx
sudo grep -i ssl /var/log/nginx/error.log
# Proxy issues in Odoo
sudo grep -i proxy /var/log/odoo/odoo-server.log
Updating the SSL configuration
Regularly (every 6-12 months), check the recommendations of the Mozilla SSL Configuration Generator and update the encryption parameters in line with current security standards.
Configuration for multi-domain environments
If you host multiple Odoo databases on different domains, you can set up separate certificates for each of them. Create separate configuration files in /etc/nginx/sites-available/ for each domain and repeat the certificate issuance process for each one.
Alternatively, for multiple subdomains of the same domain, you can use a wildcard certificate:
sudo certbot certonly --manual --preferred-challenges=dns -d *.twoja-domena.pl -d twoja-domena.pl
You will need to add a TXT record in DNS for verification.
FAQ - Frequently asked questions
Can I use Odoo without HTTPS?
Technically yes, but it is highly discouraged and poses a serious security risk. Odoo processes sensitive business data, including user passwords, financial data, customer and vendor information, accounting documents and potentially personal data subject to GDPR. Without HTTPS, all of this data is transmitted unencrypted (in plain text), which means that:
- Anyone on the same network (e.g. public WiFi) can intercept the data
- Attackers can carry out a man-in-the-middle attack and modify data on the fly
- Passwords are visible to network administrators and potential eavesdroppers
- You are likely violating GDPR and other data protection regulations
- Modern browsers warn users about HTTP sites, especially on login forms
- Some browser features (geolocation, notifications, PWA) require HTTPS
In a production environment, HTTPS is an absolute requirement. The only exception is a local development environment isolated from the internet.
How often do I need to renew a Let's Encrypt certificate?
Let's Encrypt certificates are valid for 90 days. This is a deliberate design decision intended to force automation. Fortunately, Certbot automatically sets up a systemd timer job (or cron on older systems) that renews certificates 30 days before they expire, giving you a double safety margin. You therefore do not need to remember to renew manually.
Checking automatic renewal:
sudo certbot renew --dry-run
sudo systemctl status certbot.timer
sudo systemctl list-timers | grep certbot
Certbot tries to renew the certificate twice a day, but actual renewal happens only when the certificate has less than 30 days of validity left. The process is completely transparent and causes no downtime.
You can check the renewal history in the logs:
sudo cat /var/log/letsencrypt/letsencrypt.log
Does SSL configuration affect Odoo performance?
The impact of SSL/TLS encryption on performance is minimal on modern server hardware. Modern processors include AES-NI instructions, which significantly speed up cryptographic operations. In practice:
- Initial latency (handshake): 1-2 ms for TLS 1.3, 2-4 ms for TLS 1.2
- CPU overhead: 1-5% in typical scenarios
- Throughput: practically no impact on modern hardware
Moreover, configuring a reverse proxy (Nginx) with SSL can actually improve performance through:
- Gzip compression - reduces the amount of transferred data by 60-80%
- Static asset caching - CSS/JS/image files are served directly by Nginx without involving Odoo
- HTTP/2 - connection multiplexing reduces latency
- Connection pooling - Nginx efficiently manages connections to the backend
- SSL session reuse - reduces overhead for returning users
In practice, a properly configured Nginx with HTTPS often delivers better performance than Odoo running directly over HTTP, especially for many concurrent users.
For very high-load installations, you can further optimize performance by:
- Using a CDN (CloudFlare, AWS CloudFront) for static assets
- Enabling OCSP stapling (
ssl_stapling on;) - Configuring the SSL session cache (
ssl_session_cache shared:SSL:10m;) - Using dedicated SSL offloading hardware (only for very large installations)
Can I use the same certificate for multiple subdomains?
Yes, you have two options:
- Multi-domain (SAN) certificate - you list all the domains:
certbot --nginx -d domena1.pl -d domena2.pl -d subdomena.domena1.pl - Wildcard certificate - covers all subdomains:
certbot certonly --manual --preferred-challenges=dns -d *.twoja-domena.pl(requires DNS verification)
What should I do if the certificate has expired?
If the certificate has expired (which should not happen with working automatic renewal):
sudo certbot renew --force-renewal
sudo systemctl reload nginx
Check why automatic renewal did not work:
sudo journalctl -u certbot.timer
sudo cat /var/log/letsencrypt/letsencrypt.log
Summary
Configuring HTTPS/SSL for Odoo is a key element of a secure ERP deployment. Thanks to free Let's Encrypt certificates and the automated Certbot tool, the process is simple, costs nothing and takes about 15-30 minutes. Combining Nginx as a reverse proxy with an SSL certificate delivers not only security, but also better performance, scalability and compliance with security best practices.
Key takeaways:
- HTTPS is a requirement, not an option, for production environments
- Let's Encrypt offers free certificates with automatic renewal
- Nginx as a reverse proxy improves both security and performance
- The
proxy_mode = Trueparameter in odoo.conf is critical for correct operation - Regular monitoring and updates of the SSL configuration are essential
- SSL configuration has practically no impact on performance on modern hardware
Remember to regularly check system logs, monitor certificate expiration dates (even though renewal is automatic), test configuration backups and update security parameters in line with current industry recommendations. Security is an ongoing process, and HTTPS/SSL is just one of many elements of a comprehensive data protection strategy in Odoo.
After configuring HTTPS, it is also worth considering additional security layers, such as:
- Web application firewall (WAF) - e.g. ModSecurity with the OWASP Core Rule Set
- Fail2ban for brute-force protection
- Regular security audits and penetration tests
- Two-factor authentication (2FA) for Odoo users
- Regular backups of configuration and certificates
Need help configuring HTTPS/SSL for Odoo? KK Innovations specializes in implementing and optimizing Odoo systems. Our team of experts will ensure the security, performance and reliability of your ERP environment in line with best practices and the latest industry standards. Contact us to discuss your needs and get professional support in securing your Odoo system!