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.
It'll be useful on some occasions to inform the web or mobile operation stoner whether he she has connected to a live internet connection or no...
Boa constrictor is a mainstream Python/R information science and AI stage, utilized for enormous scope information handling, prescient examination,...
Nextcloud is an open-source, self-facilitated record offer and cooperation stage, like Dropbox. It comes packaged with media player, schedule and c...
Arranger is a reliance chief for PHP (like npm for Node.js or pip for Python ). With Composer, you can determine the PHP libraries your vent...
Mono is a stage for creating and running cross-stage applications dependent on the ECMA/ISO Standards. It is a free and open-source execution of Mi...
When introducing bundles utilizing the Ubuntu Software Center or the order line utilities, for example, able or adept get the bundles are downloade...
While working with any technology, We need to interact with a file system by creating a new file, adding content, and deleting it. With NodeJS work...
While working with NodeJS, We may need to work with the original JSON file. In this composition, We'll see writing data to a original JS...
Today, I'm going to produce a sample operation to show how to use original JSON file in Angular operation. There area colorful way we can use o...
As Developer, We should be apprehensive of all the ways to do a task, So we can perform the job moreeffeciently.However, including If we talk...
In this composition, We'll see how to display a simple table, listing with Array of Objects and nesting list inReact.js. This composition is su...
FTP (File Transfer Protocol) is a standard organization convention used to move documents to and from a far off organization. For safer and quicker...
An emblematic connection, otherwise called a symlink, is a unique kind of record that focuses to another document or registry. It is something like...
Minecraft is one of the most mainstream rounds ever. It is a sandbox computer game where players investigate endless universes and fabricate variou...
The hostname is set during the establishment of the working framework or powerfully relegated to the virtual machine when it is made. This g...
On Linux and UNIX working frameworks, you can utilize the mount order to append (mount) document frameworks and removable gadgets, for example, USB...
A Virtual Host is an Apache arrangement mandate that permits you to run more than one site on a solitary worker. With Virtual Hosts, you can indica...
Boa constrictor is the most mainstream python information science and AI stage, utilized for huge scope information handling, prescient investigati...