How to Install Odoo 16 on Ubuntu 20.04 LTS?
"Discover a step-by-step guide on installing Odoo 16, one of the most popular open-source ERP and CRM software suites, on Ubuntu 20.04 LTS. Whether you're a business owner looking to enhance your company's operational efficiency or an IT professional tasked with deploying Odoo, this comprehensive walkthrough is tailored for you. From setting up the necessary system dependencies to the final configuration tweaks, this blog offers a streamlined process to get your Odoo instance up and running seamlessly."
Step 1: Log in to the Ubuntu server via SSH
The first step is to connect to your server via ssh. You can simply enter into the server using ssh:
ssh username@IP_Address -p Port_number e.g. ssh root@127.0.0.1 -p 22 |
Step 2: Update your system
Then log in to your server and make sure the server is up-to-date.
sudo apt-get update && sudo apt-get upgrade -y |
Step 3: Secure your server.
Make sure the system is protected against ssh assaults; using Fail2ban will aid in ssh attack prevention.
sudo apt-get install openssh-server fail2ban |
Step 4: Create a system user
Next, let's create a system user for security and to fulfill Odoo roles.
This user will only have limited access to certain files and locations within Odoo.
After that, we'll restrict this user's access to all files and directories linked to Odoo.
sudo adduser --system --home=/opt/odoo16 --group odoo16 |
Step 5: Installing Packages and libraries
Install the necessary Odoo Python packages:
Install pip3:
sudo apt-get install -y python3-pip |
Install Packages and libraries:
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 |
Install Web web dependencies:
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: 6: Install and configure Postgresql
PostgreSQL serves as the database server for Odoo. To install and configure the database server for Odoo, follow these steps:
sudo apt-get install PostgreSQL |
Create a Postgres user to manage the database in the following step. Later, the conf file requires the user and the provided password.
To carry out the tasks, Postgres utilizes a separate system user named "Postgres." So the following command will change the Postgres user:
sudo su - postgres |
Do the following to create the user Odoo16.
Additionally, you must change the password for the user Odoo16 at that time. You must enter the new password in the Odoo configuration file at the very end of the installation process.
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo16 |
The user must then be designated as a superuser in order to receive further privileges.
psql ALTER USER odoo16 WITH SUPERUSER; |
\q exit |
sudo apt-get install git |
sudo su - odoo16 -s /bin/bash |
git clone https://www.github.com/odoo/odoo --depth 1 --branch 16.0 --single-branch . |
exit |
sudo pip3 install -r /opt/odoo16/requirements.txt |
Install Wkhtmltopdf
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 |
sudo cp /opt/odoo16/debian/odoo.conf /etc/odoo16.conf |
sudo nano /etc/odoo16.conf |
[options] ; This is the password that allows database operations: admin_passwd = admin db_host = False db_port = False db_user = odoo16 db_password = False addons_path = /opt/odoo16/addons logfile = /var/log/odoo/odoo16.log |
sudo chown odoo16: /etc/odoo16.conf sudo chmod 640 /etc/odoo16.conf |
sudo mkdir /var/log/odoo sudo chown odoo16:root /var/log/odoo |
sudo nano /etc/systemd/system/odoo16.service |
[Unit] Description=Odoo16 Documentation=http://www.odoo.com [Service] # Ubuntu/Debian convention: Type=simple User=odoo16 ExecStart=/opt/odoo16/odoo-bin -c /etc/odoo16.conf [Install] WantedBy=default.target |
sudo chmod 755 /etc/systemd/system/odoo16.service sudo chown root: /etc/systemd/system/odoo16.service |
sudo systemctl start odoo16.service |
sudo systemctl status odoo16.service |
"http://<your_domain_or_IP_address>:8069" |
sudo tail -f /var/log/odoo/odoo.log |
sudo systemctl enable odoo16.service |
sudo systemctl restart odoo16.service |