Install Odoo 20 on Windows Server: A Source Setup That Survives the First Run

How to Install Odoo 20 on Windows is a common question, but the answer changes once the target is a server rather than a laptop. A server has to run Odoo with no one signed in, restart cleanly after updates, serve users over HTTPS and protect the database. This guide covers the full setup on Windows Server 2022 or 2025, from PostgreSQL and the Python environment to a Windows service, an IIS reverse proxy, firewall rules and nightly backups. Every stage ends with a quick check, and the last section covers the errors people hit most often.

Key Takeaways

  • Odoo 20 needs Python 3.12 to 3.14 and PostgreSQL 16 or later
  • Bind Odoo to the local address and publish it only through IIS with HTTPS
  • Run Odoo as a service under a dedicated account with access to just the folders it needs
  • Back up the database and the filestore together every night, and test restores
  • Windows Server suits moderate internal use. Heavy workloads belong on Linux or Odoo.sh

Is Windows Server the Right Home for Odoo

Many companies already run Active Directory and file shares on Windows Server, so keeping the ERP there feels natural. It works well within clear limits.

FactorWindows ServerLinux Server
Process modelThreaded mode in one processMultiple workers plus a dedicated websocket process
Good fitInternal teams with moderate concurrent useGrowing teams, ecommerce and heavy reporting
Reverse proxyIIS with URL Rewrite and ARRNginx or Apache
Licensing costWindows Server licence and CALsFree operating system
💡Choose Windows Server for familiarity, not performance. If your IT team lives in Windows and usage is moderate, this guide gives you a stable setup. If you expect rapid growth, compare it with hosting Odoo on a Linux VPS before you commit.

Server Sizing and Prerequisites

Server Specification

  • Operating system. Windows Server 2022 or 2025, 64 bit, fully patched, with a static IP address and a DNS name.
  • Processor and memory. Start with 4 vCPUs and 16 GB of RAM for a team of up to about 30 users.
  • Storage. SSD storage, ideally with a separate volume for backups.

Software to Install

  • Python 3.12, 64 bit. Odoo 20 accepts 3.12 to 3.14, but 3.12 installs every dependency from prebuilt wheels on Windows. Install it for all users.
  • PostgreSQL 16 or later. Older versions are unsupported. Record the superuser password safely.
  • Git for Windows. Used to clone the source and pull fixes later.
  • Microsoft C++ Build Tools. Covers the rare package that must compile.
  • wkhtmltopdf 0.12.6 with patched Qt. Needed for PDF reports with headers and footers.
✅Stage test. In a new PowerShell window, each tool should print a version number.
git --version
py -3.12 --version
psql --version
wkhtmltopdf --version

How to Install Odoo 20 on Windows, Stage by Stage

How to Install Odoo 20 on Windows for a server comes down to five stages, each with its own check.

Stage 1. Create the PostgreSQL Role

Odoo refuses to connect as the postgres superuser, so create a dedicated role that can log in and create databases but nothing more.

psql -U postgres -c "CREATE ROLE odoo WITH LOGIN CREATEDB PASSWORD 'the-odoo-role-password';"

Stage 2. Get the Source and Build the Environment

Keep paths short to avoid Windows path limits. This guide uses C:\odoo as the root.

git config --system core.longpaths true
mkdir C:\odoo; cd C:\odoo
git clone https://github.com/odoo/odoo.git --depth 1 --branch 20.0 --single-branch src
mkdir custom-addons, data, logs
py -3.12 -m venv venv
.\venv\Scripts\Activate.ps1
python -m pip install --upgrade pip setuptools wheel

Enterprise subscribers clone the enterprise repository into C:\odoo\enterprise at the same branch and list it first in the addons path. If you are still deciding, compare Odoo Community and Enterprise editions before you clone.

Stage 3. Install Python Dependencies

cd C:\odoo\src
pip install -r requirements.txt
python odoo-bin --version

The last command should print the version without import errors.

Stage 4. Write a Server Ready Config File

Save this as C:\odoo\odoo.conf.

[options]
admin_passwd = use-a-long-random-master-password
db_host = localhost
db_port = 5432
db_user = odoo
db_password = the-odoo-role-password
dbfilter = ^odoo_prod$
list_db = False
proxy_mode = True
http_interface = 127.0.0.1
http_port = 8069
addons_path = C:\odoo\src\addons,C:\odoo\custom-addons
data_dir = C:\odoo\data
logfile = C:\odoo\logs\odoo.log

Why these settings matter on a server

  • http_interface binds Odoo to the local address, so only IIS can reach it.
  • proxy_mode tells Odoo to trust the forwarded headers that IIS adds, so links stay on HTTPS.
  • list_db and dbfilter hide the database manager and pin the site to one database.

Stage 5. Create the Database and Run Odoo

With the database manager hidden, create the database from the command line, then start Odoo.

python odoo-bin -c C:\odoo\odoo.conf -d odoo_prod -i base --stop-after-init
python odoo-bin -c C:\odoo\odoo.conf

Open http://127.0.0.1:8069 on the server itself, sign in as admin with the password admin, and change that password immediately.

✅Stage test. The home screen loads, the Sales app installs, and the log shows no tracebacks. Stop Odoo before the next stage.

Run Odoo as a Windows Service

A server install must start on boot and recover from crashes. NSSM, a small free service wrapper, handles this for source installs.

  • Create a service account. Make a local user such as svc_odoo without administrator rights.
  • Grant folder access. Give it modify rights on the data and logs folders.
  • Register the service. Point NSSM at the virtual environment Python with odoo-bin and the config file.
icacls C:\odoo\data /grant "svc_odoo:(OI)(CI)M"
icacls C:\odoo\logs /grant "svc_odoo:(OI)(CI)M"
nssm install Odoo C:\odoo\venv\Scripts\python.exe "C:\odoo\src\odoo-bin -c C:\odoo\odoo.conf"
nssm set Odoo AppDirectory C:\odoo\src
nssm set Odoo ObjectName .\svc_odoo "service-account-password"
nssm set Odoo Start SERVICE_AUTO_START
nssm set Odoo AppExit Default Restart
nssm start Odoo
⚠️Use the system PATH for wkhtmltopdf. The service account cannot see your personal PATH, so add the wkhtmltopdf bin folder to the system PATH and restart the service.
✅Stage test. After a reboot, Odoo answers on the local port with no one signed in.

Publish Odoo Through IIS with HTTPS

IIS handles the certificate and forwards requests to the local port, so users only see an HTTPS address.

Install the IIS Pieces

  • Web Server role with the WebSocket Protocol feature, which Odoo needs for live notifications.
  • URL Rewrite and Application Request Routing from Microsoft.
  • Proxy enabled in ARR. Tick Enable proxy under Server Proxy Settings.
  • Host header preserved so Odoo builds correct links.
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/proxy -preserveHostHeader:true /commit:apphost

Create the Site and Rewrite Rule

Create a site bound to your DNS name, add HTTP_X_FORWARDED_PROTO to the allowed server variables in URL Rewrite, and place this web.config in the site folder.

<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="OdooProxy" stopProcessing="true">
          <match url="(.*)" />
          <serverVariables>
            <set name="HTTP_X_FORWARDED_PROTO" value="https" />
          </serverVariables>
          <action type="Rewrite" url="http://127.0.0.1:8069/{R:1}" />
        </rule>
      </rules>
    </rewrite>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="134217728" />
      </requestFiltering>
    </security>
  </system.webServer>
</configuration>

This allows uploads up to 128 MB. Also raise the ARR proxy timeout to about 300 seconds for large reports.

Add the Certificate

  • Use a certificate from your corporate authority, or a free Let's Encrypt certificate issued and renewed by the win-acme client.
  • Bind it to port 443 on the site and redirect plain HTTP to HTTPS.
✅Stage test. From another computer, the HTTPS address loads with a padlock and chat messages appear instantly.

Harden the Firewall, PostgreSQL and Odoo

A working server is not yet a safe one. These steps close the common gaps.

Windows Defender Firewall

  • Allow inbound TCP 443, and 80 only for the HTTPS redirect.
  • Do not open 8069 or 5432. Odoo and PostgreSQL listen on the local address only.
New-NetFirewallRule -DisplayName "Odoo HTTPS" -Direction Inbound -Protocol TCP -LocalPort 443 -Action Allow

PostgreSQL

  • Set listen_addresses to localhost in postgresql.conf and restart the service.
  • Exclude the PostgreSQL data folder from real time antivirus scanning.

Odoo

  • Keep list_db set to False so the database manager stays hidden.
  • Turn on two factor authentication for administrator users.
🚫Never expose port 8069 to the internet. It bypasses HTTPS and sends passwords in clear text.

Backups, Updates and Monitoring

Odoo keeps attachments in the filestore, so a restore needs both the database and the filestore.

Nightly backup task

Run this PowerShell script nightly from Task Scheduler, with the odoo role password stored in pgpass.conf for that account.

$d = Get-Date -Format yyyyMMdd
& "C:\Program Files\PostgreSQL\16\bin\pg_dump.exe" -U odoo -Fc odoo_prod -f "D:\backups\odoo_prod_$d.dump"
robocopy C:\odoo\data\filestore\odoo_prod "D:\backups\filestore_$d" /MIR /R:2 /W:5

Copy backups off the server daily and rehearse a restore monthly. Our Odoo database backup and restore guide covers retention in more detail.

Applying fixes safely

  • Back up, then stop the service.
  • Run git pull in the source and enterprise folders.
  • Rerun pip install, then update modules once with the u flag set to all.
  • Start the service and check the log.

Moving an older database is a separate project, so follow the Odoo 20 migration plan. Once users are live, an Odoo system health check catches slow queries and configuration drift early.


Troubleshooting Windows Server Errors

The service starts and then stops

  • Run the command manually as the service account to see the real error.
  • Check that the account can write to the data and logs folders and that every addons folder exists.

IIS returns 502 Bad Gateway

  • Confirm Odoo is running and answering on 127.0.0.1 at port 8069.
  • If only long reports fail, raise the ARR proxy timeout.

Links or redirects point to HTTP or the local address

  • Confirm proxy_mode is True, the host header is preserved, and the forwarded proto variable is allowed in URL Rewrite.
  • Correct the web.base.url system parameter.

PDF reports fail or lose their header

  • Put the patched wkhtmltopdf build on the system PATH and restart the service.
  • Check that report.url points to the local Odoo address if headers render blank behind the proxy.
💡Prefer to hand this off? Our Odoo hosting and administration service covers patching, backups and monitoring for servers like this one.
Odoo Server Setup

Want Odoo Running Securely on Your Windows Server?

Tatvamasi Labs installs and hardens Odoo on Windows and Linux servers, sets up HTTPS, service accounts and tested backups, and hands over a documented system your team can run.

Talk to Our Odoo Team →

Frequently Asked Questions

Yes, for small and midsize teams behind IIS with HTTPS. Odoo runs in threaded mode on Windows without multiple workers, so plan for Linux or Odoo.sh if you expect heavy use.
Use 64 bit Windows Server 2022 or 2025 with current security updates. Both include IIS and the WebSocket Protocol feature this setup needs.
Odoo 20 supports Python 3.12 to 3.14 and needs PostgreSQL 16 or later. Python 3.12 is the safest choice because its dependencies install without compiling.
Use pip download on a connected machine with the same Python version, copy the wheels and source to the server, then install with pip from that local folder.
Direct access works for a quick test but sends passwords unencrypted. For real use, let IIS handle HTTPS on port 443.
Schedule a nightly task that runs pg_dump for the database and copies the matching filestore folder. Keep copies off the server and test restores monthly.
The installer suits evaluation, but a source install is easier to patch and recover, and runs under a dedicated service account.