This article will show you how to install Odoo 13 on a CentOS 8 VPS.
We will be installing Odoo 13 from the source GitHub repository (i.e. the place where developers release the official code). It is the most common method of Odoo installation, and it is also the most straightforward one.
Prerequisites
Operating system: CentOS 8
Server resources: 2-core CPU & 2GB of RAM
Access: ability to connect to a server via SSH
Permissions: a user with root privileges (i.e. able to use the 'sudo' command)
Note: you can execute all of the commands below from the root user, but for security purposes, it is recommended that you use a separate user with sudo privileges.
Step 1: Connect to a Server
If you’ve met all the requirements for the installation, let’s begin by connecting to a server via SSH.
Step 2: Update the System & Install the EPEL repository
Once you’re connected to your CentOS 8 server, update the list of available packages:
sudo dnf update
Then, install the EPEL repository, which is a place where extra Linux packages are stored (we will need it later):
sudo dnf install epel-release
Step 3: Install Packages for Python and Odoo Dependencies
The programming language used by Odoo 13 is Python. Install Python version 3.6 by executing the following command:
sudo dnf install python36 python36-devel
Install all the other packages required to build Odoo 13:
sudo dnf install git gcc wget nodejs libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel
Step 4: Create a Dedicated Linux User for Odoo
You need to create a dedicated Linux user in order to keep Odoo's permissions strict and pre-defined.
The following command will create a user named odoo and a user group of the same name. The home directory for the user will be /opt/odoo, and Bash will be the default shell.
sudo useradd -m -U -r -d /opt/odoo -s /bin/bash odoo
Note: you can choose any name for the user, but make sure to use that same name in the next step, when you will be creating a database user.
Step 5: Install and Configure PostgreSQL
PostgreSQL is the database engine used by Odoo to store and access application and user data.
Install it with the following command:
sudo dnf install postgresql postgresql-server postgresql-contrib
Make sure the database is ready to work on your server:
sudo /usr/bin/postgresql-setup initdb
Start the PostgreSQL process and make sure the database process is always running:
sudo systemctl start postgresql
sudo systemctl enable postgresql
Create a new PostgreSQL user (remember to use the user name from the previous step):
sudo su - postgres -c "createuser -s odoo"
Step 6: Install Wkhtmltopdf
Wkhtmltopdf is the package that allows Odoo 13 to print PDF reports. It converts HTML (web page markup) to PDF, but it's not present in the official package list nor the EPEL repository.
Instead, download it from the official website using this command:
cd /opt/ && sudo wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox-0.12.5-1.centos8.x86_64.rpm
Once done, install the Wkhtmltopdf package from the downloaded file:
sudo dnf localinstall wkhtmltox-0.12.5-1.centos8.x86_64.rpm
Step 7: Install and Configure Odoo 13
Now it's time to download the official release of Odoo 13 from the main repository.
Switch to the previously created odoo user:
sudo su - odoo
Download Odoo 13 from GitHub:
git clone https://www.github.com/odoo/odoo --depth 1 --branch 13.0 /opt/odoo/odoo13
Step 8: Create a Python Virtual Environment & Install Python Modules
After you download the Odoo 13 code, you need to install specific Python modules in order for it to work.
The virtual environment is needed to separate Odoo's Python modules from the system's Python modules so that the two don’t interfere with each other.
Create a virtual environment in the /opt/odoo directory:
cd /opt/odoo && python3 -m venv odoo13-venv
Activate the virtual environment:
source odoo13-venv/bin/activate
You are now inside the virtual environment. Install all the Python packages listed in the requirements.txt file:
pip3 install -r odoo13/requirements.txt
Note: You can disregard the orange messages that might appear during the installation.
Deactivate the virtual environment and return to the previous system user (you won't need to do anything under the odoo user anymore):
deactivate && exit
Step 9: Prepare for Custom Odoo Addons
Create a separate directory for custom Odoo addons and change its owner to the odoo user:
sudo mkdir /opt/odoo/odoo13-custom-addons
sudo chown odoo: /opt/odoo/odoo13-custom-addons
Create a log file for the new Odoo installation and change its owner to the odoo user:
sudo mkdir /var/log/odoo13 && sudo touch /var/log/odoo13/odoo.log
sudo chown -R odoo: /var/log/odoo13/
Step 10: Create a Configuration File for Your Odoo Instance.
Now you need to create a file with your settings. In this example, we use nano as our text editor, but you can use any text editor to create and edit the configuration file.
Open the configuration file:
sudo nano /etc/odoo.conf
Copy the following text and paste it into the configuration file.
[options]
; This is the password that allows database operations:
admin_passwd = master_password
db_host = False
db_port = False
db_user = odoo
db_password = False
xmlrpc_port = 8069
; longpolling_port = 8072
logfile = /var/log/odoo13/odoo.log
logrotate = True
addons_path = /opt/odoo/odoo13/addons,/opt/odoo/odoo13-custom-addons
Make sure to change the master_password value to a proper, secure password. This is the password used to access and manage your Odoo instance.
Note: If you are a SolaDrive customer and use one of our Odoo VPS Hosting services you can simply ask our expert Odoo specialists to change your Odoo password for you. We are available 24x7 via chat or ticket and will take care of your request immediately.
Save the file and close it. In nano, that can be done by pressing "Ctrl + x", followed by "Y" and "Enter".
Congratulations! You have successfully installed Odoo. Now you just need to make sure it runs automatically.
Step 11: Create a systemd Service File
You need to configure Odoo 13 to run as a service on the background.
Create a new service file for Odoo 13:
sudo nano /etc/systemd/system/odoo13.service
Copy and paste the following text into the file:
[Unit]
Description=Odoo13
#Requires=postgresql-10.6.service
#After=network.target postgresql-10.6.service
[Service]
Type=simple
SyslogIdentifier=odoo13
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo13-venv/bin/python3 /opt/odoo/odoo13/odoo-bin -c /etc/odoo.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
Save the file and close it. In nano, it can be done by pressing "Ctrl + x", followed by "Y" and "Enter".
Reload the systemd daemon:
sudo systemctl daemon-reload
Start the Odoo 13 process on the background and enable it (so that it's running by default):
sudo systemctl start odoo13
sudo systemctl enable odoo13
Check if Odoo is running:
sudo systemctl status odoo13.service
You should see a similar output in the terminal:
odoo13.service - Odoo13
Loaded: loaded (/etc/systemd/system/odoo13.service; disabled; vendor preset: disabled)
Active: active (running) since Wed 2012-06-28 12:02:14 EDT; 1min ago
Main PID: 14401 (python3)
Tasks: 6 (limit: 11523)
Memory: 99.2M
CGroup: /system.slice/odoo13.service
└─12909 /opt/odoo/odoo13-venv/bin/python3 /opt/odoo/odoo13/odoo-bin -c /etc/odoo.conf
Step 12: Start Working With Odoo 13
You can now access the web interface of Odoo 13 for further configuration.
Open your browser and go to the following URL:
http://server_ip:8069
- server_ip is the IP address of the server you installed Odoo on.
If all is well, you will see the Odoo 13 graphical interface: