Steps to install odoo community on a VPS

June 17, 2024 by
Dow Group
| No comments yet

Yes, you can install Odoo Community on a VPS (Virtual Private Server). Here’s a step-by-step guide on how to do it:

Prerequisites

Before starting, make sure you have:

  • A VPS with a supported Linux distribution (Ubuntu is commonly used).
  • Root or sudo access to the VPS.
  • Basic knowledge of command-line operations.

Step-by-Step Installation Guide

Step 1: Update Your Server

First, ensure that your server is up to date.

bashCopy codesudo apt update
sudo apt upgrade -y

Step 2: Install Dependencies

Odoo requires several dependencies. Install them with the following commands:

bashCopy codesudo apt install -y python3-pip build-essential wget python3-dev python3-venv \
libpq-dev libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev \
libjpeg-dev libssl-dev libffi-dev

Step 3: Install and Configure PostgreSQL

Odoo uses PostgreSQL as its database management system.

bashCopy codesudo apt install -y postgresql
sudo su - postgres
createuser --createdb --username postgres --no-createrole --no-superuser odoo
exit

Step 4: Install Wkhtmltopdf

Wkhtmltopdf is needed for generating PDF reports in Odoo.

bashCopy codesudo apt install -y xfonts-75dpi
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb
sudo dpkg -i wkhtmltox_0.12.6-1.bionic_amd64.deb
sudo apt -f install

Step 5: Install Odoo

Download and install Odoo from the official repository.

bashCopy codesudo wget -O - https://nightly.odoo.com/odoo.key | apt-key add -
echo "deb http://nightly.odoo.com/16.0/nightly/deb/ ./" | sudo tee /etc/apt/sources.list.d/odoo.list
sudo apt update
sudo apt install -y odoo

Step 6: Configure Odoo

Edit the Odoo configuration file to match your needs.

bashCopy codesudo nano /etc/odoo/odoo.conf

Make necessary changes such as database connection details, port, etc.

Step 7: Start Odoo Service

Start and enable the Odoo service to run on boot.

bashCopy codesudo systemctl start odoo
sudo systemctl enable odoo

Step 8: Access Odoo

Open a web browser and navigate to http://<your-server-IP>:8069 to access the Odoo web interface.

Optional: Install Nginx as a Reverse Proxy

For a more production-ready setup, you might want to set up Nginx as a reverse proxy to handle HTTP requests.

bashCopy codesudo apt install nginx
sudo nano /etc/nginx/sites-available/odoo

Add the following configuration to the file:

nginxCopy codeserver {
    listen 80;
    server_name your_domain.com;

    proxy_read_timeout 720s;
    proxy_connect_timeout 720s;
    proxy_send_timeout 720s;

    # Add Headers for odoo proxy mode
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;

    # log
    access_log /var/log/nginx/odoo.access.log;
    error_log /var/log/nginx/odoo.error.log;

    # Redirect requests to odoo backend server
    location / {
        proxy_pass http://127.0.0.1:8069;
        proxy_redirect off;
    }

    # common gzip
    gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;
    gzip on;
}

Enable the configuration and restart Nginx:

bashCopy codesudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/
sudo systemctl restart nginx

Conclusion

By following these steps, you can successfully install and configure Odoo Community Edition on a VPS. This setup allows you to leverage the full capabilities of Odoo 17, ensuring a robust and efficient ERP solution tailored to your business needs.

Dow Group June 17, 2024
Share this post
Tags
Archive
Sign in to leave a comment