ssh root@IP_ADDRESS -p PORT_NUMBER<\/code><\/p>\nReplace IP_ADRRESS and PORT_NUMBER with the values for your VPS. IP_ADDRESS is required, and PORT_NUMBER is 22 by default, but may be different depending on your setup.<\/p>\n
Next, run the following commands to upgrade all installed packages on your VPS:<\/p>\n
dnf update -y<\/code><\/p>\nOnce all the packages are updated, restart your system to apply the changes. This ensures a clean slate on which we’ll be installing our Odoo instance.<\/p>\n
<\/span>Install Required Dependencies<\/span><\/h2>\nFirst, you will need to install Python package and other Odoo dependencies in your system. You can install all of them using the following command:<\/p>\n
dnf install python3 python3-devel git gcc redhat-rpm-config libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel curl unzip -y<\/code><\/p>\nOnce all the packages are installed, you will need to install wkhtmltopdf package in your system. Wkhtmltopdf is an open-source tool that can be used to converts the HTML format to PDF so that Odoo can print PDF reports.<\/p>\n
You can install it by running the following command:<\/p>\n
dnf install https:\/\/github.com\/wkhtmltopdf\/wkhtmltopdf\/releases\/download\/0.12.5\/wkhtmltox-0.12.5-1.centos8.x86_64.rpm<\/code><\/p>\nOnce you are finished, you can proceed to the next step.<\/p>\n
<\/span>Install and Configure PostgreSQL<\/span><\/h2>\nOdoo uses PostgreSQL to store its data. You can install the PostgreSQL server with the following command:<\/p>\n
dnf install postgresql postgresql-server postgresql-contrib -y<\/code><\/p>\nOnce the installation is completed, initialize the database with the following command:<\/p>\n
postgresql-setup initdb<\/code><\/p>\nYou should get the following output:<\/p>\n
* Initializing database in '\/var\/lib\/pgsql\/data'
\n* Initialized, logs are in \/var\/lib\/pgsql\/initdb_postgresql.log
\n<\/code>
\nNext, start the PostgreSQL service and enable it to start at boot with the following command:<\/p>\nsystemctl start postgresql
\nsystemctl enable postgresql<\/code><\/p>\nNext, log in to the PostgreSQL shell and create a new PostgreSQL user with the following command:<\/p>\n
su - postgres -c \"createuser -s odoo13\"<\/code><\/p>\n<\/span>Install and Configure Odoo 13<\/span><\/h2>\nBefore starting, create a separate user in CentOS which we’ll use to run the Odoo service.<\/p>\n
useradd -m -U -r -d \/opt\/odoo13 -s \/bin\/bash odoo13<\/code><\/p>\nNote<\/strong> : Make sure the username must be the same as PostgreSQL user.<\/p>\nNext, log in with your odoo13 user and download Odoo 13 from the GitHub repository:<\/p>\n
su - odoo13
\ngit clone https:\/\/www.github.com\/odoo\/odoo --depth 1 --branch 13.0 \/opt\/odoo13\/odoo<\/code><\/p>\nYou should get the following output:
\n
\nCloning into '\/opt\/odoo13\/odoo'...
\nwarning: redirecting to https:\/\/github.com\/odoo\/odoo.git\/
\nremote: Enumerating objects: 28242, done.
\nremote: Counting objects: 100% (28242\/28242), done
\nremote: Compressing objects: 100% (23893\/23893), done.
\nReceiving objects: 96% (27370\/28242), 110.95 MiB | 13.39 MiB\/s
\nremote: Total 28242 (delta 8481), reused 10433 (delta 3462), pack-reused 0
\nReceiving objects: 100% (28242\/28242), 120.16 MiB | 9.46 MiB\/s, done.
\nResolving deltas: 100% (8481\/8481), done.
\nChecking out files: 100% (25288\/25288), done.
\n<\/code>
\nNext, change your current working directory to \/opt\/odoo13<\/code> and create a new Python virtual environment with the following command:<\/p>\ncd \/opt\/odoo13
\npython3 -m venv odooenv<\/code><\/p>\nNext, activate the virtual environment with the following command:<\/p>\n
source odooenv\/bin\/activate<\/code><\/p>\nOnce that is done, install all required Python modules with the following command:<\/p>\n
pip3 install -r odoo\/requirements.txt<\/code><\/p>\nAfter installing all modules, deactivate the environment with the following command:<\/p>\n
deactivate<\/code><\/p>\nNext, create a new directory to store the custom addons:<\/p>\n
mkdir \/opt\/odoo13\/odoo-custom-addons<\/code><\/p>\nFrom there, exit from the Odoo13 user with the following command:
\nexit<\/code><\/p>\nFinally, create a new Odoo 13 configuration file with your database details, master password and addons path:<\/p>\n
nano \/etc\/odoo13.conf<\/code><\/p>\nAdd the following lines to the file:<\/p>\n
[options]
\nadmin_passwd = your-secure-password<\/span>
\ndb_host = False
\ndb_port = False
\ndb_user = odoo13
\ndb_password = False
\naddons_path = \/opt\/odoo13\/odoo\/addons, \/opt\/odoo13\/odoo-custom-addons<\/code><\/p>\nMake sure you set a strong password. Save and close the file.<\/p>\n
<\/span>Create a Systemd Unit File for Odoo 13<\/span><\/h2>\nUsing systemd to easily start and stop your Odoo instance is very convenient. This step is not mandatory, but it adds a great quality-of-life feature that is nice to have, and it makes managing Odoo that much easier.<\/p>\n
You can create the service with the following command:<\/p>\n
nano \/etc\/systemd\/system\/odoo13.service<\/code><\/p>\nOpen the file, and add the following lines:<\/p>\n
[Unit]
\nDescription=Odoo13
\nRequires=postgresql.service
\nAfter=network.target postgresql.service
\n[Service]
\nType=simple
\nSyslogIdentifier=odoo13
\nPermissionsStartOnly=true
\nUser=odoo13
\nGroup=odoo13
\nExecStart=\/opt\/odoo13\/venv\/bin\/python3 \/opt\/odoo13\/odoo\/odoo-bin -c \/etc\/odoo13.conf
\nStandardOutput=journal+console
\n[Install]
\nWantedBy=multi-user.target
\n<\/code>
\nSave and close the file then reload the systemd daemon with the following command:<\/p>\nsystemctl daemon-reload<\/code><\/p>\nNext, start the Odoo 13 service and enable it to start at boot with the following command:<\/p>\n
systemctl start odoo13
\nsystemctl enable odoo13<\/code><\/p>\nYou can verify the status of Odoo 13 with the following command:<\/p>\n
systemctl status odoo13<\/code><\/p>\nYou should get the following output:
\n
\n\u25cf odoo13.service - Odoo13
\nLoaded: loaded (\/etc\/systemd\/system\/odoo13.service; enabled; vendor preset: disabled)
\nActive: active (running) since Sun 2020-05-24 08:35:45 EDT; 3s ago
\nMain PID: 23874 (python3)
\nTasks: 4 (limit: 25028)
\nMemory: 60.8M
\nCGroup: \/system.slice\/odoo13.service
\n\u2514\u250023874 \/opt\/odoo13\/venv\/bin\/python3 \/opt\/odoo13\/odoo\/odoo-bin -c \/etc\/odoo13.conf
\nMay 24 08:35:45 centos8 systemd[1]: Started Odoo13.
\nMay 24 08:35:46 centos8 odoo13[23874]: \/opt\/odoo13\/venv\/lib64\/python3.6\/site-packages\/psycopg2\/__init__.py:144: UserWarning: The psycopg2 whee>
\nMay 24 08:35:46 centos8 odoo13[23874]: \"\"\")
\nMay 24 08:35:46 centos8 odoo13[23874]: 2020-05-24 12:35:46,298 23874 INFO ? odoo: Odoo version 13.0
\nMay 24 08:35:46 centos8 odoo13[23874]: 2020-05-24 12:35:46,299 23874 INFO ? odoo: Using configuration file at \/etc\/odoo13.conf
\nMay 24 08:35:46 centos8 odoo13[23874]: 2020-05-24 12:35:46,300 23874 INFO ? odoo: addons paths: ['\/opt\/odoo13\/odoo\/odoo\/addons', '\/opt\/odoo13\/>
\nMay 24 08:35:46 centos8 odoo13[23874]: 2020-05-24 12:35:46,300 23874 INFO ? odoo: database: odoo13@default:default
\nMay 24 08:35:46 centos8 odoo13[23874]: 2020-05-24 12:35:46,893 23874 INFO ? odoo.addons.base.models.ir_actions_report: Will use the Wkhtmltopd>
\nMay 24 08:35:47 centos8 odoo13[23874]: 2020-05-24 12:35:47,367 23874 INFO ? odoo.service.server: HTTP service (werkzeug) running on centos8:80>
\nlines 1-18\/18 (END)
\n<\/code><\/p>\nAt this point, Odoo is running and listening on port 8069. You can already access it from a browser by specifying the IP and Port for Odoo.<\/p>\n