To install Odoo 15 on Ubuntu 20.04, install its system dependencies and PostgreSQL, create a dedicated Odoo user, configure a Python virtual environment, install the required Python packages, and run Odoo as a systemd service. This guide covers the complete source installation process for deploying Odoo on an Ubuntu VPS or dedicated server. Whether you manage your own infrastructure or use a USA hosting provider, proper database configuration, service management, and security settings are essential for reliable Odoo hosting.
Prerequisites
Before installing Odoo 15, prepare the following:
- Operating system: Ubuntu 20.04 LTS
- Resources: At least 2 CPU cores and 2 GB RAM for basic testing; production workloads may require more.
- Access: SSH access to the server
- Permissions: A user with
sudoprivileges
Odoo integrates CRM, accounting, inventory, e-commerce, project management, and other business applications. A suitable server hosting environment helps maintain application performance as the number of users and installed modules grows.
Step 1. Connect to the Ubuntu VPS
Connect to your Ubuntu server through SSH:
ssh username@IP_Address -p Port_numberReplace username, IP_Address, and Port_number with your actual connection details.
Step 2. Update Ubuntu Packages
Update the package lists and install available package updates:
sudo apt update
sudo apt upgrade -yKeeping system packages updated helps reduce security risks in your Odoo hosting environment.
Step 3. Install Odoo Dependencies
Install Git, Python development tools, PostgreSQL libraries, and the system packages required to build Odoo's Python dependencies:
sudo apt install -y git python3-pip python3-dev python3-venv \
python3-wheel python3-setuptools build-essential wget node-less \
libfreetype6-dev libxml2-dev libzip-dev libldap2-dev libsasl2-dev \
libjpeg-dev zlib1g-dev libpq-dev libxslt1-dev libtiff5-dev \
libopenjp2-7-dev liblcms2-dev libwebp-dev libharfbuzz-dev \
libfribidi-dev libxcb1-devThese dependencies support Python modules, database connectivity, image processing, and other Odoo features.
Step 4. Create a Dedicated Odoo User
Create a separate system account to run Odoo instead of running the application as root:
sudo useradd -m -d /opt/odoo15 -U -r -s /bin/bash odoo15This creates the odoo15 user and its home directory at /opt/odoo15.
Using a dedicated account improves isolation and is recommended for production server hosting.
Step 5. Install and Configure PostgreSQL
Odoo uses PostgreSQL as its database management system. Install PostgreSQL:
sudo apt install -y postgresql postgresql-client
sudo systemctl enable --now postgresqlCreate a PostgreSQL role for Odoo:
sudo -u postgres createuser -d odoo15The -d option allows the role to create databases, which is useful when managing databases through Odoo. It does not grant full PostgreSQL superuser privileges.
The matching Linux and PostgreSQL usernames allow local peer authentication to work with the default configuration on a typical Ubuntu installation.
Step 6. Install wkhtmltopdf
Odoo uses wkhtmltopdf to generate PDF reports. For Odoo 15, use a compatible build with the required Qt patches so that report headers and footers render correctly.
Download the Ubuntu 20.04 AMD64 package:
cd /tmp
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.focal_amd64.debInstall the downloaded package:
sudo apt install -y ./wkhtmltox_0.12.5-1.focal_amd64.debVerify the installation:
wkhtmltopdf --versionIf the package is unavailable or incompatible with your architecture, consult the Odoo wkhtmltopdf guidance before choosing an alternative.
Step 7. Download Odoo 15 and Create a Python Virtual Environment
Switch to the dedicated Odoo account:
sudo -u odoo15 -H bashClone the Odoo 15 source code:
git clone https://github.com/odoo/odoo.git --depth 1 --branch 15.0 /opt/odoo15/odooCreate a Python virtual environment:
cd /opt/odoo15
python3 -m venv odoo-venvActivate it:
source /opt/odoo15/odoo-venv/bin/activateA virtual environment keeps Odoo's Python dependencies separate from system-wide packages, making the installation easier to maintain.
Step 8. Install Python Dependencies
With the virtual environment activated, install the required packages:
pip install --upgrade pip wheel
pip install -r /opt/odoo15/odoo/requirements.txtWait for the installation to finish. If a package fails to build, review the error and verify that the required system libraries are installed.
Deactivate the virtual environment when finished:
deactivate
exitStep 9. Create a Custom Addons Directory
Create a separate directory for third-party modules:
sudo -u odoo15 mkdir -p /opt/odoo15/odoo-custom-addonsThis directory will be added to the addons_path configuration so Odoo can load custom modules without modifying the core source code.
Step 10. Configure Odoo
Create the configuration file:
sudo nano /etc/odoo15.confAdd the following settings:
[options]
admin_passwd = REPLACE_WITH_A_STRONG_MASTER_PASSWORD
db_host = False
db_port = False
db_user = odoo15
db_password = False
http_port = 8060
logfile = /var/log/odoo15/odoo.log
logrotate = True
addons_path = /opt/odoo15/odoo/addons,/opt/odoo15/odoo-custom-addonsReplace the master password with a strong, unique value. The admin_passwd setting protects database management operations and is different from the password used to log in to the Odoo web interface.
The database settings above assume PostgreSQL is running locally and peer authentication is configured appropriately.
Create the log directory and assign ownership to the Odoo user:
sudo mkdir -p /var/log/odoo15
sudo chown odoo15:odoo15 /var/log/odoo15
sudo chmod 640 /etc/odoo15.confThe configuration file contains sensitive information, so restrict access to it.
Step 11. Create a systemd Service
Create a service file:
sudo nano /etc/systemd/system/odoo15.serviceAdd the following configuration:
[Unit]
Description=Odoo 15
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
User=odoo15
Group=odoo15
WorkingDirectory=/opt/odoo15/odoo
ExecStart=/opt/odoo15/odoo-venv/bin/python3 /opt/odoo15/odoo/odoo-bin -c /etc/odoo15.conf
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.targetSave the file and reload systemd:
sudo systemctl daemon-reloadEnable and start Odoo:
sudo systemctl enable --now odoo15Check the service status:
sudo systemctl status odoo15To inspect service logs:
sudo journalctl -u odoo15 -n 100 --no-pagerIf the service fails to start, review the logs for Python dependency errors, PostgreSQL authentication problems, or configuration issues.
Step 12. Access and Test Odoo
Open a browser and visit:
http://YOUR_SERVER_IP:8060
Replace YOUR_SERVER_IP with your server's IP address.
If you cannot access the page, verify that Odoo is running and listening on port 8060. Check UFW and any external firewall provided by your hosting provider. Only expose the required ports.
For production use, configure HTTPS through a reverse proxy such as Nginx, restrict database management access, and avoid exposing PostgreSQL directly to the internet.
Conclusion
You have installed Odoo 15 on Ubuntu 20.04 using a Python virtual environment, PostgreSQL, and a systemd service. The installation provides a foundation for deploying CRM, inventory, accounting, and other integrated business applications.
For production Odoo hosting, use adequate server resources, maintain secure database permissions, configure HTTPS, and establish regular backups. Ubuntu 20.04 and Odoo 15 are older releases, so assess their current support status and plan upgrades before deploying a new production system.
If you need a server for Odoo or other business applications, explore Database Mart's Ubuntu VPS Hosting. When comparing a USA hosting provider with other server hosting options, consider performance, backup policies, security, and technical support alongside the monthly price.