Why Ubuntu and PyCharm
- Your development machine behaves like the production server, so fewer surprises at deployment.
- Python virtual environments, PostgreSQL and system libraries install with the package manager.
- PyCharm adds code completion for Odoo’s ORM, a real debugger and Git integration.
Step 1: install PyCharm
sudo apt update && sudo apt upgrade -y
sudo snap install pycharm-community --classicStep 2: install Python 3.12 and build libraries
Ubuntu 24.04 ships Python 3.12. On Ubuntu 22.04, add the deadsnakes repository first:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.12 python3.12-dev python3.12-venv -yThen the libraries Odoo’s Python packages compile against:
sudo apt install build-essential libpq-dev libxml2-dev libxslt1-dev \
zlib1g-dev libffi-dev libssl-dev libjpeg-dev libldap2-dev libsasl2-dev -yStep 3: install Node.js and the Less compiler
Odoo compiles some interface styles with Less, and right-to-left languages such as Arabic need rtlcss:
sudo apt install -y nodejs npm
sudo npm install -g less less-plugin-clean-css rtlcssStep 4: install wkhtmltopdf for PDF reports
Odoo renders invoices and reports to PDF with wkhtmltopdf. Use the patched Qt build 0.12.6.1, otherwise headers, footers and page breaks print incorrectly. For Ubuntu 22.04 and 24.04:
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.jammy_amd64.deb
sudo apt install ./wkhtmltox_0.12.6.1-3.jammy_amd64.deb -yStep 5: install PostgreSQL and create the Odoo user
sudo apt install postgresql postgresql-client -y
sudo -u postgres createuser --createdb --no-createrole --no-superuser --pwprompt odoo19For a local machine you can give the role superuser rights to avoid permission issues when restoring databases. Never do this on a server.
sudo -u postgres psql -c "ALTER USER odoo19 WITH SUPERUSER;"Step 6: get the Odoo 19 source
sudo apt install git -y
git clone https://github.com/odoo/odoo.git --branch 19.0 --depth 1 odoo19Step 7: create a virtual environment and install requirements
Open the odoo19 folder in PyCharm and run in its terminal:
python3.12 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txtIf psycopg2 fails to build, install the binary package with pip install psycopg2-binary.
Step 8: write odoo.conf
[options]
admin_passwd = admin
db_host = localhost
db_port = 5432
db_user = odoo19
db_password = your_password
addons_path = /home/you/odoo19/addons
logfile = /home/you/odoo19/odoo.log
http_port = 8069Step 9: add a run configuration
Run → Edit Configurations → + → Python:
- Script path:
odoo-bin - Parameters:
-c odoo.conf - Working directory: the
odoo19folder - Interpreter: the
venvyou created
Click Run or Debug, then open http://localhost:8069. The database manager confirms the environment works.
Tips from our developers
- Keep your own modules in a separate folder and add it to
addons_path; never edit Odoo’s core addons. - Use Git from the first line of code, one repository per client or product line.
- Keep separate configuration files for development, testing and production.
- Start Odoo with
--dev=allwhile you work so Python and view changes reload without restarting. - Run your module’s tests with
--test-enable -i your_module --stop-after-initbefore every commit.