-
Notifications
You must be signed in to change notification settings - Fork 20
Deploying Installing Odoo (10c) on Ubuntu 16.04 LTS Server : Linux Reference
-
Switch to
rootuser (if you are already root user skip this):sudo su - -
Add user odoo
adduser odoo
-
Installing Postgresql (Databse Server)
apt-get install postgresql
Install Odoo (application server) dependencies and supporting libraries required to run odoo server.
-
Install git
apt-get install git -
Install pip: python package manager
apt-get install python-pip -
Installing devel packages for compiling python libraries
apt-get install python-dev postgresql-server-dev-all libjpeg-dev zlib1g-dev libpng12-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev -
Node-less installation
apt-get install node-less -
Clone odoo
su odoo cd /home/odoo git clone https://github.com/odoo/odoo.git exit -
Install python library
cd /home/odoo/odoo pip install -r requirements.txt
-
Create odoo user for postgresql with database creation rights
su postgres createuser -d odoo exit
-
Install
wkhtmltopdf0.12.1 !! (0.12.1 is identified to be working perfect with odoo, other version have bug and you may encounter unexpected issues. )
Get correct installer of wkhtmlpdf for your OS from here : https://github.com/wkhtmltopdf/wkhtmltopdf/releases/tag/0.12.1
(Below instruction are for x64 bit machine with an ubuntu x64 bit 16.04)
apt-get install fontconfig libfontconfig1 libxrender1 fontconfig-config
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb
cd /usr/local/bin/
cp wkhtmltoimage /usr/bin/wkhtmltoimage
cp wkhtmltopdf /usr/bin/wkhtmltopdf
-
Testing the installation of odoo is working correction (this is optional) :
su odoo cd /home/odoo/odoo ./odoo-bin
Launch the browser http://<yourip>:8069 the odoo database creation page should open, tried to create a database
Ctrl + c to kill the odoo process from the console
Switch back to root user by exiting odoo user
exit
- Deploy
init.dscript to start odoo daemons (Odoo as system service) and start odoo automatically on system boot
12.1. Create a log directory
su odoo
mkdir /home/odoo/log or /var/log.odoo
12.2. Create odoo config file: following command will generate the Odoo config file with all parameter set to give -c file path)
cd /home/odoo/odoo
./odoo-bin -s -c /home/odoo/odoo.conf --stop-after-init --logfile=/home/odoo/log/odoo.log
12.3. Create the odoo daemons (init.d) file :
exit
cp /home/odoo/odoo/debian/init /etc/init.d/odoo
12.4. Update the odoo daemons (init.d) file permissions (linux accessrigths)
chmod 755 /etc/init.d/odoo
12.5. Modify the odoo daemons (init.d) file parameters (Update odoo server executable file path, config file path and odoo log file path in daemons file )
nano /etc/init.d/odoo
12.5.1 Update file with the following lines (replace existing lines with this lines):
DAEMON = /home/odoo/odoo/odoo-bin
CONFIGFILE = /home/odoo/odoo.conf
LOGFILE = /home/odoo/log/odoo-server.log
12.6 Testing the Odoo daemons (init.d) script :
/etc/init.d/odoo start
Test again on `http://<yourip>:8069`
12.7. Ensure that the Odoo daemons (init.d) script runs at on system boot at startup
update-rc.d odoo defaults
-
Running Odoo behind proxy servers (configure nginx for odoo: edit conf file), you can find nginx configuration at below URL:
-
Basic Security Measures: Odoo more accessible on the port and change the master password 14.1. Update Odoo conf file from :
vim /home/odoo/odoo.conf
Change following parameter
admin_passwd = admin
Xmlrpc_interface =
proxy_mode = False
With
admin_passwd = your_secret_password
xmlrpc_interface = 127.0.0.1
proxy_mode = True
14.2 Finally Restart odoo server
/etc/init.d/odoo restart
For testing and production run Odoo in multi-processing mode to get maximum out of system. Out-of-box odoo runs on multi-threading mode which is not optimal for production.
- Read more on multiprocessing mode and deploying here :
-
Read following on How to Optimize Odoo, Improve Performance, Monitoring Odoo server and Tips and Tricks about deployments of Odoo.
-
Must Read About Odoo Framework (Architecture) Documentation is old but it's must read :
-
Basic Postgresql tuning can be done by following this URL :
-
More on articles on postgresql tuning :