Enable Dark Mode!
how-to-setup-two-versions-of-odoo-in-the-same-server-with-one-domain-and-ssl.jpg
By: Sonu S

How to Setup Two Versions of Odoo in the Same Server With One Domain & SSL

Technical Odoo Enterprises Odoo Community

Odoo stands as a cornerstone in the realm of enterprise resource planning (ERP) and customer relationship management (CRM), renowned for its open-source nature and versatile functionalities. Esteemed by businesses worldwide, Odoo serves as a comprehensive solution for efficiently managing diverse operational facets. However, certain situations may necessitate the deployment of multiple Odoo versions on a singular server. Such instances could arise from managing distinct projects, each with unique prerequisites, or conducting rigorous testing of novel features while upholding operational stability in production environments.
This comprehensive guide aims to meticulously navigate the intricate process of configuring two Odoo versions concurrently on a solitary server, seamlessly unified under a single domain. Additionally, paramount importance is accorded to ensuring secure access via SSL encryption, fortifying the system against potential vulnerabilities, and safeguarding sensitive data. Through a methodical approach, we shall embark on a journey to orchestrate the harmonious coexistence of multiple Odoo instances, thereby empowering businesses with enhanced flexibility and operational agility.
Firstly, need to install both versions from the official Odoo website or use package managers available for your operating system. Ensure each version is installed in its separate directory. This organization simplifies management and reduces the risk of conflicts between versions, setting the stage for the smooth operation of multiple Odoo instances.
Each Odoo instance must listen on a different port. Locate the configuration files for each Odoo instance (typically located at /etc/odoo/odoo.conf or /etc/odoo.conf) and set the xmlrpc_port option to unique ports for each instance.
[options]
; Set the port for Odoo version 1
xmlrpc_port = 8069
; Set the port for Odoo version 2
xmlrpc_port = 8070
Obtain SSL certificates for your domain. You can use Let's Encrypt to obtain free SSL certificates. Install Certbot to automate the certificate issuance process. 
Then install ngnix and configure ngnix
sudo apt update
sudo apt install nginx
For further information about SSL and NGINX configuration details you can check our blog How to Configure SSL Certificate in Nginx for an Odoo Instance
Nginx configuration file for your domain. You can create a file like 
/etc/nginx/sites-available/odoo.conf, The example of configuration is given below
server {
    listen 443 ssl;
    server_name custom-domain.com;
    ssl_certificate /path/to/fullchain.pem;
    ssl_certificate_key /path/to/privkey.pem;
    location /odoo1 {
        proxy_pass http://127.0.0.1:8069;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }


    location /odoo2 {
        proxy_pass http://127.0.0.1:8070;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
Create a symbolic link from the configuration file in sites-available to sites-enabled:
sudo ln -s /etc/nginx/sites-available/odoo.conf /etc/nginx/sites-enabled/
Then test the NGINX configuration by following the command
sudo nginx -t
Then restart the nginx to apply the new configuration:
sudo systemctl restart nginx
You can now access each Odoo instance using URLs like https://custom-domain.com/odoo1 and https://custom-domain.com/odoo2.
In conclusion, setting up two versions of Odoo on the same server under one domain with SSL encryption offers a streamlined solution for businesses seeking enhanced flexibility and efficiency in managing their ERP and CRM systems. By meticulously configuring each Odoo instance to operate on distinct ports and utilizing Nginx as a reverse proxy to route traffic, organizations can seamlessly access their Odoo deployments through a unified domain while ensuring data security through SSL encryption. This setup enables businesses to effectively manage multiple projects or conduct testing without compromising operational stability. With careful implementation and adherence to best practices, businesses can leverage the power of Odoo to optimize their operations and drive growth.


If you need any assistance in odoo, we are online, please chat with us.



0
Comments



Leave a comment



whatsapp
location

Calicut

Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635

location

Kochi

Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.

location

Bangalore

Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message