<\/span><\/h2>\r\n\r\n\r\n\r\nLog in to your Ubuntu 18.04 VPS with SSH as a root user<\/p>\r\n\r\n\r\n\r\n
ssh root@IP_Address -p Port_number<\/pre>\r\n\r\n\r\n\r\nYou can check whether you have the proper Ubuntu version installed on your server with the following command:<\/p>\r\n\r\n\r\n\r\n
# lsb_release -a<\/pre>\r\n\r\n\r\n\r\nYou should get this output:<\/p>\r\n\r\n\r\n\r\n
Distributor ID: Ubuntu\r\nDescription: Ubuntu 18.04.1 LTS\r\nRelease: 18.04\r\nCodename: bionic\r\n<\/pre>\r\n\r\n\r\n\r\nOnce you are logged in, run the following command to update all installed packages to the latest available version.<\/p>\r\n\r\n\r\n\r\n
apt update && apt upgrade<\/pre>\r\n\r\n\r\n\r\n<\/span>2. Install PostgreSQL server<\/span><\/h2>\r\n\r\n\r\n\r\nOdoo requires a PostgreSQL database to store its information, so we will have to install the PostgreSQL server. We will install a PostgreSQL server using the following command:<\/p>\r\n\r\n\r\n\r\n
apt install postgresql<\/pre>\r\n\r\n\r\n\r\nOnce installed, PostgreSQL server will be started and it’s also enabled to start at server boot.<\/p>\r\n\r\n\r\n\r\n
<\/span>3. Install Odoo<\/span><\/h2>\r\n\r\n\r\n\r\na. Method 1<\/h3>\r\n\r\n\r\n\r\n If you want to install Odoo on your fresh server or you currently do not have an Odoo instance running on your server, you can follow this method.<\/p>\r\n\r\n\r\n\r\n
Add repository and install Odoo<\/h4>\r\n\r\n\r\n\r\n Odoo is not available in the official Ubuntu 18.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<\/p>\r\n\r\n\r\n\r\n
wget -O - https:\/\/nightly.odoo.com\/odoo.key | apt-key add -\r\necho \"deb http:\/\/nightly.odoo.com\/12.0\/nightly\/deb\/ .\/\" >> \/etc\/apt\/sources.list.d\/odoo.list\r\n<\/pre>\r\n\r\n\r\n\r\nNext, update the local package database<\/p>\r\n\r\n\r\n\r\n
apt update<\/pre>\r\n\r\n\r\n\r\nand install Odoo using the apt package manager<\/p>\r\n\r\n\r\n\r\n
apt install odoo<\/pre>\r\n\r\n\r\n\r\nThis command will install Odoo 12, Python 3 and all necessary Python modules, create PostgreSQL user and start the Odoo instance. After the installation is completed, you can check the status of the Odoo service:<\/p>\r\n\r\n\r\n\r\n
systemctl status odoo<\/pre>\r\n\r\n\r\n\r\nb. Method 2<\/h3>\r\n\r\n\r\n\r\n If you want to run multiple Odoo version on your Ubuntu 18.04 server and\/or you have another version of Odoo running on your server, you can follow these steps to install and configure Odoo 12 using their Github repository and Pyhton virtual environment.<\/p>\r\n\r\n\r\n\r\n
Install dependencies<\/h4>\r\n\r\n\r\n\r\napt install build-essential wget git python3-pip python3-dev python3-venv python3-wheel python3-setuptools libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less<\/pre>\r\n\r\n\r\n\r\nCreate a new system user for Odoo<\/p>\r\n\r\n\r\n\r\n
useradd -m -d \/opt\/odoo12 -U -r -s \/bin\/bash odoo12<\/pre>\r\n\r\n\r\n\r\nsu - postgres -c \"createuser -s odoo12\"<\/pre>\r\n\r\n\r\n\r\nInstall Wkhtmltopdf<\/h4>\r\n\r\n\r\n\r\n The wkhtmltopdf package is an open source tool that Odoo uses to make HTML in PDF formats so that it can print PDF reports. The recommended version for Odoo is 0.12.1 which is not available in the official Ubuntu 18.04 repositories.<\/p>\r\n\r\n\r\n\r\n
cd \/opt\r\nwget https:\/\/builds.wkhtmltopdf.org\/0.12.1.3\/wkhtmltox_0.12.1.3-1~bionic_amd64.deb\r\napt install \/opt\/wkhtmltox_0.12.1.3-1~bionic_amd64.deb<\/pre>\r\n\r\n\r\n\r\nThat’s it, wkhtmltopdf has been installed.<\/p>\r\n\r\n\r\n\r\n
Install odoo 12<\/h4>\r\n\r\n\r\n\r\nsu - odoo12<\/pre>\r\n\r\n\r\n\r\ngit clone https:\/\/www.github.com\/odoo\/odoo --depth 1 --branch 12.0 \/opt\/odoo12\/odoo<\/pre>\r\n\r\n\r\n\r\nNow, still as user odoo12, let’s create a new python virtual environment<\/p>\r\n\r\n\r\n\r\n
python3 -m venv odoo-venv<\/pre>\r\n\r\n\r\n\r\nThen, let’s activate it<\/p>\r\n\r\n\r\n\r\n
source odoo-venv\/bin\/activate<\/pre>\r\n\r\n\r\n\r\npip3 install wheel\r\npip3 install -r odoo\/requirements.txt<\/pre>\r\n\r\n\r\n\r\n(venv) $ deactivate && exit<\/pre>\r\n\r\n\r\n\r\n <\/figure><\/div>\r\n\r\n\r\n\r\n We need an Odoo configuration file, we can copy the one from GitHub:<\/p>\r\n\r\n\r\n\r\n
cp \/opt\/odoo12\/odoo\/debian\/odoo.conf \/etc\/odoo12.conf<\/pre>\r\n\r\n\r\n\r\n <\/figure><\/div>\r\n\r\n\r\n\r\n We can create a master password, you can change the “m0d1fyth15” to your own password. Also, add addons_path and xmlrpc_port if you want to specify a port to run Odoo on, if you do not specify it, then Odoo will run on its default port, 8069.<\/p>\r\n\r\n\r\n\r\n
nano \/etc\/odoo12.conf<\/pre>\r\n\r\n\r\n\r\n[options]\r\n; This is the password that allows database operations:\r\nadmin_passwd = m0d1fyth15\r\ndb_host = False\r\ndb_port = False\r\ndb_user = odoo12\r\ndb_password = False\r\naddons_path = \/opt\/odoo12\/odoo\/addons\r\nxmlrpc_port = 8001\r\n<\/pre>\r\n\r\n\r\n\r\nSave the file then exit, then we create a systemd file to run Odoo 12.<\/p>\r\n\r\n\r\n\r\n
nano \/etc\/systemd\/system\/odoo12.service<\/pre>\r\n\r\n\r\n\r\n[Unit]\r\nDescription=Odoo12\r\nRequires=postgresql.service\r\nAfter=network.target postgresql.service\r\n\r\n[Service]\r\nType=simple\r\nSyslogIdentifier=odoo12\r\nPermissionsStartOnly=true\r\nUser=odoo12\r\nGroup=odoo12\r\nExecStart=\/opt\/odoo12\/odoo-venv\/bin\/python3 \/opt\/odoo12\/odoo\/odoo-bin -c \/etc\/odoo12.conf\r\nStandardOutput=journal+console\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n<\/pre>\r\n\r\n\r\n\r\nsystemctl daemon-reload\r\nsystemctl start odoo12<\/pre>\r\n\r\n\r\n\r\nAt this point, we can access our new Odoo 12 installation at http:\/\/IP_Address:Odoo_port. To access it using a domain we need to configure a reverse proxy, and this time we will use nginx to do it.<\/p>\r\n\r\n\r\n\r\n
<\/figure><\/div>\r\n\r\n\r\n\r\n