Install Multiple Odoo Instances on a Single VPS

Farhan Rashad

Step 1: Update Packages

sudo apt-get update && apt-get -y upgrade
sudo apt-get install git wkhtmltopdf python-pip python-dev \
    python-virtualenv libevent-dev gcc libjpeg-dev libxml2-dev \
    libssl-dev libsasl2-dev node-less libldap2-dev libxslt-dev

Step 2: Install PostgreSQL

apt install postgresql-9.5 postgresql-server-dev-9.5
systemctl enable postgresql.service
systemctl start postgresql.service

Step 3: Create Odoo User

sudo adduser --system --group odoo --home /opt/odoo

Step 4: Create DB User

 su - postgres -c "createuser --createdb --username postgres --no-createrole --no-superuser --no-password odoo"

Step 5: Install 10

sudo su - odoo -s /bin/bash 

Step 6: Clone Odoo branch from github

git clone https://www.github.com/odoo/odoo --depth 1 --branch 10.0 --single-branch /opt/odoo 

Step 7: Install Requirements

cd /opt/odoo10
virtualenv ./venv
source ./venv/bin/activate
pip install -r requirements.txt

Step 8: Exit Odoo User

exit

Step 9: Configure Odoo1

sudo nano /etc/odoo1.conf
[options]
admin_passwd = your_strong_admin_password
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/addons
logfile = /var/log/odoo1.log
xmlrpc_port = 8010

Step 10: Configure Odoo2

sudo nano /etc/odoo2.conf
[options]
admin_passwd = your_strong_admin_password
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/addons
logfile = /var/log/odoo2.log
xmlrpc_port = 8020

Step 11: Create System ID Script1

sudo nano /lib/systemd/system/odoo1.service
[Unit]
Description=Odoo 10
Requires=postgresql.service
After=postgresql.service

[Service]
Type=simple
PermissionsStartOnly=true
User=odoo
Group=odoo
SyslogIdentifier=odoo1
ExecStart=/opt/odoo/venv/bin/python2 /opt/odoo/odoo-bin -c /etc/odoo1.conf

[Install]
WantedBy=multi-user.target

Step 12: Create System ID Script2

sudo nano /lib/systemd/system/odoo2.service
[Unit]
Description=Odoo 10
Requires=postgresql.service
After=postgresql.service

[Service]
Type=simple
PermissionsStartOnly=true
User=odoo
Group=odoo
SyslogIdentifier=odoo2
ExecStart=/opt/odoo/venv/bin/python2 /opt/odoo/odoo-bin -c /etc/odoo2.conf

[Install]
WantedBy=multi-user.target

Step 13: Create System ID Script2

sudo systemctl enable odoo1.service
sudo systemctl enable odoo2.service
 sudo systemctl start odoo1.service
sudo systemctl start odoo2.service

Step 14: Access Odoo

http://your_ip_address:8010
http://your_ip_address:8020
 sudo systemctl start odoo1.service
sudo systemctl start odoo2.service
There are no comments for now.