Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
sudo adduser --system --quiet --shell=/bin/bash --home=/home/odoo --gecos 'odoo' --group odoo
sudo usermod -a -G adm,sudo odoo
sudo mkdir /etc/odoo && sudo mkdir /opt/odoo && sudo mkdir /var/log/odoo/
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install postgresql postgresql-server-dev-9.5 build-essential python-imaging python-lxml python-ldap python-dev libldap2-dev libsasl2-dev npm nodejs git python-setuptools libxml2-dev libxslt1-dev libjpeg-dev python-pip gdebi -y
git clone --depth=1 --branch=10.0 https://github.com/odoo/odoo.git /opt/odoo/server
sudo chown odoo:odoo /opt/odoo/ -R && sudo chown odoo:odoo /var/log/odoo/ -R && cd /opt/odoo/server && sudo pip install --upgrade pip && sudo pip install -r requirements.txt
sudo npm install -g less less-plugin-clean-css -y && sudo ln -s /usr/bin/nodejs /usr/bin/node
cd /tmp && wget https://downloads.wkhtmltopdf.org/0.12/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb && sudo gdebi -n wkhtmltox-0.12.2.1_linux-trusty-amd64.deb && rm wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin/ && sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin/
wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz && sudo gunzip GeoLiteCity.dat.gz && sudo mkdir /usr/share/GeoIP/ && sudo mv GeoLiteCity.dat /usr/share/GeoIP/
sudo su - postgres -c "createuser -sP odoo10"
sudo su - odoo -c "/opt/odoo/server/odoo-bin --addons-path=/opt/odoo/server/addons -s --stop-after-init"
sudo mv /home/odoo/.odoorc /etc/odoo/odoo-server.conf
sudo sed -i "s,^\(logfile = \).*,\1"/var/log/odoo/odoo-server.log"," /etc/odoo/odoo-server.conf
sudo sed -i "s,^\(logrotate = \).*,\1"True"," /etc/odoo/odoo-server.conf
sudo sed -i "s,^\(proxy_mode = \).*,\1"True"," /etc/odoo/odoo-server.conf
sudo cp /opt/odoo/server/debian/init /etc/init.d/odoo-server && sudo chmod +x /etc/init.d/odoo-server
# sudo ln -s /opt/odoo/server/odoo-bin /usr/bin/odoo
sudo update-rc.d -f odoo-server defaults
sudo service odoo-server start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment