How to Install Odoo 13 on Ubuntu 18.04
Odoo is a famous open-source suite of enterprise apps. It offers a number applications, which includes CRM, e-Commerce, website builder, billing, accounting, production, warehouse, challenge management, stock, and lots extra, all seamlessly included.
Odoo can be established in a couple of ways depending on the use case and available technology. The easiest and quickest way to install Odoo is by means of using the reputable Odoo APT repositories.
Installing Odoo in a digital surroundings, or deploying as a Docker field, permits you to have greater manipulate over the machine’s installation, and run multiple Odoo versions at the identical gadget.
In this manual, we can walk you through installing and deploying Odoo thirteen internal a Python digital surroundings on Ubuntu 18.04. We’ll download Odoo from their Github repository and use Nginx as a reverse proxy.
Login to your Ubuntu as a sudo user and replace the Apt cache:
sudo apt update
Install Git , Pip , Node.Js , and the equipment required to construct Odoo dependencies:
sudo apt install git python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less
Creating a System User
Create a system user in order to run Odoo, named odoo13 with home listing /opt/odoo13:
sudo useradd -m -d /opt/odoo13 -U -r -s /bin/bash odoo13
You can set the call of the user to some thing you want, as lengthy you create a PostgreSQL user with the same call.
Installing and Configuring PostgreSQL
Odoo makes use of PostgreSQL as the database again-cease. To deploy PostgreSQL run the following command:
sudo apt install postgresql
Once the set up is completed, create a PostgreSQL user with the same call as the previously created device user, in our case that is odoo13:
sudo su - postgres -c "createuser -s odoo13"
The wkhtmltox package provides a hard and fast of open-source command-line equipment that could render HTML into PDF and numerous photo formats. To be able to print PDF reports, you’ll need to put in the wkhtmltopdf device. The recommended model for Odoo is zero.12.5, which isn't always available in the default Ubuntu 18.04 repositories.
Download the package the use of the following wget command:
Once the download is entire, install the bundle through typing:
sudo apt install ./wkhtmltox_0.12.5-1.bionic_amd64.deb
Installing and Configuring Odoo 13
As cited before, we’ll set up Odoo from the source inside an isolated Python digital environment .
First, alternate to consumer “odoo13”:
sudo su - odoo13
Clone the Odoo thirteen source code from GitHub:
git clone https://www.github.com/odoo/odoo --depth 1 --branch 13.0 /opt/odoo13/odoo
Once the down load is complete, create a brand new Python digital surroundings for Odoo:
cd /opt/odoo13 python3 -m venv odoo-venv
Activate the environment with the subsequent command:
Install all required Python modules with pip3:
pip3 install wheel pip3 install -r odoo/requirements.txt
If you come upon any compilation blunders in the course of the installation, make certain all the required dependencies listed within the Installing Prerequisites segment are set up.
Once finished, deactivate the environment by using typing:
We’ll create a brand new directory that will maintain the third birthday celebration addons.
Later, we’ll add this listing to the addons_path parameter. This parameter defines a listing of directories wherein Odoo searches for modules.
Switch back to your sudo user:
Create a configuration document with the following content:
sudo nano /etc/odoo13.conf
[options] ; This is the password that allows database operations: admin_passwd = my_admin_passwd db_host = False db_port = False db_user = odoo13 db_password = False addons_path = /opt/odoo13/odoo/addons,/opt/odoo13/odoo-custom-addons
Do now not overlook to change the my_admin_passwd to some thing greater relaxed.
Creating a Systemd Unit File
Open your textual content editor and create a provider unit report known as odoo13.Carrier with the subsequent content:
sudo nano /etc/systemd/system/odoo13.service
[Unit] Description=Odoo13 Requires=postgresql.service After=network.target postgresql.service [Service] Type=simple SyslogIdentifier=odoo13 PermissionsStartOnly=true User=odoo13 Group=odoo13 ExecStart=/opt/odoo13/odoo-venv/bin/python3 /opt/odoo13/odoo/odoo-bin -c /etc/odoo13.conf StandardOutput=journal+console [Install] WantedBy=multi-user.target
Notify systemd that a brand new unit file exists:
sudo systemctl daemon-reload
Start the Odoo carrier and enabled it to begin on boot by using jogging:
sudo systemctl enable --now odoo13
Verify the carrier fame:
sudo systemctl status odoo13
The output should appearance some thing like beneath, indicating that the Odoo service is lively and going for walks.
? odoo13.service Loaded: loaded (/etc/systemd/system/odoo13.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2019-10-19 20:06:23 UTC; 3s ago Main PID: 1860 (python3) Tasks: 4 (limit: 2362) CGroup: /system.slice/odoo13.service ??1860 /opt/odoo13/odoo-venv/bin/python3 /opt/odoo13/odoo/odoo-bin -c /etc/odoo13.conf
To see the messages logged by means of the Odoo provider, use the command below:
sudo journalctl -u odoo13
Testing the Installation
Open your browser and kind: http://<your_domain_or_IP_address>:8069
Assuming the installation is successful, a display screen similar to the subsequent will appear:
Configuring Nginx as SSL Termination Proxy
The default Odoo net server is serving site visitors over HTTP. To make the Odoo deployment greater secure we can configure Nginx as an SSL termination proxy so one can serve the traffic over HTTPS.
SSL termination proxy is a proxy server that handles the SSL encryption/decryption. This approach that the termination proxy (Nginx) will method and decrypt incoming TLS connections (HTTPS), and skip on the unencrypted requests to the internal carrier (Odoo). The site visitors among Nginx and Odoo will now not be encrypted (HTTP).
Using a reverse proxy gives you a whole lot of blessings along with Load Balancing, SSL Termination, Caching, Compression, Serving Static Content, and greater.
Ensure which you have met the subsequent conditions before persevering with with this phase:
Domain call pointing to your public server IP. We’ll use example.Com.
Nginx installed .
SSL certificate to your area. You can installation a unfastened Let’s Encrypt SSL certificates .
Open your text editor and create/edit the domain server block:
sudo nano /etc/nginx/sites-enabled/example.com
The following configuration units up SSL Termination, HTTP to HTTPS redirection , WWW to non-WWW redirection, cache the static files, and allow GZip compression.
Don’t overlook to update example.Com along with your Odoo area and set the best route to the SSL certificate documents. The snippets used on this configuration are created on this manual .
Once you’re done, restart the Nginx service :
proxy_mode = True
Next, we need to inform Odoo to apply the proxy. To do so, open the configuration document and upload the following line:
/etc/odoo13.conf proxy_mode = True
Restart the Odoo service for the modifications to take effect:
sudo systemctl restart odoo13
At this factor, the reverse proxy is configured, and you may get right of entry to your Odoo example at: https://instance.Com
Changing the Binding Interface
This step is optionally available, but it is a great protection exercise.
By default, Odoo server listens to port 8069 on all interfaces. To disable direct get admission to to the Odoo instance, you may both block the port 8069 for all public interfaces or pressure Odoo to pay attention only at the nearby interface.
We’ll configure Odoo to listen most effective on 127.0.0.1. Open the configuration add the subsequent two strains on the end of the file:
xmlrpc_interface = 127.0.0.1 netrpc_interface = 127.0.0.1
Save the configuration report and restart the Odoo server for the changes to take effect:
sudo systemctl restart odoo13
By default, Odoo is operating in multithreading mode. For production deployments, it's miles encouraged to exchange to the multiprocessing server because it will increase stability, and make higher usage of the system sources.
To permit multiprocessing you want to edit the Odoo configuration and set a non-zero range of worker processes. The number of workers is calculated based totally at the range of CPU cores within the machine and the available RAM memory.
According to the authentic Odoo documentation to calculate the workers' variety and required RAM memory length, you could use the subsequent formulation and assumptions:
Worker wide variety calculation
Theoretical maximal range of employee = (system_cpus * 2) + 1
1 worker can serve ~= 6 concurrent customers
Cron people additionally require CPU
RAM reminiscence size calculation
We will take into account that 20% of all requests are heavy requests, and 80% are lighter ones. Heavy requests are the use of round 1 GB of RAM while the lighter ones are the usage of round one hundred fifty MB of RAM
Needed RAM = number_of_workers * ( (light_worker_ratio * light_worker_ram_estimation) + (heavy_worker_ratio * heavy_worker_ram_estimation) )
If you do no longer realize what number of CPUs you have got in your system, use the subsequent grep command:
grep -c ^processor /proc/cpuinfo
Let’s say you have got a device with four CPU cores, 8 GB of RAM memory, and 30 concurrent Odoo users.
30 users / 6 = **5** (5 is theoretical range of employees wanted )
(4 * 2) + 1 = **nine** ( 9 is the theoretical most quantity of employees)
Based at the calculation above, you may use five people + 1 worker for the cron employee that could be a total of 6 people.
Calculate the RAM reminiscence consumption based totally at the number of employees:
RAM = 6 * ((0.8*one hundred fifty) + (zero.2*1024)) ~= 2 GB of RAM
The calculation shows that the Odoo set up will need around 2GB of RAM.
To transfer to multiprocessing mode, open the configuration report and append the calculated values:
limit_memory_hard = 2684354560 limit_memory_soft = 2147483648 limit_request = 8192 limit_time_cpu = 600 limit_time_real = 1200 max_cron_threads = 1 workers = 5
Restart the Odoo service for the changes to take effect:
sudo systemctl restart odoo13
The relaxation of the device sources can be utilized by other offerings that run on this machine. In this manual, we mounted Odoo together with PostgreSQL and Nginx at the same server. Depending for your set up you may also have other offerings walking for your server.
This academic walked you through the set up of Odoo thirteen on Ubuntu 18.04 in a Python virtual surroundings using Nginx as a opposite proxy. We’ve additionally proven you a way to permit multiprocessing and optimize Odoo for a production environment.
You may also want to test our tutorial approximately the way to create automated each day backups of Odoo databases .
If you've got questions, experience unfastened to go away a remark beneath.
Particle is an open-source cross-stage code manager created by GitHub. It has an inherent bundle chief, inserted Git control, keen autocompletion, ...
An HTML editor is a software for enhancing HTML, the markup of an internet web page. It stands for Tiny Moxiecode Content Editor. TinyMCE is a effe...
Redis is an open-source in-memory key-esteem information store. It tends to be utilized as an information base, store and, message representative, ...
phpMyAdmin is an open-source PHP based instrument for overseeing MySQL and MariaDB workers over an online interface. phpMyAdmin permits you ...
While diverting the yield of an order to a document or funneling it to another order, you may see that the blunder messages are imprinted on the sc...
Deb is the establishment bundle design utilized by all Debian based dispersions. The Ubuntu vaults contain a huge number of deb bundles that...
CodeIgniter Subquery: This tutorial will explain you how to write subquery in codeigniter using active records. SubQuery is a query ...
Hi! In this tutorial we'll see how to find codeigniter version you are using. For pros it may sound basic but would be a challenge fo...
R is an open-source programming language and free climate that has practical experience in factual figuring and graphical portrayal. It is principa...
FTP (File Transfer Protocol) is a standard customer worker network convention that permits clients to move documents to and from a distant organiza...
Cup is a free and open-source miniature web system for Python intended to assist engineers with building secure, adaptable and viable web applicati...
Docker Compose is an instrument that permits you to characterize and arrange multi-holder Docker applications. It utilizes a YAML document to arran...
Spotify is a computerized music real time feature that gives you moment admittance to a great many melodies, from old works of art to the most rece...
sudo is an order line program that permits confided in clients to execute orders as root or another client. In this article we'll show b...
PHP is one of the most utilized worker side programming dialects. Numerous well known CMS and structures, for example, WordPress, Magento, and Lara...
Apache Maven is an open-source venture the executives and perception device utilized principally for Java ventures. Expert uses a Project Object Mo...
twist is an order line utility for moving information from or to a far off worker. With twist, you can download or transfer information utilizing o...
Vim/Vi is the word processor of decision for some product designers and Linux framework chairmen. As a matter of course, Vim doesn't sho...
Trade is a space on a plate that is utilized when the measure of actual RAM memory is full. At the point when a Linux framework runs out of RAM, in...