How to install Odoo 17 on OpenPanel server

How to install Odoo 17 on OpenPanel server

Since OpenPanel offers a VPS-like enviroment to each user, user with sudo access can install Odoo 17.

NOTE: in these examples, OpenPanel username is stefan, postgres user is stefan, postgres password is stefan and domain is: stefi.openpanel.site – change those as needed.


Login as root

If you are an OpenAdmin user, then login to server SSH and run this command to gain root for that user:

opencli user-login stefan

If you want to allow OpenPanel user to install Odoo themselves, then you need to grant them sudo access:

opencli user-sudo stefan --enable

now the user stefan can login via ssh, run the command su - and fill in their password to become root.


Install Wkhtmltopdf:

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb

chmod -R 777 wkhtmltox_0.12.5-1.bionic_amd64.deb

dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb

apt install -f -y

Install NPM

   apt-get install  -y npm
   npm install -g less less-plugin-clean-css
   apt-get install -y node-less

Install PostgreSQL and create User

Install postgres and set the user and db:

apt-get install -y postgresql

service postgresql start

su - postgres

createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt stefan

psql

ALTER USER stefan WITH SUPERUSER;
\q
exit

Git clone Odoo 17

Switch to the user and clone files from github:

su stefan

git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 --single-branch /home/stefan/stefi.openpanel.site/

exit

PIP install requirements

Install PIP and other required system packages:

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

For Ubuntu24 docker images and python version 3.11+ we need to edit requirements.txt file and comment this line:

cryptography==42.0.8 ; python_version >= '3.12' # (Noble) min 41.0.7, pinning 42.0.8 for security fixes

Then run pip install:

pip install -r requirements.txt --break-system-packages

--break-system-packages flag is needed for Ubuntu24


Edit odoo.conf

Edit the conf file and set the stefan username and set password from step 4. – in this example password is also stefan

nano /home/stefan/stefi.openpanel.site/debian/odoo.conf
   
   [options]
   db_host = localhost
   db_port = False
   db_user = stefan
   db_password = stefan
   default_productivity_apps = True
   addons_path = /home/stefan/stefi.openpanel.site/addons
   logfile = /var/log/odoo17.log
   admin_passwd = stefan

Create Python application from OpenPanel

Using OpenPanel interface create a new python application as instructed in the docs: https://openpanel.co/docs/panel/applications/pm2#example-python-application


In this example we set:

  • Application URL: stefi.openpanel.site
  • Application startup file: /home/stefan/stefi.openpanel.site/odoo-bin
  • Type Python
  • Port 8069
  • Watch leave enabled
  • Enable Logs leave enabled

 

This will edit the apache conf file and create a proxy for stefi.openpanel.site to port 8069. One modification is needed in the file for Odoo to work:


Edit Apache Vhost file

Edit Apache vhost file from terminal: nano /etc/apache2/sites-available/stefi.openpanel.site.conf and move lines:

# ProxyPass / http://localhost:8069/
# ProxyPassReverse / http://localhost:8069/

to be above the line <Directory /home/stefan/stefi.openpanel.site>

Before:

<Directory /home/rasa/stefi.openpanel.site>

ProxyPass / http://localhost:8069/
            ProxyPassReverse / http://localhost:8069/

After:

ProxyPass / http://localhost:8069/

ProxyPassReverse / http://localhost:8069/

<Directory /home/stefan/stefi.openpanel.site>

This is mentioned 2x in the file, so edit both! and restart apache: service apache2 restart


Edit the PM2 app to include odoo.conf

Delete created pm2 applicaiton from terminal, so that we can add the flag -c /home/rasa/stefi.openpanel.site/debian/odoo.conf

pm2 stop 0 && pm2 delete 0

pm2 start /home/stefan/stefi.openpanel.site/odoo-bin --name Odoo --interpreter python3 -- -c /home/stefan/stefi.openpanel.site/debian/odoo.conf

Open browser and Install

Open the browser and navigate to http://stefi.openpanel.site then fill in the install form and install.


If there are any errors, stop the application with pm2 stop 0 and run manually

/home/stefan/stefi.openpanel.site/odoo-bin -c /home/stefan/stefi.openpanel.site/debian/odoo.conf

so that you can view the logs while you fill the install form:

image 6 1024x263 - How to install Odoo 17 on OpenPanel server

That’s it! Odoo17 is successfully installed and available on http://stefi.openpanel.site

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.