{"id":17713,"date":"2016-01-02T14:29:50","date_gmt":"2016-01-02T20:29:50","guid":{"rendered":"https:\/\/secure.rosehosting.com\/blog\/?p=17713"},"modified":"2022-08-01T08:03:52","modified_gmt":"2022-08-01T13:03:52","slug":"install-odoo-9-on-ubuntu-14-04","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/install-odoo-9-on-ubuntu-14-04\/","title":{"rendered":"Install Odoo 9 on Ubuntu 14.04"},"content":{"rendered":"
In this tutorial, we will show you how to install Odoo 9 on an Ubuntu 14.04 VPS<\/a><\/strong>.<\/p>\n Odoo is a suite of business applications written in Python. In the new version of Odoo there are major changes in accounting section. Also Fabien Pinckaers and Odoo Twitter feed listed some new features like accounting module rewrite, voice over IP module, an improved forum with social network integration, a much better mass mailing app, etc. In this tutorial we are going to use the script from Yenthe Van Ginneken. You can download the script by running the following command:<\/p>\n Or, you can create a file and copy the following code to the new file (for example, ‘odoo_install.sh’).<\/p>\n Make the file executable:<\/p>\n Run\u00a0the script and wait until Odoo is fully installed:<\/p>\n Edit the Odoo configuration file and set the master admin password:<\/p>\n Change the template encoding to UTF8 by running the following commands:<\/p>\n Restart the PostgreSQL server for the changes to take effect:<\/p>\n Then, restart the Odoo service:<\/p>\n Open http:\/\/your-server-IP:8069\/web\/database\/manager and create a new database. After the database is created, you will be redirected to the admin panel. Log in as admin user, change its password, configure Odoo, install the modules you need, etc.<\/p>\n That’s it. You have successfully installed Odoo 9 on your Ubuntu 14.04 VPS.<\/p>\n Of course, you don\u2019t have to do any of this if you use one of our Linux VPS Hosting<\/a> services, in which case you can simply ask our expert Linux admins to install Odoo 9<\/strong> for you. They are available 24\u00d77 and will take care of your request immediately. Now that Odoo 10 is available on the newer Ubuntu 16.04, you can install and upgrade it with ease. All you have to do is check our guide on how to install Odoo 10 on Ubuntu 16.04.<\/a><\/p>\n PS<\/span>.<\/strong> If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" In this tutorial, we will show you how to install Odoo 9 on an Ubuntu 14.04 VPS. Odoo is a … <\/p>\n
\nThe installation of Odoo 9 on an Ubuntu 14.04 VPS should take about 30 minutes if you follow the very easy steps described below.
\n
\nUpdate the OS packages on your virtual server<\/a> using\u00a0the following commands:<\/p>\n$ sudo apt-get update\r\n$ sudo apt-get upgrade<\/pre>\n
wget https:\/\/github.com\/Yenthe666\/InstallScript\/blob\/9.0\/odoo_install.sh<\/pre>\n
$ sudo nano odoo_install.sh<\/pre>\n
#!\/bin\/bash\r\n################################################################################\r\n# Script for Installation: ODOO Saas4\/Trunk server on Ubuntu 14.04 LTS\r\n# Author: Yenthe Van Ginneken\r\n#-------------------------------------------------------------------------------\r\n# \r\n# This script will install Odoo on your Ubuntu 14.04 server. It can install multiple Odoo instances\r\n# in one Ubuntu because of the different xmlrpc_ports\r\n#-------------------------------------------------------------------------------\r\n# USAGE:\r\n#\r\n# odoo-install\r\n#\r\n# EXAMPLE:\r\n# .\/odoo-install \r\n#\r\n################################################################################\r\n \r\n##fixed parameters\r\n#odoo\r\nOE_USER=\"odoo\"\r\nOE_HOME=\"\/$OE_USER\"\r\nOE_HOME_EXT=\"\/$OE_USER\/$OE_USER-server\"\r\n#The default port where this Odoo instance will run under (provided you use the command -c in the terminal)\r\n#Set to true if you want to install it, false if you don't need it or have it already installed.\r\nINSTALL_WKHTMLTOPDF=\"True\"\r\n\r\n#Set the default Odoo port (you still have to use -c \/etc\/odoo-server.conf for example to use this.)\r\nOE_PORT=\"8069\"\r\n\r\n#Choose the Odoo version which you want to install. For example: 9.0, 8.0, 7.0 or saas-6. When using 'trunk' the master version will be installed.\r\n#IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 9.0\r\nOE_VERSION=\"9.0\"\r\n\r\n#set the superadmin password\r\nOE_SUPERADMIN=\"admin\"\r\nOE_CONFIG=\"$OE_USER-server\"\r\n\r\n#--------------------------------------------------\r\n# Update Server\r\n#--------------------------------------------------\r\necho -e \"\\n---- Update Server ----\"\r\nsudo apt-get update\r\nsudo apt-get upgrade -y\r\n\r\n#--------------------------------------------------\r\n# Install PostgreSQL Server\r\n#--------------------------------------------------\r\necho -e \"\\n---- Install PostgreSQL Server ----\"\r\nsudo apt-get install postgresql -y\r\n\t\r\necho -e \"\\n---- PostgreSQL $PG_VERSION Settings ----\"\r\nsudo sed -i s\/\"#listen_addresses = 'localhost'\"\/\"listen_addresses = '*'\"\/g \/etc\/postgresql\/9.3\/main\/postgresql.conf\r\n\r\necho -e \"\\n---- Creating the ODOO PostgreSQL User ----\"\r\nsudo su - postgres -c \"createuser -s $OE_USER\" 2> \/dev\/null || true\r\n\r\n#--------------------------------------------------\r\n# Install Dependencies\r\n#--------------------------------------------------\r\necho -e \"\\n---- Install tool packages ----\"\r\nsudo apt-get install wget subversion git bzr bzrtools python-pip -y\r\n\t\r\necho -e \"\\n---- Install python packages ----\"\r\nsudo apt-get install python-dateutil python-feedparser python-ldap python-libxslt1 python-lxml python-mako python-openid python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi python-docutils python-psutil python-mock python-unittest2 python-jinja2 python-pypdf python-decorator python-requests python-passlib python-pil -y\r\n\t\r\necho -e \"\\n---- Install python libraries ----\"\r\nsudo pip install gdata\r\n\r\necho -e \"\\n--- Install other required packages\"\r\nsudo apt-get install node-clean-css\r\nsudo apt-get install node-less\r\nsudo apt-get install python-gevent\r\n\r\n#--------------------------------------------------\r\n# Install Wkhtmltopdf if needed\r\n#--------------------------------------------------\r\nif [ $INSTALL_WKHTMLTOPDF = \"True\" ]; then\r\necho -e \"\\n---- Install wkhtml and place on correct place for ODOO 8 ----\"\r\nsudo wget http:\/\/download.gna.org\/wkhtmltopdf\/0.12\/0.12.1\/wkhtmltox-0.12.1_linux-trusty-amd64.deb\r\nsudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb\r\nsudo cp \/usr\/local\/bin\/wkhtmltopdf \/usr\/bin\r\nsudo cp \/usr\/local\/bin\/wkhtmltoimage \/usr\/bin\r\nelse\r\n echo \"Wkhtmltopdf isn't installed due to the choice of the user!\"\r\nfi\r\n\t\r\necho -e \"\\n---- Create ODOO system user ----\"\r\nsudo adduser --system --quiet --shell=\/bin\/bash --home=$OE_HOME --gecos 'ODOO' --group $OE_USER\r\n#The user should also be added to the sudo'ers group.\r\nsudo adduser $OE_USER sudo\r\n\r\necho -e \"\\n---- Create Log directory ----\"\r\nsudo mkdir \/var\/log\/$OE_USER\r\nsudo chown $OE_USER:$OE_USER \/var\/log\/$OE_USER\r\n\r\n#--------------------------------------------------\r\n# Install ODOO\r\n#--------------------------------------------------\r\necho -e \"\\n==== Installing ODOO Server ====\"\r\nsudo git clone --branch $OE_VERSION https:\/\/www.github.com\/odoo\/odoo $OE_HOME_EXT\/\r\n\r\necho -e \"\\n---- Create custom module directory ----\"\r\nsudo su $OE_USER -c \"mkdir $OE_HOME\/custom\"\r\nsudo su $OE_USER -c \"mkdir $OE_HOME\/custom\/addons\"\r\n\r\necho -e \"\\n---- Setting permissions on home folder ----\"\r\nsudo chown -R $OE_USER:$OE_USER $OE_HOME\/*\r\n\r\necho -e \"* Create server config file\"\r\nsudo cp $OE_HOME_EXT\/debian\/openerp-server.conf \/etc\/$OE_CONFIG.conf\r\nsudo chown $OE_USER:$OE_USER \/etc\/$OE_CONFIG.conf\r\nsudo chmod 640 \/etc\/$OE_CONFIG.conf\r\n\r\necho -e \"* Change server config file\"\r\nsudo sed -i s\/\"db_user = .*\"\/\"db_user = $OE_USER\"\/g \/etc\/$OE_CONFIG.conf\r\nsudo sed -i s\/\"; admin_passwd.*\"\/\"admin_passwd = $OE_SUPERADMIN\"\/g \/etc\/$OE_CONFIG.conf\r\nsudo su root -c \"echo 'logfile = \/var\/log\/$OE_USER\/$OE_CONFIG$1.log' >> \/etc\/$OE_CONFIG.conf\"\r\nsudo su root -c \"echo 'addons_path=$OE_HOME_EXT\/addons,$OE_HOME\/custom\/addons' >> \/etc\/$OE_CONFIG.conf\"\r\n\r\necho -e \"* Create startup file\"\r\nsudo su root -c \"echo '#!\/bin\/sh' >> $OE_HOME_EXT\/start.sh\"\r\nsudo su root -c \"echo 'sudo -u $OE_USER $OE_HOME_EXT\/openerp-server --config=\/etc\/$OE_CONFIG.conf' >> $OE_HOME_EXT\/start.sh\"\r\nsudo chmod 755 $OE_HOME_EXT\/start.sh\r\n\r\n#--------------------------------------------------\r\n# Adding ODOO as a deamon (initscript)\r\n#--------------------------------------------------\r\n\r\necho -e \"* Create init file\"\r\necho '#!\/bin\/sh' >> ~\/$OE_CONFIG\r\necho '### BEGIN INIT INFO' >> ~\/$OE_CONFIG\r\necho '# Provides: $OE_CONFIG' >> ~\/$OE_CONFIG\r\necho '# Required-Start: $remote_fs $syslog' >> ~\/$OE_CONFIG\r\necho '# Required-Stop: $remote_fs $syslog' >> ~\/$OE_CONFIG\r\necho '# Should-Start: $network' >> ~\/$OE_CONFIG\r\necho '# Should-Stop: $network' >> ~\/$OE_CONFIG\r\necho '# Default-Start: 2 3 4 5' >> ~\/$OE_CONFIG\r\necho '# Default-Stop: 0 1 6' >> ~\/$OE_CONFIG\r\necho '# Short-Description: Enterprise Business Applications' >> ~\/$OE_CONFIG\r\necho '# Description: ODOO Business Applications' >> ~\/$OE_CONFIG\r\necho '### END INIT INFO' >> ~\/$OE_CONFIG\r\necho 'PATH=\/bin:\/sbin:\/usr\/bin' >> ~\/$OE_CONFIG\r\necho \"DAEMON=$OE_HOME_EXT\/openerp-server\" >> ~\/$OE_CONFIG\r\necho \"NAME=$OE_CONFIG\" >> ~\/$OE_CONFIG\r\necho \"DESC=$OE_CONFIG\" >> ~\/$OE_CONFIG\r\necho '' >> ~\/$OE_CONFIG\r\necho '# Specify the user name (Default: odoo).' >> ~\/$OE_CONFIG\r\necho \"USER=$OE_USER\" >> ~\/$OE_CONFIG\r\necho '' >> ~\/$OE_CONFIG\r\necho '# Specify an alternate config file (Default: \/etc\/openerp-server.conf).' >> ~\/$OE_CONFIG\r\necho \"CONFIGFILE=\\\"\/etc\/$OE_CONFIG.conf\\\"\" >> ~\/$OE_CONFIG\r\necho '' >> ~\/$OE_CONFIG\r\necho '# pidfile' >> ~\/$OE_CONFIG\r\necho 'PIDFILE=\/var\/run\/$NAME.pid' >> ~\/$OE_CONFIG\r\necho '' >> ~\/$OE_CONFIG\r\necho '# Additional options that are passed to the Daemon.' >> ~\/$OE_CONFIG\r\necho 'DAEMON_OPTS=\"-c $CONFIGFILE\"' >> ~\/$OE_CONFIG\r\necho '[ -x $DAEMON ] || exit 0' >> ~\/$OE_CONFIG\r\necho '[ -f $CONFIGFILE ] || exit 0' >> ~\/$OE_CONFIG\r\necho 'checkpid() {' >> ~\/$OE_CONFIG\r\necho '[ -f $PIDFILE ] || return 1' >> ~\/$OE_CONFIG\r\necho 'pid=`cat $PIDFILE`' >> ~\/$OE_CONFIG\r\necho '[ -d \/proc\/$pid ] && return 0' >> ~\/$OE_CONFIG\r\necho 'return 1' >> ~\/$OE_CONFIG\r\necho '}' >> ~\/$OE_CONFIG\r\necho '' >> ~\/$OE_CONFIG\r\necho 'case \"${1}\" in' >> ~\/$OE_CONFIG\r\necho 'start)' >> ~\/$OE_CONFIG\r\necho 'echo -n \"Starting ${DESC}: \"' >> ~\/$OE_CONFIG\r\necho 'start-stop-daemon --start --quiet --pidfile ${PIDFILE} \\' >> ~\/$OE_CONFIG\r\necho '--chuid ${USER} --background --make-pidfile \\' >> ~\/$OE_CONFIG\r\necho '--exec ${DAEMON} -- ${DAEMON_OPTS}' >> ~\/$OE_CONFIG\r\necho 'echo \"${NAME}.\"' >> ~\/$OE_CONFIG\r\necho ';;' >> ~\/$OE_CONFIG\r\necho 'stop)' >> ~\/$OE_CONFIG\r\necho 'echo -n \"Stopping ${DESC}: \"' >> ~\/$OE_CONFIG\r\necho 'start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \\' >> ~\/$OE_CONFIG\r\necho '--oknodo' >> ~\/$OE_CONFIG\r\necho 'echo \"${NAME}.\"' >> ~\/$OE_CONFIG\r\necho ';;' >> ~\/$OE_CONFIG\r\necho '' >> ~\/$OE_CONFIG\r\necho 'restart|force-reload)' >> ~\/$OE_CONFIG\r\necho 'echo -n \"Restarting ${DESC}: \"' >> ~\/$OE_CONFIG\r\necho 'start-stop-daemon --stop --quiet --pidfile ${PIDFILE} \\' >> ~\/$OE_CONFIG\r\necho '--oknodo' >> ~\/$OE_CONFIG\r\necho 'sleep 1' >> ~\/$OE_CONFIG\r\necho 'start-stop-daemon --start --quiet --pidfile ${PIDFILE} \\' >> ~\/$OE_CONFIG\r\necho '--chuid ${USER} --background --make-pidfile \\' >> ~\/$OE_CONFIG\r\necho '--exec ${DAEMON} -- ${DAEMON_OPTS}' >> ~\/$OE_CONFIG\r\necho 'echo \"${NAME}.\"' >> ~\/$OE_CONFIG\r\necho ';;' >> ~\/$OE_CONFIG\r\necho '*)' >> ~\/$OE_CONFIG\r\necho 'N=\/etc\/init.d\/${NAME}' >> ~\/$OE_CONFIG\r\necho 'echo \"Usage: ${NAME} {start|stop|restart|force-reload}\" >&2' >> ~\/$OE_CONFIG\r\necho 'exit 1' >> ~\/$OE_CONFIG\r\necho ';;' >> ~\/$OE_CONFIG\r\necho '' >> ~\/$OE_CONFIG\r\necho 'esac' >> ~\/$OE_CONFIG\r\necho 'exit 0' >> ~\/$OE_CONFIG\r\n\r\necho -e \"* Security Init File\"\r\nsudo mv ~\/$OE_CONFIG \/etc\/init.d\/$OE_CONFIG\r\nsudo chmod 755 \/etc\/init.d\/$OE_CONFIG\r\nsudo chown root: \/etc\/init.d\/$OE_CONFIG\r\n\r\necho -e \"* Change default xmlrpc port\"\r\nsudo su root -c \"echo 'xmlrpc_port = $OE_PORT' >> \/etc\/$OE_CONFIG.conf\"\r\n\r\necho -e \"* Start ODOO on Startup\"\r\nsudo update-rc.d $OE_CONFIG defaults\r\n\r\necho -e \"* Starting Odoo Service\"\r\nsudo su root -c \"\/etc\/init.d\/$OE_CONFIG start\"\r\necho \"-----------------------------------------------------------\"\r\necho \"Done! The Odoo server is up and running. Specifications:\"\r\necho \"Port: $OE_PORT\"\r\necho \"User service: $OE_USER\"\r\necho \"User PostgreSQL: $OE_USER\"\r\necho \"Code location: $OE_USER\"\r\necho \"Addons folder: $OE_USER\/$OE_CONFIG\/addons\/\"\r\necho \"Start Odoo service: sudo service $OE_CONFIG start\"\r\necho \"Stop Odoo service: sudo service $OE_CONFIG stop\"\r\necho \"Restart Odoo service: sudo service $OE_CONFIG restart\"\r\necho \"-----------------------------------------------------------\"\r\n<\/pre>\n
$ sudo chmod +x odoo_install.sh<\/pre>\n
$ sudo .\/odoo_install.sh<\/pre>\n
$ sudo nano \/etc\/odoo-server.conf<\/pre>\n
admin_passwd = UseStrongPassw0rd<\/pre>\n
$ su - postgres\r\n$ psql\r\n$ update pg_database set datallowconn = TRUE where datname = 'template0';\r\n$ \\c template0\r\n$ update pg_database set datistemplate = FALSE where datname = 'template1';\r\n$ drop database template1;\r\n$ create database template1 with template = template0 encoding = 'UTF8';\r\n$ update pg_database set datistemplate = TRUE where datname = 'template1';\r\n$ \\c template1\r\n$ update pg_database set datallowconn = FALSE where datname = 'template0';\r\n$ \\q<\/pre>\n
$ \/etc\/init.d\/postgresql restart<\/pre>\n
$ \/etc\/init.d\/odoo-server restart<\/pre>\n