Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 55 additions & 41 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,81 +1,95 @@
Odoo - From ERP to CRM, eCommerce to CMS
========================================
==========================================

`Odoo`_ is an all-in-one business management suite of mobile-friendly web
apps that integrates everything you need to grow your business: CRM,
website content management, project management, human resources,
accounting, invoicing and more. Odoo apps integrate seamlessly to
provide a full-featured open source ERP, but can also be used
stand-alone. Python programmers can develop their own app modules, or
choose from an array of free open source such as those provided by OCA_;
choose from an array of free open source such as those provided by `OCA`_;
or paid commercial ones.

This appliance includes all the standard features in `TurnKey Core`_:

- Odoo configurations for TurnKey v18.x:

- Odoo v16 installed from debian backports apt repo (v18.x).
- Includes modules from base install of Odoo.
- **Odoo v18** installed from official Odoo 18.0 nightly apt
repository.
- Includes modules from base install of Odoo.

- **Security note**: As of 18.0, due to using the debian backports repo
Updates to Odoo **ARE NOT** configured to install automatically.
- **Security note**: Updates to Odoo are available via standard
``apt-get upgrade`` from the Odoo nightly repository.

- SSL support out of the box.
- `Adminer`_ administration frontend for PostgreSQL (listening on
port 12322 - uses SSL).
- Webmin modules for configuring Apache2, PostgreSQL and Postfix.
- Custom addons directory at ``/opt/odoo/custom-addons``.
- WebSocket support for Odoo 18 live chat and notifications.

**To create a new Odoo Databse (i.e. site)**
**First boot configuration**

Beyond the password, first boot (``turnkey-init``) lets you:

- **Choose the database name** - keep the default
(``TurnkeylinuxExample``) or enter a new name. A new name initializes
a fresh database and removes the unused example database.
- **Choose demo data** - when a new database is initialized you can load
Odoo demo data (choose "No" for production).
- **Download OCA localization addons** - e.g. ``brazil``, ``spain``.
Selected `OCA`_ ``l10n-*`` repos (18.0 branch) are cloned into
``/opt/odoo/custom-addons``, their python requirements installed and
registered in ``addons_path``; the addons then show up in the Odoo
Apps menu, ready to install per database. Requires internet access.

For unattended/pre-seeded deployments (e.g. TurnKey Hub) the same
options can be pre-seeded via ``inithooks.conf``::

export APP_PASS=SecretPassword1!
export ODOO_DB_NAME=production
export ODOO_DEMO=no
export ODOO_L10N=brazil

Unset options fall back to safe defaults (example database, no demo
data, no extra addons), so existing Hub deployments keep working
unchanged.

**To create a new Odoo Database (i.e. site)**

To create a new Odoo DB, the Odoo config file needs to be edited and the
Odoo service restarted.

Overview of process:
1. Edit /etc/odoo/odoo
- change value of "db_name" from "TurnkeylinuxExample" to your desired DB
1. Edit /etc/odoo/odoo.conf

* change value of "db_name" from "TurnkeylinuxExample" to your desired DB
name
2. Restart odoo.service
3. Reload Odoo login screen in your browser and you should be good to go

Webmin steps:
1.
- Browse to 'Tools' >> 'FileManager'
- Navigate to '/etc/odoo' and edit the 'odoo.conf' file
- Edit as per step 1 above
- Save changes
2.
- Navigate to 'System' >> 'Bootup and Shutdown'
- Find the "odoo.service" in the list and select it via the checkbox
- Scroll to the bottom and select 'Restart'
3.
- As per step 3 above

CLI steps:
1.
- Edit /etc/odoo/odoo as per step 1
2.
- Restart odoo.service::

systemctl restart odoo
3.
- As per step 3 above
2. Restart odoo.service::

systemctl restart odoo

3. Reload Odoo login screen in your browser and you should be good to go

**Notice for special Odoo Localization**

In case you run a L10n Odoo Localization you will need other PIP Packages
and Libs installed on your system, please check your localization support on
OCA_.
Localization (l10n) addons can be downloaded at first boot (see above)
or at any time by re-running ``turnkey-init``. Some localizations may
need additional PIP packages and system libs - ``requirements.txt`` of
each selected OCA repo is installed automatically, but please check your
localization's documentation on `OCA`_ for extra system dependencies.

Credentials *(passwords set at first boot)*
-------------------------------------------
--------------------------------------------

**Note**: the Odoo password set at firstboot applies to both the Odoo
admin account (example app) AND the masterpassword - however these can be
admin account (example app) AND the masterpassword - however these can be
changed individually after firstboot.

- Webmin, SSH: username **root**
- PostgreSQL, Adminer: username **postgres**
- Odoo Master Account: **admin**
- Webmin, SSH: username **root**
- PostgreSQL, Adminer: username **postgres**
- Odoo Master Account: **admin**

.. _Odoo: https://www.odoo.com/
.. _TurnKey Core: https://www.turnkeylinux.org/core
Expand Down
45 changes: 45 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
turnkey-odoo-19.0 (1) turnkey; urgency=low

* Upgraded Odoo to v18 from official Odoo 18.0 nightly apt repository
(previously v16 from Debian backports).

* Python 3.11 (Debian Bookworm native) meets Odoo 18 requirement of
Python 3.10+.

* PostgreSQL 15 (Debian Bookworm native) meets Odoo 18 requirement.

* Added /opt/odoo/custom-addons directory for custom/OCA modules.

* Updated odoo.conf with Odoo 18 optimized defaults (workers, memory
limits, proxy_mode, gevent_port for WebSocket).

* Added Apache WebSocket proxy support (mod_proxy_wstunnel) for Odoo 18
live chat, discuss, and real-time notifications.

* Updated inithook for Odoo 18 compatibility (pbkdf2_sha512 hashing);
master password now stored hashed in odoo.conf.

* Inithook: support custom database name at firstboot (--dbname /
ODOO_DB_NAME) - initializes a fresh database via 'odoo -i base' and
removes the unused example database.

* Inithook: optional demo data for newly initialized databases
(--demo / ODOO_DEMO; default no - production safe).

* Inithook: optional download of OCA localization addons (--l10n /
ODOO_L10N) - clones selected l10n-* repos (18.0 branch) plus their
oca_dependencies into /opt/odoo/custom-addons, installs python
requirements and registers them in addons_path.

* Inithook: fully non-interactive when pre-seeded (TurnKey Hub
compatible) - unset options fall back to safe defaults.

* Installed rtlcss via npm for right-to-left language support.

* Installed wkhtmltopdf 0.12.6 for PDF report generation.

* Note: Please refer to turnkey-core's changelog for changes common to
all appliances.

-- Marcos Méndez <m@pop.coop> Mon, 16 Mar 2026 04:00:54 -0300

turnkey-odoo-18.0 (1) turnkey; urgency=low

* Install Odoo v16.x from Debian backports (bookworm-backports) apt
Expand Down
167 changes: 95 additions & 72 deletions conf.d/main
Original file line number Diff line number Diff line change
@@ -1,87 +1,110 @@
#!/bin/bash -ex

# Set variables
#

DB_USER=odoo
DB_PASS=$(mcookie)
# TurnKey Odoo 18 — Main Configuration Script

SRC=/usr/local/src

# -----------------------------------------------
# 1. Add Odoo 18 official nightly repository
# -----------------------------------------------
wget -qO - https://nightly.odoo.com/odoo.key \
| gpg --dearmor -o /usr/share/keyrings/odoo-archive-keyring.gpg

echo 'deb [signed-by=/usr/share/keyrings/odoo-archive-keyring.gpg] https://nightly.odoo.com/18.0/nightly/deb/ ./' \
> /etc/apt/sources.list.d/odoo.list

apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y odoo

# -----------------------------------------------
# 2. Install wkhtmltopdf (patched QT version)
# -----------------------------------------------
if ! wkhtmltopdf --version 2>/dev/null | grep -q "0.12.6"; then
WKHTMLTOPDF_DEB="wkhtmltox_0.12.6.1-2.bookworm_amd64.deb"
WKHTMLTOPDF_URL="https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2"
cd /tmp
wget "${WKHTMLTOPDF_URL}/${WKHTMLTOPDF_DEB}" || true
if [ -f "${WKHTMLTOPDF_DEB}" ]; then
dpkg -i "${WKHTMLTOPDF_DEB}" || apt-get install -f -y
rm -f "${WKHTMLTOPDF_DEB}"
fi
cd -
fi

# -----------------------------------------------
# 3. Install rtlcss (for right-to-left languages)
# -----------------------------------------------
npm install -g rtlcss

# -----------------------------------------------
# 4. Stop Odoo for initial configuration
# -----------------------------------------------
systemctl stop odoo || true

# -----------------------------------------------
# 5. Create custom addons directory
# -----------------------------------------------
mkdir -p /opt/odoo/custom-addons
chown odoo:odoo /opt/odoo/custom-addons

mkdir -p /var/log/odoo
chown odoo:odoo /var/log/odoo

# odoo.conf holds the db password & master password hash
chown odoo:odoo /etc/odoo/odoo.conf
chmod 0640 /etc/odoo/odoo.conf

# -----------------------------------------------
# 6. Configure Apache proxy for Odoo 18
# -----------------------------------------------
# Enable required Apache modules
a2enmod proxy proxy_http proxy_wstunnel rewrite headers ssl

# -----------------------------------------------
# 7. Configure PostgreSQL and create example DB
# -----------------------------------------------
DB_NAME="TurnkeylinuxExample"

# We will use a random password for now. Reset during inithook
ODOO_ADMIN_PASSWORD=$(mcookie)

# User name that Odoo will run under
SERVICE_USER=$DB_USER

CONF=/etc/odoo/odoo.conf

# Create database role for odoo
# *******************************************

# Start postgresql server
systemctl start postgresql

# Create db user
su postgres -c "createuser --superuser --createdb --no-createrole $DB_USER"

# Set db user password
su postgres -c "psql postgres" << EOF
alter user $DB_USER with encrypted password '$DB_PASS';
EOF
su postgres -c "psql postgres" << EOF
create database "$DB_NAME" owner $DB_USER;
EOF

# Set password/name in config file
sed -i "s|db_password =.*|db_password = $DB_PASS|" $CONF
sed -i "s|db_host =.*|db_host = localhost|" $CONF
echo "db_name = $DB_NAME" >> $CONF

# Stop postgresql server
systemctl stop postgresql

# Set admin password to random value for now
sed -i "s|admin_passwd =.*|admin_passwd = $ODOO_ADMIN_PASSWORD|" $CONF
chown odoo:odoo $CONF

# Add and disable service user
usermod -L $SERVICE_USER

# Enable needed modules
a2enmod proxy_http headers rewrite

# Configure sites
a2dissite 000-default
a2ensite odoo.conf

# Populate database
systemctl start postgresql
systemctl start apache2
su - postgres -c "createdb -O odoo ${DB_NAME}" || true

su odoo -g odoo -s '/bin/bash' -c 'odoo -i base \
--stop-after-init --db_host=localhost \
-d '"\"$DB_NAME\""' \
-r '"\"$DB_USER\""' \
-w '"\"$DB_PASS\""' \
-s -c '"\"$CONF\""
su - odoo -s /bin/bash -c \
"odoo --database=${DB_NAME} \
--init=base \
--without-demo=all \
--stop-after-init \
--config=/etc/odoo/odoo.conf" || true

# enable and start odoo
systemctl enable odoo
# -----------------------------------------------
# 8. Start services and set master password
# -----------------------------------------------
systemctl start odoo

while [[ "$(curl -Lk http://localhost)" = *"Unavailable"* ]]; do
sleep 1
CURL="curl -s -k -L --max-time 5"
URL="http://127.0.0.1:8069"
MAX_TRIES=60
COUNT=0

echo "Waiting for Odoo to start..."
while [ $COUNT -lt $MAX_TRIES ]; do
if $CURL $URL/web/login 2>/dev/null | grep -q "login"; then
echo "Odoo is ready."
break
fi
COUNT=$((COUNT + 1))
sleep 2
done

URL="https://127.0.0.1/web"
CURL="curl --insecure -c /tmp/cookie -b /tmp/cookie"
if [ $COUNT -ge $MAX_TRIES ]; then
echo "WARNING: Odoo may not have started within expected time"
fi

$CURL $URL/login
sleep 1
$CURL $URL/database/manager
sleep 1
$CURL $URL/database/change_password --data-raw "master_pwd=admin&master_pwd_new=${ODOO_ADMIN_PASSWORD}"
ODOO_ADMIN_PASSWORD="${ODOO_ADMIN_PASSWORD:-admin}"
$CURL $URL/database/change_password \
--data-raw "master_pwd=admin&master_pwd_new=${ODOO_ADMIN_PASSWORD}" || true

# -----------------------------------------------
# 9. Stop for appliance packaging
# -----------------------------------------------
systemctl stop odoo
systemctl stop postgresql
systemctl stop apache2
Loading