<\/span><\/h2>\n\n\n\nStep by step, we are getting closer to the Odoo installation. Before we install Odoo, we will need to install the PostgreSQL service which is responsible for storing Odoo’s data.<\/p>\n\n\n\n
sudo apt-get install postgresql -y<\/pre>\n\n\n\nOnce installed, start and enable the PostgreSQL service.<\/p>\n\n\n\n
sudo systemctl start postgresql && sudo systemctl enable postgresql<\/pre>\n\n\n\nTo check the status execute the following command:<\/p>\n\n\n\n
sudo systemctl status postgresql<\/pre>\n\n\n\nYou should receive the following output:<\/p>\n\n\n\n
root@host:\/# sudo systemctl status postgresql\n\u25cf postgresql.service - PostgreSQL RDBMS\n Loaded: loaded (\/lib\/systemd\/system\/postgresql.service; enabled; vendor preset: enabled)\n Active: active (exited) since Thu 2023-11-23 03:42:11 CST; 18s ago\n Main PID: 20712 (code=exited, status=0\/SUCCESS)\n CPU: 3ms\n\nNov 23 03:42:11 host.test.vps systemd[1]: Starting PostgreSQL RDBMS...\nNov 23 03:42:11 host.test.vps systemd[1]: Finished PostgreSQL RDBMS.<\/pre>\n\n\n\n<\/span>Step 6. Create Odoo and PostgreSQL users<\/span><\/h2>\n\n\n\nNext we will create Odoo and PostgreSQL users. To create the Odoo user, execute the following command:<\/p>\n\n\n\n
useradd -m -U -r -d \/opt\/odoo17 -s \/bin\/bash odoo17<\/pre>\n\n\n\nSet the user password for odoo17<\/code>:<\/p>\n\n\n\npasswd odoo17\nNew password: YourStrongPasswordHere<\/b>\nRetype new password: YourStrongPasswordHere<\/b>\npasswd: password updated successfully\n<\/pre>\n\n\n\nMake sure to replace YourStrongPasswordHere<\/code> with a strong password. To create a PostgreSQL user, execute the following command:<\/p>\n\n\n\nsudo su - postgres -c \"createuser -s odoo17\"<\/pre>\n\n\n\n<\/span>Step 7. Install and Configure Odoo 17<\/span><\/h2>\n\n\n\nFirst log in as the Odoo user and clone the latest version of Odoo in the \/opt\/<\/code> directory:<\/p>\n\n\n\nsu - odoo17\n\ngit clone https:\/\/www.github.com\/odoo\/odoo --depth 1 --branch 17.0 \/opt\/odoo17\/odoo17<\/pre>\n\n\n\nNext, activate the Python virtual environment and begin installing the Odoo requirements.<\/p>\n\n\n\n
cd \/opt\/odoo17\n\npython3 -m venv odoo17-venv\n\nsource odoo17-venv\/bin\/activate\n\npip install --upgrade pip\n\npip3 install wheel\n\npip3 install -r odoo17\/requirements.txt<\/pre>\n\n\n\nOnce done, deactivate the environment and create the Odoo add-on directories and Odoo log file.<\/p>\n\n\n\n
deactivate\n\nmkdir \/opt\/odoo17\/odoo17-custom-addons\n\nchown -R odoo17:odoo17 \/opt\/odoo17\/odoo17-custom-addons\n\nsudo mkdir -p \/var\/log\/odoo17\n\nsudo touch \/var\/log\/odoo17.log\n\nsudo chown -R odoo17:odoo17 \/var\/log\/odoo17<\/pre>\n\n\n\n