Guide: Installing Odoo on CentOS 7

Odoo, which was previously referred to as OpenERP, serves as a comprehensive business management solution. It delivers a vast selection of applications, including billing, accounting, inventory control, project oversight, and numerous others.

Requirements

  • An up-and-running server with CentOS 7 installed.
  • Access to a sudo-enabled user account.

Step 1: System Update

Prior to adding any new software packages to your CentOS server, it is advisable to refresh the system. Connect via the sudo user account and execute the following commands to update:

sudo yum -y update
sudo reboot

After the server restarts, sign back in as the sudo user to move forward with the installation process.

Step 2: PostgreSQL Installation and Setup

Next, you will need to set up PostgreSQL, which serves as Odoo’s primary database system.

sudo yum install -y postgresql-server

Initialize the database, activate PostgreSQL, and configure it to automatically launch during system boot:

sudo postgresql-setup initdb
sudo systemctl start postgresql

Step 3: Odoo Installation

It is now time to install Odoo itself:

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo=https://nightly.odoo.com/10.0/nightly/rpm/odoo.repo
sudo yum install -y odoo

Activate the Odoo service and ensure it launches automatically with the server:

sudo systemctl enable odoo
sudo systemctl start odoo

Lastly, adjust the firewall settings to permit access to Odoo through port 8069:

sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --zone=public --permanent --add-port=8069/tcp
sudo firewall-cmd --reload

 

 

Step 4: Odoo Configuration

Odoo can now be accessed through your browser by visiting the URL:

http://[your-instance-IP]:8069

Substitute [your-instance-IP] with your actual server IP address. Remember to include port 8069 in the URL.

Choose a name for the new database that Odoo will generate, provide your email address, and create a password for the administrator account. Then, click the Create database button to proceed.

After successful database creation, you will be taken to the Odoo dashboard where you can install apps and customize your system settings.

Step 5: Install Nginx for Easier Access

To simplify user access, you can redirect traffic from the default HTTP port (80) and HTTPS port (443) to Odoo’s port 8069. This setup eliminates the need for users to manually specify the port number. Using Nginx also allows you to secure Odoo with an SSL certificate; instructions for adding SSL to Nginx are available separately.

Begin by installing Nginx:

Edit the Nginx configuration file using a text editor like nano:

sudo nano /etc/nginx/nginx.conf

Locate the location block in the configuration file:

Modify it to include the following settings:

location / {
    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;
}

Restart Nginx and configure it to start automatically with the system:

sudo systemctl restart nginx
sudo systemctl enable nginx

After completing these steps, you can reach your Odoo instance either via port 8069 or directly through port 80:

  • http://[your-instance-IP]:8069
  • http://[your-instance-IP]

 

 

Conclusion

By following the steps outlined above, you have successfully installed and configured Odoo on a CentOS 7 server. With PostgreSQL handling your database management, and Nginx set up to streamline user access, your Odoo environment is now ready for use. You can further enhance your system by installing additional Odoo apps and securing your setup with SSL encryption for even greater protection.

Source: vultr.com

Create a Free Account

Register now and get access to our Cloud Services.

Posts you might be interested in: