Prerequisites
OS: Ubuntu 20.x (e.g. 20.04)
Resources: 2-core CPU & 2GB of RAM
Access: SSH connection to the server
Permissions: a user with ‘sudo’ privileges
Note: you can execute all of the commands below from the root user, but for security purposes, it is recommended that you use a separate user with sudo privileges.
Step 1: Connect to the Server.
In order to perform any commands on your remote server, you will need to connect to it using the SSH protocol.
Step 2: Set-up Additional Repositories
Odoo 13 depends on a lot of packages. Some are not available in the official Ubuntu repository, which is why we need to add other repositories to the package manager:
sudo add-apt-repository universe
sudo add-apt-repository ppa:deadsnakes/ppa
Note: you will have to press Enter again to confirm the action.
Step 3: Update the System
Update the list of available Ubuntu packages:
sudo apt-get update
Download and install the new version of existing packages:
sudo apt-get upgrade -y
Step 4: Create a Separate User for Odoo 13
To limit the things Odoo 13 can do within your system, let’s create a separate user:
sudo useradd -m -d /opt/odoo -U -r -s /bin/bash odoo
The user does not have administrative privileges, and it will only be able to operate within one specific directory: /opt/odoo
Step 5: Set-up PostgreSQL
PostgreSQL is used by Odoo 13 to store all of the user and application data. It’s an essential part of the application.
Install PostgreSQL:
sudo apt-get install postgresql -y
Create a dedicated odoo user in the database:
sudo su - postgres -c "createuser -s odoo"
Step 6 : Install Wkhtmltopdf and Its Dependencies
Among the extra packages that Odoo 13 requires to properly function is Wkhtmltopdf, which makes it possible for the system to print PDF reports.
You won’t find it in the official repository, however, so let’s download it manually:
sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
Additional packages are required for Wkhtmltopdf to run. Install them with the following commands:
sudo apt-get install libjpeg-turbo8 libjpeg-turbo8 libxrender1 xfonts-75dpi xfonts-base -y
sudo apt-get install fontconfig
Note: there may be an error during this step. It’s normal. The next command will fix it.
sudo apt-get install -f
Install Wkhtmltopdf:
sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
Point Ubuntu to the location of the installed package:
sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin
sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin
Step 7: Install the Odoo 13 Dependencies
Odoo 13 doesn’t work in a vacuum – it needs other tools, too.
Install the necessary packages with this command:
sudo apt-get install python3 python3-pip python3-suds wget git bzr gdebi-core libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev libssl-dev -y
Install additional node packages:
sudo apt-get install node-clean-css node-less git -y
Step 8. Install Python 3.6
The default Python version will not work with Odoo 13. We need to install the 3.6 version, along with all the needed tools:
sudo apt install python3.6 python3.6-dev python3.6-venv
Step 9: Download Odoo 13
To make things simpler, let’s switch to the odoo user that we created earlier:
sudo su - odoo
Let’s download the source code from the official GitHub repository (/opt/odoo/odoo13 will be our main Odoo 13 directory):
git clone https://www.github.com/odoo/odoo --depth 1 --branch 13.0 /opt/odoo/odoo13
Step 10: Set-up the Python Environment
Odoo 13 runs on the Python programming language. But it needs additional modules in order to work correctly. Let’s install them.
First of all, create a virtual Python environment for the Odoo instance (so that the modules don’t affect the system’s Python modules, and vice-versa).
cd /opt/odoo && python3 -m venv odoo13-venv
Activate the virtual environment:
source odoo13-venv/bin/activate
The library and module details are stored in the official requirements.txt file. Let’s use it to install all of the correct modules at once:
pip3 install -r odoo13/requirements.txt
Note: ignore the orange warnings if they appear.
Deactivate the virtual environment and return to the previous user (the one with ‘sudo’ privileges).
deactivate && exit
Step 11: Create Additional Directories for Custom Addons and Odoo Logs
Custom addons will be stored in the odoo13-custom-addons directory. Create it with this command:
sudo mkdir /opt/odoo/odoo13-custom-addons
The owner of the directory must be the odoo user:
sudo chown odoo: /opt/odoo/odoo13-custom-addons
Create an odoo13 directory to store Odoo log files:
sudo mkdir /var/log/odoo13
Create an empty log file:
sudo touch /var/log/odoo13/odoo.log
Make sure the odoo user is the owner of the directory and the log file:
sudo chown -R odoo: /var/log/odoo13/
Step 12 : Configure Your Odoo 13 Instance
The core preferences and settings go into the configuration file called odoo.conf.
We will use nano to create and open the file:
sudo nano /etc/odoo.conf
Copy the text below into the Odoo configuration file:
[options]
; This is the password that allows database operations:
admin_passwd = master_password
db_host = False
db_port = False
db_user = odoo
db_password = False
xmlrpc_port = 8069
; longpolling_port = 8072
logfile = /var/log/odoo13/odoo.log
logrotate = True
addons_path = /opt/odoo/odoo13/addons,/opt/odoo/odoo13-custom-addons
Make sure that you change master_password to something more secure. It’s your main Odoo password.
Note: If you are a SolaDrive customer and use one of our Odoo VPS Hosting services you can simply ask our expert Odoo specialists to change your Odoo password for you. We are available 24×7 via chat or ticket and will take care of your request immediately.
Save and close the config file when you’re finished.
Make sure the owner of the config file is the odoo user:
sudo chown odoo:odoo /etc/odoo.conf
Specify the file’s permissions:
sudo chmod 640 /etc/odoo.conf
Step 13: Create the systemd Configuration File
systemd is a service that allows applications to be run on the background as services. Let’s configure Odoo to do exactly that.
We use nano to create and open the Odoo 13 service configuration file:
sudo nano /etc/systemd/system/odoo13.service
Copy the text below into the file (no changes necessary):
[Unit]
Description=Odoo13
#Requires=postgresql-10.6.service
#After=network.target postgresql-10.6.service
[Service]
Type=simple
SyslogIdentifier=odoo13
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo13-venv/bin/python3.6 /opt/odoo/odoo13/odoo-bin -c /etc/odoo.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
Save and close the config file when you’re finished.
Step 14: Start Odoo and Activate the Service
Run Odoo 13 as a service:
sudo systemctl start odoo13.service
Enable the Odoo 13 service for it to always run (by default).
sudo systemctl enable odoo13.service
You have now successfully installed Odoo 13 on Ubuntu 20.x.
Step 15: Access the Odoo Graphical Interface
Enter the following URL into your browser:
http://server_IP:8069
- Change server_IP to the IP address of the server.
If everything went well, you will be greeted with the Odoo 13 starting screen:
Source: How to Install Odoo 13 on Ubuntu 20.04 – Knowledgebase – SolaDrive