<\/span><\/h2>\nOr, you can create a file and copy the following code to the new file (for example, \u2018odoo_install.sh\u2019).<\/p>\n
nano odoo_install.sh<\/pre>\n#!\/bin\/bash\n################################################################################\n# Script for installing Odoo V10 on Ubuntu 16.04, 15.04, 14.04 (could be used for other version too)\n# Author: Yenthe Van Ginneken\n#-------------------------------------------------------------------------------\n# This script will install Odoo on your Ubuntu 14.04 server. It can install multiple Odoo instances\n# in one Ubuntu because of the different xmlrpc_ports\n#-------------------------------------------------------------------------------\n# Make a new file:\n# sudo nano odoo-install.sh\n# Place this content in it and then make the file executable:\n# sudo chmod +x odoo-install.sh\n# Execute the script to install Odoo:\n# .\/odoo-install\n################################################################################\n \n##fixed parameters\n#odoo\nOE_USER=\"odoo\"\nOE_HOME=\"\/$OE_USER\"\nOE_HOME_EXT=\"\/$OE_USER\/${OE_USER}-server\"\n#The default port where this Odoo instance will run under (provided you use the command -c in the terminal)\n#Set to true if you want to install it, false if you don't need it or have it already installed.\nINSTALL_WKHTMLTOPDF=\"True\"\n#Set the default Odoo port (you still have to use -c \/etc\/odoo-server.conf for example to use this.)\nOE_PORT=\"8069\"\n#Choose the Odoo version which you want to install. For example: 10.0, 9.0, 8.0, 7.0 or saas-6. When using 'trunk' the master version will be installed.\n#IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 10.0\nOE_VERSION=\"10.0\"\n# Set this to True if you want to install Odoo 10 Enterprise!\nIS_ENTERPRISE=\"False\"\n#set the superadmin password\nOE_SUPERADMIN=\"admin\"\nOE_CONFIG=\"${OE_USER}-server\"\n\n##\n### WKHTMLTOPDF download links\n## === Ubuntu Trusty x64 & x32 === (for other distributions please replace these two links,\n## in order to have correct version of wkhtmltox installed, for a danger note refer to \n## https:\/\/www.odoo.com\/documentation\/8.0\/setup\/install.html#deb ):\nWKHTMLTOX_X64=http:\/\/download.gna.org\/wkhtmltopdf\/0.12\/0.12.1\/wkhtmltox-0.12.1_linux-trusty-amd64.deb\nWKHTMLTOX_X32=http:\/\/download.gna.org\/wkhtmltopdf\/0.12\/0.12.1\/wkhtmltox-0.12.1_linux-trusty-i386.deb\n\n#--------------------------------------------------\n# Update Server\n#--------------------------------------------------\necho -e \"\\n---- Update Server ----\"\nsudo apt-get update\nsudo apt-get upgrade -y\n\n#--------------------------------------------------\n# Install PostgreSQL Server\n#--------------------------------------------------\necho -e \"\\n---- Install PostgreSQL Server ----\"\nsudo apt-get install postgresql -y\n\necho -e \"\\n---- Creating the ODOO PostgreSQL User ----\"\nsudo su - postgres -c \"createuser -s $OE_USER\" 2> \/dev\/null || true\n\n#--------------------------------------------------\n# Install Dependencies\n#--------------------------------------------------\necho -e \"\\n---- Install tool packages ----\"\nsudo apt-get install wget git python-pip gdebi-core -y\n\t\necho -e \"\\n---- Install python packages ----\"\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 python-suds\n\t\necho -e \"\\n---- Install python libraries ----\"\nsudo pip install gdata psycogreen ofxparse XlsxWriter\n\necho -e \"\\n--- Install other required packages\"\nsudo apt-get install node-clean-css -y\nsudo apt-get install node-less -y\nsudo apt-get install python-gevent -y\n\n#--------------------------------------------------\n# Install Wkhtmltopdf if needed\n#--------------------------------------------------\nif [ $INSTALL_WKHTMLTOPDF = \"True\" ]; then\n echo -e \"\\n---- Install wkhtml and place shortcuts on correct place for ODOO 10 ----\"\n #pick up correct one from x64 & x32 versions:\n if [ \"`getconf LONG_BIT`\" == \"64\" ];then\n _url=$WKHTMLTOX_X64\n else\n _url=$WKHTMLTOX_X32\n fi\n sudo wget $_url\n sudo gdebi --n `basename $_url`\n sudo ln -s \/usr\/local\/bin\/wkhtmltopdf \/usr\/bin\n sudo ln -s \/usr\/local\/bin\/wkhtmltoimage \/usr\/bin\nelse\n echo \"Wkhtmltopdf isn't installed due to the choice of the user!\"\nfi\n\t\necho -e \"\\n---- Create ODOO system user ----\"\nsudo adduser --system --quiet --shell=\/bin\/bash --home=$OE_HOME --gecos 'ODOO' --group $OE_USER\n#The user should also be added to the sudo'ers group.\nsudo adduser $OE_USER sudo\n\necho -e \"\\n---- Create Log directory ----\"\nsudo mkdir \/var\/log\/$OE_USER\nsudo chown $OE_USER:$OE_USER \/var\/log\/$OE_USER\n\n#--------------------------------------------------\n# Install ODOO\n#--------------------------------------------------\necho -e \"\\n==== Installing ODOO Server ====\"\nsudo git clone --depth 1 --branch $OE_VERSION https:\/\/www.github.com\/odoo\/odoo $OE_HOME_EXT\/\n\nif [ $IS_ENTERPRISE = \"True\" ]; then\n # Odoo Enterprise install!\n echo -e \"\\n--- Create symlink for node\"\n sudo ln -s \/usr\/bin\/nodejs \/usr\/bin\/node\n sudo su $OE_USER -c \"mkdir $OE_HOME\/enterprise\"\n sudo su $OE_USER -c \"mkdir $OE_HOME\/enterprise\/addons\"\n\n echo -e \"\\n---- Adding Enterprise code under $OE_HOME\/enterprise\/addons ----\"\n sudo git clone --depth 1 --branch 10.0 https:\/\/www.github.com\/odoo\/enterprise \"$OE_HOME\/enterprise\/addons\"\n\n echo -e \"\\n---- Installing Enterprise specific libraries ----\"\n sudo apt-get install nodejs npm\n sudo npm install -g less\n sudo npm install -g less-plugin-clean-css\nelse\n echo -e \"\\n---- Create custom module directory ----\"\n sudo su $OE_USER -c \"mkdir $OE_HOME\/custom\"\n sudo su $OE_USER -c \"mkdir $OE_HOME\/custom\/addons\"\nfi\n\necho -e \"\\n---- Setting permissions on home folder ----\"\nsudo chown -R $OE_USER:$OE_USER $OE_HOME\/*\n\necho -e \"* Create server config file\"\nsudo cp $OE_HOME_EXT\/debian\/odoo.conf \/etc\/${OE_CONFIG}.conf\nsudo chown $OE_USER:$OE_USER \/etc\/${OE_CONFIG}.conf\nsudo chmod 640 \/etc\/${OE_CONFIG}.conf\n\necho -e \"* Change server config file\"\nsudo sed -i s\/\"db_user = .*\"\/\"db_user = $OE_USER\"\/g \/etc\/${OE_CONFIG}.conf\nsudo sed -i s\/\"; admin_passwd.*\"\/\"admin_passwd = $OE_SUPERADMIN\"\/g \/etc\/${OE_CONFIG}.conf\nsudo su root -c \"echo '[options]' >> \/etc\/${OE_CONFIG}.conf\"\nsudo su root -c \"echo 'logfile = \/var\/log\/$OE_USER\/$OE_CONFIG$1.log' >> \/etc\/${OE_CONFIG}.conf\"\nif [ $IS_ENTERPRISE = \"True\" ]; then\n sudo su root -c \"echo 'addons_path=$OE_HOME\/enterprise\/addons,$OE_HOME_EXT\/addons' >> \/etc\/${OE_CONFIG}.conf\"\nelse\n sudo su root -c \"echo 'addons_path=$OE_HOME_EXT\/addons,$OE_HOME\/custom\/addons' >> \/etc\/${OE_CONFIG}.conf\"\nfi\n\necho -e \"* Create startup file\"\nsudo su root -c \"echo '#!\/bin\/sh' >> $OE_HOME_EXT\/start.sh\"\nsudo su root -c \"echo 'sudo -u $OE_USER $OE_HOME_EXT\/openerp-server --config=\/etc\/${OE_CONFIG}.conf' >> $OE_HOME_EXT\/start.sh\"\nsudo chmod 755 $OE_HOME_EXT\/start.sh\n\n#--------------------------------------------------\n# Adding ODOO as a deamon (initscript)\n#--------------------------------------------------\n\necho -e \"* Create init file\"\ncat < ~\/$OE_CONFIG\n#!\/bin\/sh\n### BEGIN INIT INFO\n# Provides: $OE_CONFIG\n# Required-Start: \\$remote_fs \\$syslog\n# Required-Stop: \\$remote_fs \\$syslog\n# Should-Start: \\$network\n# Should-Stop: \\$network\n# Default-Start: 2 3 4 5\n# Default-Stop: 0 1 6\n# Short-Description: Enterprise Business Applications\n# Description: ODOO Business Applications\n### END INIT INFO\nPATH=\/bin:\/sbin:\/usr\/bin\nDAEMON=$OE_HOME_EXT\/odoo-bin\nNAME=$OE_CONFIG\nDESC=$OE_CONFIG\n# Specify the user name (Default: odoo).\nUSER=$OE_USER\n# Specify an alternate config file (Default: \/etc\/openerp-server.conf).\nCONFIGFILE=\"\/etc\/${OE_CONFIG}.conf\"\n# pidfile\nPIDFILE=\/var\/run\/\\${NAME}.pid\n# Additional options that are passed to the Daemon.\nDAEMON_OPTS=\"-c \\$CONFIGFILE\"\n[ -x \\$DAEMON ] || exit 0\n[ -f \\$CONFIGFILE ] || exit 0\ncheckpid() {\n[ -f \\$PIDFILE ] || return 1\npid=\\`cat \\$PIDFILE\\`\n[ -d \/proc\/\\$pid ] && return 0\nreturn 1\n}\ncase \"\\${1}\" in\nstart)\necho -n \"Starting \\${DESC}: \"\nstart-stop-daemon --start --quiet --pidfile \\$PIDFILE \\\n--chuid \\$USER --background --make-pidfile \\\n--exec \\$DAEMON -- \\$DAEMON_OPTS\necho \"\\${NAME}.\"\n;;\nstop)\necho -n \"Stopping \\${DESC}: \"\nstart-stop-daemon --stop --quiet --pidfile \\$PIDFILE \\\n--oknodo\necho \"\\${NAME}.\"\n;;\nrestart|force-reload)\necho -n \"Restarting \\${DESC}: \"\nstart-stop-daemon --stop --quiet --pidfile \\$PIDFILE \\\n--oknodo\nsleep 1\nstart-stop-daemon --start --quiet --pidfile \\$PIDFILE \\\n--chuid \\$USER --background --make-pidfile \\\n--exec \\$DAEMON -- \\$DAEMON_OPTS\necho \"\\${NAME}.\"\n;;\n*)\nN=\/etc\/init.d\/\\$NAME\necho \"Usage: \\$NAME {start|stop|restart|force-reload}\" >&2\nexit 1\n;;\nesac\nexit 0\nEOF\n\necho -e \"* Security Init File\"\nsudo mv ~\/$OE_CONFIG \/etc\/init.d\/$OE_CONFIG\nsudo chmod 755 \/etc\/init.d\/$OE_CONFIG\nsudo chown root: \/etc\/init.d\/$OE_CONFIG\n\necho -e \"* Change default xmlrpc port\"\nsudo su root -c \"echo 'xmlrpc_port = $OE_PORT' >> \/etc\/${OE_CONFIG}.conf\"\n\necho -e \"* Start ODOO on Startup\"\nsudo update-rc.d $OE_CONFIG defaults\n\necho -e \"* Starting Odoo Service\"\nsudo su root -c \"\/etc\/init.d\/$OE_CONFIG start\"\necho \"-----------------------------------------------------------\"\necho \"Done! The Odoo server is up and running. Specifications:\"\necho \"Port: $OE_PORT\"\necho \"User service: $OE_USER\"\necho \"User PostgreSQL: $OE_USER\"\necho \"Code location: $OE_USER\"\necho \"Addons folder: $OE_USER\/$OE_CONFIG\/addons\/\"\necho \"Start Odoo service: sudo service $OE_CONFIG start\"\necho \"Stop Odoo service: sudo service $OE_CONFIG stop\"\necho \"Restart Odoo service: sudo service $OE_CONFIG restart\"\necho \"-----------------------------------------------------------\"<\/pre>\n