https://www.centlinux.com/2023/03/how-to-install-odoo-16-on-rocky-linux-9.html
================================ How to install Odoo 16 on Rocky Linux 9 ========================
1. Environment Specification:
specifications.
CPU – 3.4 Ghz (2 cores)
Memory – 2 GB
Storage – 20 GB
Operating System – Rocky Linux release 9.1 (Blue Onyx)
Hostname – odoo-01.centlinux.com
IP Address – 192.168.88.128/24
2. Preparing your Rocky Linux Server:
hostnamectl set-hostname odoo-01.com
echo “192.168.199.107 odoo-01 odoo-01.com” >> /etc/hosts
dnf update -y
–> Configure Linux Firewall:
# firewall-cmd –permanent –add-port=8069/tcp && firewall-cmd –reload
reboot
uname -r
python -V
3. Installing Odoo Prerequsites:
# dnf install -y wget tar gcc git libpq-devel python-devel openldap-devel
4. Installing PostgreSQL:
# dnf install -y postgresql-server
# postgresql-setup –initdb –unit postgresql
# systemctl enable –now postgresql
# su – postgres -c “createuser -s odoo”
5. Installing WKHTMLTOX:
cd /tmp
# w!get https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox-0.12.6.1-2.almalinux9.x86_64.rpm
# dnf localinstall -y wkhtmltox-0.12.6.1-2.almalinux9.x86_64.rpm
6. Installing Odoo ERP:
# git clone https://www.github.com/odoo/odoo \
–depth 1 \
–branch 16.0 \
/opt/odoo/odoo
# useradd -r -m -U -s /bin/bash -d /opt/odoo odoo
# sudo passwd odoo
# su – odoo
$ cd ~
$ python -m venv venv
$ source venv/bin/activate
$ pip install –upgrade pip
$ pip install -r /opt/odoo/odoo/requirements.txt
$ deactivate
6. Post Installation Configuration:
$ mkdir /opt/odoo/odoo-custom-addons
$ exit
mkdir /var/log/odoo
touch /var/log/odoo/odoo.log
chown -R odoo: /var/log/odoo/
# vi /etc/odoo.conf
[options]
; This is the password that allows database operations:
admin_passwd = zareef@123
db_host = False
db_port = False
db_user = odoo
db_password = False
xmlrpc_port = 8069
logfile = /var/log/odoo/odoo.log
logrotate = True
addons_path = /opt/odoo/odoo/addons,/opt/odoo/odoo-custom-addons
7. Create a Systemd Service Unit:
# vi /etc/systemd/system/odoo.service
[Unit]
Description=Odoo
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/venv/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
# systemctl enable –now odoo.service