Odoo 16 Enterprise introduced a new pricing model, with all apps included, and only charges per user. This guide will help you install Odoo16 Community Edition on your Debian 10/11 server. All commands assume you are running from a user account (not root), with sudo permissions.
I’ve provided the instructions for installation below. If you’d rather use a script that I’ve created to automate the installation, I’ve created a separate guide to cover the automated install process.
Note: Revisions have been made to this post, notated in the comments at the end.
1: Update your system
Before installing, ensure your system is up to date. This will avoid any packages being out of sync/incompatible. As always, it is preferred to have a fresh system with no other software installed. Reboot after updating to ensure everything is running current code.
$ sudo apt update
$ sudo apt upgrade -y
$ sudo reboot
2: Install wkhtmltopdf
In order to generate PDFs or print reports, you will need to install wkhtmltopdf. I’ve covered the installation on Debian 11 here: Install wkhtmltopdf on Debian
3: Install Odoo 16
Import Odoo’s repository key:
$ sudo apt update
$ sudo apt install gnupg2
$ wget https://nightly.odoo.com/odoo.key
$ cat odoo.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/odoo.gpg >/dev/null
Add Odoo’s repository:
$ echo "deb http://nightly.odoo.com/16.0/nightly/deb/ ./" | sudo tee /etc/apt/sources.list.d/odoo.list
Update apt cache:
$ sudo apt update
Install Odoo 16:
$ sudo apt install odoo
4: Set Odoo to start on boot
When installation completes, the Odoo service will be started for you. It will not start automatically after you reboot. To set it to automatically start, run the following command:
$ sudo systemctl enable --now odoo
5: Configure Nginx with LetsEncrypt SSL certificate
It is possible to use Nginx without SSL, but I do not recommend it, and will not be covering it in this article.
#Debian 11
sudo apt update
sudo apt install certbot python3-certbot-nginx
#Debian 10
sudo apt update
sudo apt install certbot python-certbot-nginx
#stop Nginx
sudo systemctl stop nginx
#Generate SSL certificates
export DOMAIN="odoo.robfauls.com"
export EMAIL="rockinit@robfauls.com"
sudo /usr/bin/certbot certonly --standalone -d ${DOMAIN} --preferred-challenges http --agree-tos -n -m ${EMAIL} --keep-until-expiring
Set up cron job for certificate renewal:
$ sudo crontab -e
15 3 * * * /usr/bin/certbot renew --pre-hook "systemctl stop nginx" --post-hook "systemctl start nginx"
Create Nginx configuration file.
$ sudo nano /etc/nginx/conf.d/odoo.conf
Paste the following into odoo.conf:
#odoo server
upstream odoo {
server 127.0.0.1:8069;
}
upstream odoochat {
server 127.0.0.1:8072;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# http -> https
server {
listen 80;
server_name odoo.robfauls.com;
rewrite ^(.*) https://$host$1 permanent;
}
server {
listen 443 ssl;
server_name odoo.robfauls.com;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
# Add Headers for odoo proxy mode
proxy_set_header X-Forwarded-Host $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;
# SSL parameters
ssl_certificate /etc/letsencrypt/live/odoo.robfauls.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/odoo.robfauls.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/odoo.robfauls.com/chain.pem;
ssl_session_timeout 30m;
ssl_protocols TLSv1.2;
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_prefer_server_ciphers off;
# log
access_log /var/log/nginx/odoo.access.log;
error_log /var/log/nginx/odoo.error.log;
# Redirect websocket requests to odoo gevent port
location /websocket {
proxy_pass http://odoochat;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-Host $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;
}
# Redirect requests to odoo backend server
location / {
proxy_redirect off;
proxy_pass http://odoo;
}
# common gzip
gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;
gzip on;
}
Double check that the Nginx configuration is in a healthy state:
$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
Restart Nginx:
$ sudo systemctl restart nginx
7: Configure Odoo to work with Nginx proxy
Edit odoo.conf:
$ sudo nano /etc/odoo/odoo.conf
Insert the following line:
proxy_mode = True
Restart odoo:
$ sudo systemctl restart odoo
8: Access Odoo and configure it
9: All done! (for now)
Now that you’ve completed the initial installation of Odoo 16, it’s time to begin configuring everything. There are a number of tweaks you’ll want to perform in order to get things working the way you’d expect. Please check Odoo – Overview for more information and additional guides. A few of my “top annoyances” have been covered, and I’ll include more as I’m able to dedicate some time to this documentation.
7 Comments
This is great, keep it up! Really helped me and good to see someone working on Odoo tutorials!!
Thanks, Jake! I put up a reddit post asking for what things people would like to see and need to follow up on that thread with some articles. Is there anything you’d like to know more about, Odoo or otherwise?
I noticed an issue with the dicuss/chat application not working with a previous version of this document (and the auto-installer). I’ve updated the instructions and the script to include the fix. If you’d like to see the history, you may review the history of the auto-installer script here: https://code.sparkedhosting.com/rob/robfauls.com-scripts/-/commits/main/Odoo/Install-Odoo16-Debian11-Basic.sh
Hello, I’ve just finished the tutorial’s test instance. Nice and simple. nothing similar to anything I have previously discovered. Well done! I am currently attempting to troubleshoot the error I receive when attempting to access Odoo’s settings.
“`
Error: Missing field string information for the field ‘module_stock_landed_costs’ from the ‘res.config.settings’ model
at https://some.domain.xyz/web/assets/541-dcda3e2/web.assets_backend.min.js:6614:258
at traverse (https://some.domain.xyz/web/assets/541-dcda3e2/web.assets_backend.min.js:6609:200)
at https://some.domain.xyz/web/assets/541-dcda3e2/web.assets_backend.min.js:6609:242
at _.each._.forEach (https://some.domain.xyz/web/assets/540-bc09ad5/web.assets_common.min.js:63:404)
at traverse (https://some.domain.xyz/web/assets/541-dcda3e2/web.assets_backend.min.js:6609:211)
at https://some.domain.xyz/web/assets/541-dcda3e2/web.assets_backend.min.js:6609:242
at _.each._.forEach (https://some.domain.xyz/web/assets/540-bc09ad5/web.assets_common.min.js:63:404)
at traverse (https://some.domain.xyz/web/assets/541-dcda3e2/web.assets_backend.min.js:6609:211)
at https://some.domain.xyz/web/assets/541-dcda3e2/web.assets_backend.min.js:6609:242
at _.each._.forEach (https://some.domain.xyz/web/assets/540-bc09ad5/web.assets_common.min.js:63:404)
“`
I am guessing it is some miss-configuration in the nginx config file. Could someone assist?
Hi Hans,
This is going to be an Odoo error. Can you try regenerating assets? To regenerate assets, please do the following:
1) Add “debug=1” to the end of your base URL: https://odoo.robfauls.com/web?debug=1
2) In the top-right, you will see a debug icon appear. Click it, then select “Regenerate Assets Bundles” near the bottom.
3) Check to see if you’re able to access the settings page now.
As we’re using the nightly branch of Odoo, we are quite literally testing the product for Odoo. It’s our contribution to the community. That said, since you presumably haven’t done much setup and they may have released an update since you installed, you could check to see if there’s a new release that may or may not have fixed whatever is causing your issue.
To check if there’s an update available, please do the following:
1) Run: “apt update”
2) Run: “apt list –upgradeable”
3) Check for this line: “odoo/unknown 16.0.20230404 all [upgradable from: 16.0.20230221]”
This is will show the release version for Odoo, which is noted by the date of the release. If there has not been a release since you last installed/updated, then you won’t see this line.
As always, if you need more help, just holler!
In step five I got this error, and I could not continue:
Problem binding to port 80: Could not bind to IPv4 or IPv6.
Hi Lorenzo,
This message indicates that you have another service already running on port 80 and the system is not able to bind to port 80.