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.
Create an Ubuntu 22.04 Droplet
Log in to Digital Ocean and create a new droplet with Ubuntu 22.04 as the operating system.
Choose the droplet specifications based on your company’s size and requirements. For Odoo, a droplet with at least 2GB of RAM is recommended.
Set the authentication method to a password and ensure you create a secure password (e.g., `PassF@1or17s`).
Use SSH to connect to your droplet
ssh root@your_droplet_ip
Update the package lists and upgrade the system packages
$ sudo apt update && sudo apt upgrade -y
sudo adduser –system –home=/opt/odoo –group odoo
sudo apt install python3.10 python3-pip
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
sudo apt install wkhtmltopdf -y
Database installation and configuration
$ sudo su – postgres
createuser –createdb –username postgres –no-createrole –no-superuser –pwprompt odoo
pgcli
ALTER USER odoo WITH SUPERUSER;
\q
exit
$ sudo adduser –system –home=/opt/odoo –group odoo
Install Odoo
$ sudo su – odoo -s /bin/bash
git clone https://www.github.com/odoo/odoo –depth 1 –branch 17.0 –single-branch .
exit
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
Set Up Odoo Configuration
$ 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
$ sudo chown odoo: /etc/odoo.conf
sudo chmod 640 /etc/odoo.conf
sudo mkdir /var/log/odoo
sudo chown odoo:root /var/log/odoo
Create a systemd service file for Odoo
$ sudo nano /etc/systemd/system/odoo.service
[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
$ 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
Open your web browser and visit the following URL to access Odoo
http://<your_domain_or_IP_address>:8069
Enable the Odoo service to start on system boot:
$ sudo systemctl enable odoo.service
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.
Advertisement
Sign up for a Digital Ocean account using the following link: https://m.do.co/c/5104f438ca06. This link provides you with a generous $200 USD credit.