When using a Debian distribution, by default your login is root with administrator powers, and your command prompt shows #. When using Ubuntu, logging with the root account is disabled, and the initial user configured during the installation process is a sudoer, meaning that it is allowed to use the sudo command to run commands with root privileges.

First, we should update the package index, and then perform an upgrade to make sure all installed programs are up to date:

$ sudo apt-get update
$ sudo apt-get upgrade -y

Next, we will install the PostgreSQL database, and make our user a database superuser:

$ sudo apt-get install postgresql -y
$ sudo su -c "createuser -s $(whoami)" postgres

We will be running Odoo from source, but before that we need to install the required dependencies. These are the Debian packages required:

$ sudo apt-get install git python-pip python2.7-dev -y
$ sudo apt-get install libxml2-dev libxslt1-dev 
libevent-dev \
libsasl2-dev libldap2-dev libpq-dev 
libpng12-dev libjpeg-dev \ 
poppler-utils 
node-less node-clean-css -y

We should not forget to install wkhtmltox, which is needed to print reports:

$ wget http://nightly.odoo.com/extra/wkhtmltox-0.12.1.2_linux-jessie-amd64.deb
$ sudo dpkg -i wkhtmltox-0.12.1.2_linux-jessie-amd64.deb
$ sudo apt-get -fy install

The installation instructions will report a missing dependencies error, but the last command forces the installation of those dependencies and correctly finishes the installation.

Now we are only missing the Python packages required by Odoo. Many of them also have Debian/Ubuntu system packages. The official Debian installation package uses them, and you can find the package names in the Odoo source code, in the debian/control file.

However, these Python dependencies can be also installed directly from the Python Package Index (PyPI). This is friendlier for those who prefer to install Odoo in virtualenv. The required package list is in the Odoo's requirements.txt file, as is usual for Python-based projects. We can install them with these commands:

$ sudo -H pip install --upgrade pip  # Ensure pip latest version
$ wget https://raw.githubusercontent.com/odoo/odoo/10.0/requirements.txt
$ sudo -H pip install -r requirements.txt

Now that we have all dependencies installed, database server, system packages, and Python packages, we can install Odoo.

Adding the --save option when starting an Odoo server saves the configuration used to the ~/.odoorc file. We can use the file as a starting point for our server configuration, which will be stored at /etc/odoo, as shown in the following code:

$ sudo su -c "~/odoo-10.0/odoo-bin -d odoo-prod --save --stop-after-init" odoo

This will have the configuration parameters to be used by our server instance.

Next, we need to place the config file in the expected location:

$ sudo mkdir /etc/odoo
$ sudo cp /home/odoo/.odoorc /etc/odoo/odoo.conf
$ sudo chown -R odoo /etc/odoo

We should also create the directory where the Odoo service will store its log files. This is expected to be somewhere inside /var/log:

$ sudo mkdir /var/log/odoo
$ sudo chown odoo /var/log/odoo

Now we should make sure that a few important parameters are configured. Here are suggested values for the most important ones:

[options] 
addons_path = /home/odoo/odoo-10.0/odoo/addons, /home/odoo/odoo-10.0/addons 
admin_passwd = False 
db_user = odoo-prod 
dbfilter = ^odoo-prod$ 
logfile = /var/log/odoo/odoo-prod.log 
proxy_mode = True 
without_demo = True 
workers = 3 
xmlrpc_port = 8069 

Let's explain them:

The following parameters can also be helpful:

We can check the effect of the settings made by running the server with the -c or --config option as follows:

$ sudo su -c "~/odoo-10.0/odoo-bin -c /etc/odoo/odoo.conf" odoo

Running Odoo with the above settings won't display any output to the console, since it is being written to the log file defined in the configuration file. To follow what is going on with the server we need to open another terminal window, and run there:

$ sudo tail -f /var/log/odoo/odoo-prod.log

If is also possible to use the configuration file and still force the log output to be printed to the console, by adding the --logfile=False option, like this:

$ sudo su -c "~/odoo-10.0/odoo-bin -c /etc/odoo/odoo.conf --logfile=False" odoo