Complete Guide to Installing Odoo 17 on Digital Ocean with Ubuntu 22.04

Complete Guide to Installing Odoo 17 on Digital Ocean with Ubuntu 22.04

Detailed Guide to Installing Odoo 17 on a Digital Ocean Ubuntu 22.04 Droplet

Odoo is a comprehensive and flexible open-source business management software suite that includes a wide range of applications. This guide provides a detailed, step-by-step tutorial on installing Odoo 17 on a Digital Ocean droplet running Ubuntu 22.04.

Prerequisites
Before starting the installation process, ensure you have the following prerequisites:
– A Digital Ocean account.
– A droplet running Ubuntu 22.04.
– Access to the server via SSH.
– Basic knowledge of the command line.
Step-by-Step Installation
 
Step 1: Create an Ubuntu 22.04 Droplet
1. **Log in to Digital Ocean** and create a new droplet with Ubuntu 22.04 as the operating system.
2. **Choose the droplet specifications** based on your company’s size and requirements. For Odoo, a droplet with at least 2GB of RAM is recommended.
3. **Set the authentication method** to a password and ensure you create a secure password (e.g., `PassF@1or17s`).
Step 2: SSH into the Server
Use SSH to connect to your droplet:
bash
ssh root@your_droplet_ip
Step 3: Verify Ubuntu Version
Ensure you are running the correct version of Ubuntu:
bash
lsb_release -a
Step 4: Update and Upgrade the System
Update the package lists and upgrade the system packages:
bash
sudo apt update && sudo apt upgrade -y
Step 5: Create a System User for Odoo
Create a dedicated system user for running Odoo:
bash
sudo adduser –system –home=/opt/odoo –group odoo
Step 6: Install Python and Dependencies
Odoo requires Python 3.10 and some additional dependencies:
bash
sudo apt install python3.10 python3-pip
Step 7: Install Odoo Dependencies
Install all necessary dependencies for Odoo:
bash
sudo apt install build-essential wget git python3-dev python3-venv libfreetype6-dev libxml2-dev libzip-dev libsasl2-dev python3-setuptools libjpeg-dev zlib1g-dev libpq-dev libxslt1-dev libldap2-dev libtiff5-dev libopenjp2-7-dev libffi-dev fontconfig xfonts-75dpi xfonts-base nodejs npm pgcli libxmlsec1-dev libxmlsec1-openssl -y
Step 8: Install PostgreSQL
Odoo uses PostgreSQL as its database:
bash
sudo apt install postgresql -y
sudo su – postgres
createuser –createdb –username postgres –no-createrole –no-superuser –pwprompt odoo
pgcli
ALTER USER odoo WITH SUPERUSER;
\q
exit
Step 9: Install wkhtmltopdf
Odoo requires `wkhtmltopdf` for printing PDF reports:
bash
sudo apt install wkhtmltopdf -y
#### Step 10: Clone the Odoo Repository
Switch to the `odoo` user and clone the Odoo 17 repository:
bash
sudo su – odoo -s /bin/bash
git clone https://www.github.com/odoo/odoo –depth 1 –branch 17.0 –single-branch .
exit
Step 11: Install Odoo
Install required Python packages and Odoo dependencies:
bash
sudo pip3 install –upgrade pip
sudo pip3 install cffi==1.15.0 testresources Pillow==9.0.1 xlrd==1.2.0 reportlab==3.6.8 numpy
sudo pip3 install -r /opt/odoo/requirements.txt
sudo apt-get install -y npm
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo npm install -g less less-plugin-clean-css
sudo apt-get install -y node-less
Step 12: Set Up Odoo Configuration
Create and edit the Odoo configuration file:
bash
sudo cp /opt/odoo/debian/odoo.conf /etc/odoo.conf
sudo nano /etc/odoo.conf
Replace the contents with:
[options]
; This is the password that allows database operations:
admin_passwd = admin
db_host = False
db_port = False
db_user = odoo
db_password = <your_postgresql_password>
addons_path = /opt/odoo/addons
logfile = /var/log/odoo/odoo.log
http_port=8069
Set the appropriate permissions:
bash
sudo chown odoo: /etc/odoo.conf
sudo chmod 640 /etc/odoo.conf
sudo mkdir /var/log/odoo
sudo chown odoo:root /var/log/odoo
 13: Create Odoo Systemd Service
Create a systemd service file for Odoo:
bash
sudo nano /etc/systemd/system/odoo.service
Add the following configuration:
[Unit]
Description=Odoo
Documentation=http://www.odoo.com
[Service]
Type=simple
User=odoo
ExecStart=/opt/odoo/odoo-bin -c /etc/odoo.conf
[Install]
WantedBy=default.target
Set permissions and start the service:
bash
sudo chmod 755 /etc/systemd/system/odoo.service
sudo chown root: /etc/systemd/system/odoo.service
sudo systemctl start odoo.service
sudo systemctl status odoo.service
 14: Access Odoo
Open your web browser and visit the following URL to access Odoo:
http://<your_domain_or_IP_address>:8069
Step 15: Check Odoo Logs
Monitor Odoo logs to ensure everything is running smoothly:
bash
sudo tail -f /var/log/odoo/odoo.log
Step 16: Enable Automatic Start on Boot
Enable the Odoo service to start on system boot:
bash
sudo systemctl enable odoo.service
Conclusion
Congratulations! You have successfully installed Odoo 17 on a Digital Ocean droplet with Ubuntu 22.04. This guide covered the creation of a droplet, installation of necessary dependencies, configuration of PostgreSQL, and setting up Odoo to run as a systemd service. If you encounter any issues, refer to the Odoo logs and adjust the configuration as needed. For additional configurations like enabling Let’s Encrypt SSL and configuring Nginx for performance optimization, you may need to perform further steps not covered in this basic installation guide.

 

For more insights and professional Odoo Community/Enterprise implementations, connect with us at hashcodeit.com or drop an email at [email protected], +971545975212.  Transform your Odoo journey with precision and expertise!

Leave a Reply