How to Install Odoo 17 on Ubuntu 20.04 LTS Server

Odoo 17 is packed with performance enhancements, an improved user interface, and new functionality. It requires PostgreSQL and Python 3.10 for its database management system. In this guide, we’ll walk you through the step-by-step process of installing Odoo 17 on an Ubuntu 20.04 LTS server.
Step 1: Login to the Ubuntu server via SSH
ssh username@IP_Address -p Port_number
Connect to your server via SSH.
Step 2: Update Server
sudo apt-get update
sudo apt-get upgrade
Ensure your system is up to date.
Step 3: Secure Server
sudo apt-get install openssh-server fail2ban
Use Fail2ban to prevent SSH attacks.
Step 4: Install Packages and Libraries
Install the necessary Python packages for Odoo and set up pip3.
sudo apt-get install -y python3-pip
sudo apt-get install python-dev python3-dev libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev build-essential libssl-dev libffi-dev libmysqlclient-dev libjpeg-dev libpq-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev
sudo apt-get install -y npm
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo npm install -g less less-plugin-clean-css
sudo apt-get install -y node-less
Step 5: Setup Database Server
Install PostgreSQL as the database server for Odoo.
sudo apt-get install postgresql
sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo17
psql
ALTER USER odoo17 WITH SUPERUSER;
\q
exit
Step 6: Create a System User
sudo adduser --system --home=/opt/odoo17 --group odoo17
Create a system user to handle Odoo operations securely.
Step 7: Get Odoo 17 Community from Git
Install git and clone the Odoo source file.
sudo apt-get install git
sudo su - odoo17 -s /bin/bash
git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 --single-branch .
exit
Step 8: Install Required Python Packages
sudo pip3 install -r /opt/odoo/requirements.txt
Step 9: Install Wkhtmltopdf
Wkhtmltopdf helps generate PDF reports from HTML.
sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo apt install -f
Step 10: Setup Configuration File
Create an Odoo configuration file and update it with necessary information.
sudo cp /opt/odoo17/debian/odoo.conf /etc/odoo17.conf
sudo nano /etc/odoo17.conf
Update the conf file:
[options]
admin_passwd = admin
db_host = False
db_port = False
db_user = odoo17
db_password = False
addons_path = /opt/odoo17/addons
logfile = /var/log/odoo/odoo17.log
Set appropriate permissions:
sudo chown odoo17: /etc/odoo17.conf
sudo chmod 640 /etc/odoo17.conf
sudo mkdir /var/log/odoo
sudo chown odoo17:root /var/log/odoo
Step 11: Create Odoo Service File
Create a service file to run Odoo.
sudo nano /etc/systemd/system/odoo17.service
Add the following:
[Unit]
Description=Odoo17
Documentation=http://www.odoo.com
[Service]
Type=simple
User=odoo17
ExecStart=/opt/odoo17/odoo-bin -c /etc/odoo17.conf
[Install]
WantedBy=default.target
Set permissions:
sudo chmod 755 /etc/systemd/system/odoo17.service
sudo chown root: /etc/systemd/system/odoo17.service
Step 12: Run Odoo 17
Start the Odoo service and check its status.
sudo systemctl start odoo17.service
sudo systemctl status odoo17.service
Access Odoo at:
http://<your_domain_or_IP_address>:8069
Enable the service to start on boot:
sudo systemctl enable odoo17.service
Restart the service after making changes:
sudo systemctl restart odoo17.service
Check Odoo logs:
sudo tail -f /var/log/odoo/odoo.log
By following these steps, you can successfully install Odoo 17 on your Ubuntu 20.04 LTS server. For further assistance or customization needs, feel free to contact us at PlanUp Solutions. We also offer expert services in Odoo CRM and Odoo hosting and installation.
Feel free to reach out anytime at info@planupsolution.com or on WhatsApp: +91 9875021819.