Skip to Content

odoo 17 Installation on Ubuntu 22.04 LTS Tutorial

Introduction:

Excited about exploring the latest features of #odoo 17? Look no further! In this comprehensive tutorial, we'll guide you through the step-by-step process of installing Odoo 17 on Ubuntu 22.04 LTS, specifically tailored for deployment on AWS EC2 instances. Whether you're a seasoned Odoo user or just getting started with this powerful ERP system, our tutorial provides clear instructions to help you set up Odoo 17 seamlessly on your AWS EC2 instance running Ubuntu 22.04 LTS. Learn how to effortlessly install Odoo 17 on Ubuntu 22.04 LTS with our simple step-by-step guide. Setting up the latest Odoo on Ubuntu has never been easier! Follow along with our tutorial to configure Odoo in Ubuntu quickly and efficiently.

Checkout our video tutorial how to setup odoo on link below.

Looking for Odoo hosting, checkout our offerings.


How to install Odoo 17 on Ubuntu 22 - Pyv- 3.10


Update the server
sudo apt-get update -y
sudo apt-get upgrade -y


Secure Server: For configuration checkout our blog.:
sudo apt-get install  fail2ban -y


Install Packages and libraries

sudo apt-get install -y python3-pip -y

sudo apt-get install 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 -y

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

sudo apt-get install xvfb -y

   

Setup Database Server
sudo apt-get install postgresql -y
sudo su - postgres
createuser --createdb --username postgres --no-createrole
--no-superuser --pwprompt odoo

The user and the password are needed for the conf file. Postgres uses a distinct system user to perform tasks. To switch between users, run sudo su -postgres

psql
ALTER USER odoo WITH SUPERUSER;

If the user runs the aforementioned command, superuser access rights will be guaranteed. Next, log out of Postgres and PSQL.

\q
exit


Create a system user
sudo adduser --system --home=/opt/odoo --group odoo


Install Gitsudo apt-get install git


Switch User:  sudo su - odoo -s /bin/bash


Git Clone : git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 --single-branch .

exit


Install Required Python Packages
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade setuptools
sudo pip3 install wheel setuptools pip --upgrade
pip3 install wheel setuptools pip --upgrade
sudo python3.10 -m pip3 install -r /opt/odoo/requirements.txt

or

sudo pip3 install -r /opt/odoo/requirements.txt


Install Wkhtmltopdf

echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list

sudo apt update

sudo apt-get install libssl1.1

sudo apt install xfonts-75dpi xfonts-base

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-get install -y ~/wkhtmltox-0.12.1_linux-trusty-amd64.deb

sudo apt install -f
   


Setup Conf file in /etc​ directory with odoo17 user permission
sudo cp /opt/odoo/debian/odoo.conf /etc/odoo.conf
sudo nano /etc/odoo.conf

Conf file content:

[options]
   ; This is the password that allows database operations:
   admin_passwd = DemoPassword
   db_host = 127.0.0.1
   db_port = 5432
   db_user = odoo
   db_password = odoo17
   addons_path = /opt/odoo/addons
   logfile = /var/log/odoo/odoo.log
   logrotate = True
   limit_time_cpu = 120
   limit_time_real = 200
   proxy_mode = True
   max_cron_threads = 1
   workers = 2
   db_maxconn = 30
   list_db = False
   xmlrpc_interface = 127.0.0.1
   netrpc_interface = 127.0.0.1
   



Setup permission of config and log files


sudo chown odoo: /etc/odoo.conf
sudo chmod 640 /etc/odoo.conf
sudo mkdir /var/log/odoo
sudo chown odoo:root /var/log/odoo


Odoo service file in two ways. Which one you chose.
1. sudo nano /etc/systemd/system/odoo.service

[Unit]
   Description=Odoo
[Service]
   # Ubuntu/Debian convention:
   Type=simple
   User=odoo
   ExecStart=/opt/odoo/odoo-bin -c /etc/odoo.conf
[Install]
   WantedBy=default.target
   



Change ownership and permission of odoo-server.service

sudo chmod 755 /etc/systemd/system/odoo-server.service
sudo chown root: /etc/systemd/system/odoo-server.service
sudo systemctl enable odoo-server.service


2. sudo vim /etc/init.d/odoo-server

#!/bin/bash
### BEGIN INIT INFO WRITTEN BY RAM KRISHNA
# Provides:          odoo-bin
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start odoo daemon at boot time
# Description:       Enable service provided by daemon.
# X-Interactive:     true
### END INIT INFO
## more info: http://wiki.debian.org/LSBInitScripts
. /lib/lsb/init-functions
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DAEMON=/opt/odoo/odoo-bin
NAME=odoo-server
DESC=odoo-server
CONFIG=/etc/odoo-server.conf
LOGFILE=/var/log/odoo/odoo-server.log
PIDFILE=/var/run/${NAME}.pid
USER=odoo
export LOGNAME=$USER
test -x $DAEMON || exit 0
set -e

function _start() {
    start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$USER --background --make-pidfile --exec $DAEMON -- --config $CONFIG 
--logfile $LOGFILE --db-filter ^%d$
}

function _stop() {
    start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo --retry 3
    rm -f $PIDFILE
}

function _status() {
    start-stop-daemon --status --quiet --pidfile $PIDFILE
    return $?
}

case "$1" in
        start)
                echo -n "Starting $DESC: "
                _start
                echo "ok"
                ;;
        stop)
                echo -n "Stopping $DESC: "
                _stop
                echo "ok"
                ;;
        restart|force-reload)
                echo -n "Restarting $DESC: "
                _stop
                sleep 1
                _start
                echo "ok"
                ;;
        status)
                echo -n "Status of $DESC: "
                _status && echo "running" || echo "stopped"
                ;;
        *)
                N=/etc/init.d/$NAME
                echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
                exit 1
                ;;
esac
exit 0
    


Change ownership and permission of odoo-server


sudo chmod 755 /etc/init.d/odoo-serversudo chown root:root /etc/init.d/odoo-server
sudo update-rc.d odoo-server defaults

Verify Permission of odoo-bin
sudo chown -R odoo:odoo /opt/odoo​ 
sudo chmod 755 /opt/odoo/odoo-bin​ 


It's time to start the Odoo server and , run Odoo17


sudo service odoo-server start
or 
sudo systemctl start odoo-server.service
sudo systemctl status odoo-server.service
or
sudo service odoo-server status


"http://<your_domain_or_IP_address>:8069"


Check Odoo logs
tail -f /var/log/odoo/odoo.log

Hope you find this helpful !!! Do comment in case you face any issue while odoo setup...

Thanks :)

For consultations, please email support@bithost.in.

Odoo System requirements