How to install Odoo 12 on Ubuntu 18.04

Odoo is a suite of web based open source business management apps. The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, and more. Odoos fully-integrated, customizable, an open-source suite of business applications intends to serve SMBs but is designed to meet the needs of companies regardless of size and budget.

This will install Odoo, PostgreSQL and Apache on Ubuntu 18.04.

If installing using Vagrant, the forwarding port mapping in Vagrantfile should be something like:

config.vm.network "forwarded_port", guest: 8069, host: 8080

where host can be 80 or anything else you choose. Odoo runs on port 8069 and will map to the host port you choose to access in your browser.

1. Server requirements calculation

https://www.odoo.com/documentation/12.0/setup/deploy.html#worker-number-calculation
https://www.odoo.com/forum/help-1/question/hardware-requirements-for-odoo-11-138936

The total number of users matters little, Only concurrent users need to be taken into account. So unless 5O+ users are going to be concurrent I guess odoo11 can pretty much run on any machine > 1G RAM, be sure to configure the SWAP.

2. Install PostgreSQL server

Install PostgreSQL:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install postgresql

Once installed, start the PostgreSQL server and enable it to start at server boot.

$ sudo systemctl start postgresql
$ sudo systemctl enable postgresql

(Optional) Install phpPgAdmin, see here:
https://www.rosehosting.com/blog/install-postgresql-with-phppgadmin-on-ubuntu/

3. Add repository and install Odoo

Odoo is not available in the official Ubuntu 16.04 repository, so in order to install it, we will need to add the Odoo repository to the server. In order to do it, run the following commands:

sudo wget -O - https://nightly.odoo.com/odoo.key | apt-key add -
sudo echo "deb http://nightly.odoo.com/12.0/nightly/deb/ ./" >> /etc/apt/sources.list.d/odoo.list

Note: If using Vagrant and you get a Permission denied error when trying to run the commands above, you can run this command first to run as root before running the command above:

$sudo -i

Run the commands above again and to exit back to the vagrant user:

# exit

Next, update the local package database:

$ sudo apt-get update

and install Odoo 12 using the apt package manager:

$ sudo apt-get install odoo -y

To check the status of the Odoo service:

$ sudo systemctl status odoo

Example output:

 odoo.service - Odoo Open Source ERP and CRM
   Loaded: loaded (/lib/systemd/system/odoo.service; enabled; vendor preset: ena
   Active: active (running)
 Main PID: 7848 (odoo)
    Tasks: 4 (limit: 2361)
   CGroup: /system.slice/odoo.service
           └─7848 /usr/bin/python3 /usr/bin/odoo --config /etc/odoo/odoo.conf --

Ctrl+C to exit.

Edit Odoo’s configuration file and set the master admin password:

$ sudo nano /etc/odoo/odoo.conf

Delete the ; (semi-colon) to uncomment the admin_passwrd line and change the password to something strong.

admin_passwd = STRONG_PASSWORD

Save file and exit (Press CTRL + X, press Y and then press ENTER).

Restart Odoo:

$ sudo systemctl restart odoo

Step 4 below is only necessary if you skipped the Optional section above to install phpPgAdmin. When installing phpPgAdmin, Apache is automatically installed along with PHP.

4. (Optional) Setting up a Reverse Proxy

In order to access your Odoo application only by using your domain name, without the port number in the URL, it is necessary to set up Apache as a reverse proxy. This step is not necessary if you are using a local development server (ex. Vagrant), just skip to step 5.

To check whether Apache is already installed and running on your server, run this command:

$ dpkg -l apache2

If Apache is not installed, run this command:

$ sudo apt-get install apache2 -y

Enable Apache to start automatically upon server boot:

$ sudo systemctl enable apache2

You can also check the status of your Apache service with the following command:

$ sudo systemctl status apache2

Ctrl+C to exit.

Enable some additional proxy modules for Apache:

$ sudo a2enmod proxy
$ sudo a2enmod proxy_http

Open a new configuration file substituting your_domain for your domain (or if using Vagrant for local dev, open 000-default.conf):

$ sudo nano /etc/apache2/sites-available/your_domain.conf

Copy/paste the following lines, subsitituting your_domain.com with your domain name (or if using Vagrant for local dev, use localhost):

<VirtualHost *:80>
ServerName your_domain.com
ServerAlias www.your_domain.com

ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass / http://your_domain.com:8069/
ProxyPassReverse / http://your_domain.com:8069/
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>

Save file and exit (Press CTRL + X, press Y and then press ENTER).

Then, enable “your_domain.conf” configuration in Apache (again, substituting your_domain):

ln -s /etc/apache2/sites-available/your_domain.conf /etc/apache2/sites-enabled/your_domain.conf

Restart the Apache web server:

$ sudo systemctl restart apache2

5. Odoo Quickstart

Open your browser and access Odoo at http://your_IP_Address:8069 (or https://localhost:8080 if using Vagrant).

To create a new database, enter a database name. Then enter an email address, password and any other info. Select the checkbox if you would like to install demo data. Then click Create database button. After set, you should now be redirected to Odoo's admin dashboard where you can install the apps that you need.

 

REFERENCES

https://www.rosehosting.com/blog/how-to-install-odoo-12-on-ubuntu-16-04/
https://www.rosehosting.com/blog/install-postgresql-with-phppgadmin-on-ubuntu/

https://www.odoo.com/
https://www.odoo.com/page/editions
https://www.odoo.com/documentation/12.0/setup/install.html
https://hub.docker.com/_/odoo/
https://doc.therp.nl/openupgrade/migration_details.html

 

2 thoughts on “How to install Odoo 12 on Ubuntu 18.04

  1. Its awesome and easiest tutorial to install odoo. but one thing its hard to find custom addon path could you please let me know where can i find the addon path? or odoo installation directory?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.