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
63 changes: 24 additions & 39 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,81 +1,66 @@
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)**
**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_.
`OCA`_.

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
29 changes: 29 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
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).

* 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
163 changes: 91 additions & 72 deletions conf.d/main
Original file line number Diff line number Diff line change
@@ -1,87 +1,106 @@
#!/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

# -----------------------------------------------
# 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
46 changes: 22 additions & 24 deletions overlay/etc/apache2/sites-available/odoo.conf
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
ServerName localhost

<VirtualHost *:80>
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L]
</VirtualHost>

<VirtualHost *:443>
SSLEngine on
ServerAdmin webmaster@localhost

ProxyRequests Off
SSLEngine on

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyVia On
# Proxy headers
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Port "443"

# Needed for real time message / chat feature (longpolling)
ProxyPass /longpolling/poll http://127.0.0.1:8072/longpolling/poll/ timeout=200
ProxyPass /longpolling/poll/ http://127.0.0.1:8072/longpolling/poll/ timeout=200
ProxyPassReverse /longpolling/poll/ http://127.0.0.1:8072/longpolling/poll/
ProxyRequests Off
ProxyPreserveHost On

# WebSocket support (Odoo 18 live chat, discuss, notifications)
ProxyPass /websocket ws://127.0.0.1:8072/websocket
ProxyPassReverse /websocket ws://127.0.0.1:8072/websocket

ProxyPass / http://127.0.0.1:8069/ timeout=200
# Standard HTTP proxy
ProxyPass / http://127.0.0.1:8069/
ProxyPassReverse / http://127.0.0.1:8069/

RequestHeader set "X-Forwarded-Proto" "https"
ProxyTimeout 600
TimeOut 600

ErrorLog ${APACHE_LOG_DIR}/odoo-error.log
CustomLog ${APACHE_LOG_DIR}/odoo-access.log combined
</VirtualHost>

# Fix IE problem (http error 408/409)
SetEnv proxy-nokeepalive 1
<VirtualHost *:80>
ServerAdmin webmaster@localhost
RewriteEngine On
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>
Loading