Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Setting Up OpenERP (Odoo) 9 with Nginx on RHEL/CentOS and Debian/Ubuntu
OpenERP (Odoo) 9 is a comprehensive enterprise resource planning (ERP) system that provides modules for CRM, accounting, inventory, manufacturing, and project management. Setting it up with Nginx as a reverse proxy improves performance by handling static files and load balancing. This guide covers installation on both RHEL/CentOS and Debian/Ubuntu systems.
Installation Methods
| Method | Advantages | Use Case |
|---|---|---|
| Manual Configuration | Full control, customizable settings | Production environments, specific requirements |
| Docker Installation | Containerized, easy scaling, quick setup | Development, testing, cloud deployments |
Manual Configuration
Manual configuration provides complete control over the installation process and allows customization of all parameters. This method involves installing dependencies, configuring PostgreSQL, setting up Odoo, and configuring Nginx as a reverse proxy.
Step 1 Install Dependencies
For RHEL/CentOS:
sudo yum install nginx postgresql-server python3 python3-pip sudo systemctl enable postgresql sudo postgresql-setup initdb
For Debian/Ubuntu:
sudo apt update sudo apt install nginx postgresql postgresql-contrib python3 python3-pip
Step 2 Download and Extract Odoo 9
wget https://github.com/odoo/odoo/archive/9.0.tar.gz tar -xvf 9.0.tar.gz sudo mv odoo-9.0 /opt/odoo
Step 3 Configure PostgreSQL
sudo systemctl start postgresql sudo su - postgres createdb odoo_db createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo_user exit
Step 4 Configure Odoo
cd /opt/odoo sudo cp debian/openerp-server.conf /etc/odoo.conf sudo nano /etc/odoo.conf
Add the following configuration:
[options] db_host = localhost db_port = 5432 db_user = odoo_user db_password = your_password addons_path = /opt/odoo/addons logfile = /var/log/odoo/odoo.log
Step 5 Configure Nginx as Reverse Proxy
sudo nano /etc/nginx/sites-available/odoo
Add the following configuration:
server {
listen 80;
server_name your_domain.com;
location / {
proxy_pass http://127.0.0.1:8069;
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 /web/static/ {
root /opt/odoo/;
expires 1y;
add_header Cache-Control "public, immutable";
}
}
Step 6 Enable and Start Services
sudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/ sudo systemctl enable nginx sudo systemctl start nginx python3 /opt/odoo/odoo-bin -c /etc/odoo.conf &
Docker Installation
Docker installation simplifies the deployment process by using containers. This method provides isolation, easy scaling, and consistent environments across different systems.
Step 1 Install Docker
For Debian/Ubuntu:
sudo apt update sudo apt install docker.io docker-compose sudo systemctl enable docker sudo systemctl start docker
Step 2 Create Docker Network
sudo docker network create odoo_network
Step 3 Run PostgreSQL Container
sudo docker run -d --name postgres_odoo \ --network=odoo_network \ -e POSTGRES_USER=odoo \ -e POSTGRES_PASSWORD=odoo \ -e POSTGRES_DB=postgres \ -v odoo_pg_data:/var/lib/postgresql/data \ postgres:12
Step 4 Run Odoo Container
sudo docker run -d --name odoo_app \ --network=odoo_network \ -p 8069:8069 \ -e HOST=postgres_odoo \ -e USER=odoo \ -e PASSWORD=odoo \ -v odoo_data:/var/lib/odoo \ odoo:9
Step 5 Configure Nginx for Docker
server {
listen 80;
server_name your_domain.com;
location / {
proxy_pass http://localhost:8069;
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 /web/static/ {
proxy_cache_valid 200 60m;
proxy_buffering on;
expires 864000;
proxy_pass http://localhost:8069;
}
}
Firewall Configuration
For RHEL/CentOS:
sudo firewall-cmd --add-service=http --permanent sudo firewall-cmd --reload
For Debian/Ubuntu:
sudo ufw allow 80/tcp sudo ufw enable
Verification
Access your Odoo installation by navigating to http://your_domain.com in a web browser. You should see the Odoo login page. Create a new database and configure your first user to complete the setup.
Conclusion
Setting up OpenERP (Odoo) 9 with Nginx provides a robust ERP solution with improved performance through reverse proxy configuration. The manual method offers full control for production environments, while Docker installation provides containerized deployment benefits. Both approaches result in a scalable, efficient business management system.
