Zalino Logo white

How to Install Odoo 17 on Linux/Ubuntu Server Using Virtual Environment

Odoo POS Image with Monitor
How to Install Odoo 17 on Linux/Ubuntu Server Using Virtual Environment

Here’s a step-by-step guide to install Odoo 17 on Ubuntu

Step 1: Update Ubuntu System

sudo apt update && sudo apt upgrade -y

    
Step 2: Install Dependencies

sudo apt install python3-pip python3-dev libxml2-dev libxslt1-dev libevent-dev libsasl2-dev libldap2-dev build-essential libjpeg-dev libpq-dev libffi-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev libssl-dev libz-dev libldap2-dev libpng-dev libeigen3-dev libpq5 libxml2-dev libxslt-dev zlib1g-dev g++ wget node-less node-clean-css -y

    
Step 3: Install PostgreSQL

sudo apt install postgresql -y
sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo17
exit

    
Step 4: Install and Configure Odoo Dependencies (Node.js and Wkhtmltopdf)

sudo npm install -g less less-plugin-clean-css

sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb

sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb

    
Step 5: Install Odoo 17 : Download Odoo from the source (or clone the GitHub repository):

sudo wget https://nightly.odoo.com/17.0/nightly/src/odoo_17.0.latest.tar.gz
sudo tar -xzf odoo_17.0.latest.tar.gz -C /opt/
sudo mv /opt/odoo-17.0 /opt/odoo17

    
Step 5-A: Create a Python Virtual Environment and install required Python libraries:

sudo apt install python3-venv
cd /opt/odoo17
python3 -m venv odoo-venv
source odoo-venv/bin/activate
pip install -r requirements.txt

    
Step 6: Configure Odoo (Create a configuration file for Odoo):

sudo cp /opt/odoo17/debian/odoo.conf /etc/odoo.conf
sudo nano /etc/odoo.conf

    
Step 6-A: Configure Odoo (In the configuration file, set the following):

[options]
   admin_passwd = 12345
   db_host = False
   db_port = False
   db_user = odoo17
   db_password = your_postgres_password
   addons_path = /opt/odoo17/addons
   logfile = /var/log/odoo/odoo.log

    
Step 6-B: Configure Odoo (Set proper file permissions):

sudo chown -R odoo: /opt/odoo17/
sudo chmod -R 755 /opt/odoo17/

    
Step 7: Create a Systemd Service File
1. Create a service file for Odoo to run as a system service:

sudo nano /etc/systemd/system/odoo17.service

    
Add the following content:

[Unit]
Description=Odoo
Documentation=http://www.odoo.com
[Service]
# Ubuntu user running Odoo
User=odoo
Group=odoo
ExecStart=/opt/odoo17/odoo-bin --config=/etc/odoo.conf
[Install]
WantedBy=multi-user.target

    
2. Enable and start the Odoo service:

sudo systemctl enable odoo17
sudo systemctl start odoo17

    
Step 8: Access Odoo 17
Open your browser and navigate to http://localhost:8069.
If you are using a remote server, replace localhost with your server's IP address.
Optional: Nginx as a Reverse Proxy
If you want to serve Odoo behind a domain name, you can install and configure Nginx as a reverse proxy.

2 Responses

Leave a Reply

Your email address will not be published. Required fields are marked *