Skip to Content

How to Change the Odoo Port? A Step-by-Step Guide

June 2, 2026 by

Changing the Odoo port is one of the basic configuration tasks that system administrators perform when deploying or managing an Odoo instance. By default, Odoo runs on port 8069, but there are many situations in which this setting needs to be changed - from port conflicts to security requirements or the need to run multiple Odoo instances on a single server.

Why change the default Odoo port?

Before we move on to the technical aspects of changing the port, it is worth understanding the reasons why administrators decide to make this modification:

  • Port conflict - port 8069 may already be in use by another application running on the same server
  • Running multiple instances - when we need several Odoo environments (production, test, development), each instance requires a separate port
  • Security - using a non-standard port makes it harder for potential attackers to identify the application
  • Organizational standards - some companies have internal policies regarding the ports used by applications
  • Reverse proxy configuration - when implementing Nginx or Apache as a reverse proxy, different internal ports are often required

Method 1: Changing the port via the configuration file

The most professional and recommended way to change the Odoo port is to edit the configuration file. This method ensures that the settings are persistent and makes configuration management easier.

Configuration file location

Depending on the operating system and installation method, the odoo.conf configuration file may be located in different places:

  • Ubuntu/Linux: /etc/odoo/odoo.conf or /etc/odoo.conf
  • Windows: C:\Program Files\Odoo\server\odoo.conf
  • Installation from source: in the root directory of the installation or specified with the --config parameter

If you installed Odoo following our guide How to Install Odoo on Ubuntu, the configuration file should be in the standard system location.

Editing the configuration file on Ubuntu

To change the Odoo port on Ubuntu, follow these steps:

  1. Open a terminal and obtain administrator privileges
  2. Edit the configuration file using your preferred editor:
    sudo nano /etc/odoo/odoo.conf
  3. Find or add the line with the http_port parameter (in older Odoo versions below version 10, xmlrpc_port was used):
    [options]
    http_port = 8080
    longpolling_port = 8072

    Note: Odoo also uses the longpolling port (8072 by default) to handle real-time notifications. If you change the main port, consider changing the longpolling port as well to avoid conflicts.

  4. Save the changes (in nano: Ctrl+X, then Y and Enter)
  5. Restart the Odoo service:
    sudo systemctl restart odoo
  6. Check the service status and logs to make sure Odoo has started on the new port:
    sudo systemctl status odoo
    sudo journalctl -u odoo -n 50

Editing the configuration file on Windows

If you are using an Odoo installation on Windows, the process is similar. You can find a detailed installation guide in the article How to Install Odoo on Windows.

  1. Locate the odoo.conf file in the installation directory
  2. Open the file in Notepad or another text editor (with administrator privileges)
  3. Find or add the parameter:
    http_port = 8080
    longpolling_port = 8072
  4. Save the changes
  5. Restart the Odoo service using Windows Services Manager or restart the server

Method 2: Changing the port using startup parameters

If you want to change the port temporarily or for testing, you can use a command-line parameter when starting Odoo:

./odoo-bin --http-port=8080

To also change the longpolling port:

./odoo-bin --http-port=8080 --gevent-port=8072

This method is useful during development or testing, but it is not recommended for production environments because it requires specifying the port every time you start Odoo.

Try Odoo for free

Method 3: Changing the port in a Docker installation

If you use Odoo in a Docker container, changing the port requires modifying the port mapping. You can find more information about installing Docker in the article How to Install Odoo Using Docker.

Changing the port in docker-compose.yml

Edit the docker-compose.yml file and change the port mapping:

version: '3.1'
services:
  web:
    image: odoo:17
    depends_on:
      - db
    ports:
      - "8080:8069"
      - "8072:8072"
    environment:
      - HOST=db
      - USER=odoo
      - PASSWORD=odoo
    volumes:
      - odoo-web-data:/var/lib/odoo
      - ./config:/etc/odoo
      - ./addons:/mnt/extra-addons
  db:
    image: postgres:15
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_PASSWORD=odoo
      - POSTGRES_USER=odoo
    volumes:
      - odoo-db-data:/var/lib/postgresql/data

volumes:
  odoo-web-data:
  odoo-db-data:

In this example, Odoo still runs inside the container on port 8069, but it is available on the host through port 8080. Port 8072 (longpolling) is mapped directly.

Changing the port inside the Docker container

If you want to change the port on which Odoo listens inside the container, you can use environment variables:

services:
  web:
    image: odoo:17
    ports:
      - "8080:8080"
    environment:
      - HOST=db
      - USER=odoo
      - PASSWORD=odoo
      - HTTP_PORT=8080

Changing the port when starting the container

You can also change the port mapping directly when starting the container:

docker run -d -p 8080:8069 -p 8072:8072 --name odoo --link db:db -t odoo:17

Firewall configuration

After changing the Odoo port, you must configure the firewall appropriately to allow traffic on the new port.

UFW configuration on Ubuntu

sudo ufw allow 8080/tcp
sudo ufw allow 8072/tcp
sudo ufw reload

firewalld configuration on CentOS/RHEL

sudo firewall-cmd --permanent --add-port=8080/tcp
sudo firewall-cmd --permanent --add-port=8072/tcp
sudo firewall-cmd --reload

Contact us

Verifying the port change

After making the changes, it is worth checking whether Odoo is actually listening on the new port. You can do this in several ways:

Checking with netstat

sudo netstat -tulpn | grep odoo

Checking with ss

sudo ss -tulpn | grep 8080

Checking the Odoo logs

The Odoo logs should contain information about the ports on which the server has started:

sudo journalctl -u odoo -n 100 | grep -i "http\|port"

You should see lines similar to:

INFO ? odoo.service.server: HTTP service (werkzeug) running on localhost:8080

Browser test

Open your browser and enter the address with the new port:

http://localhost:8080

or with the server's IP address:

http://192.168.1.100:8080

Best practices when changing the port

When modifying the Odoo port configuration, it is worth following a few rules:

  • Document the changes - always note which port is used by which Odoo instance
  • Use ports from the appropriate range - ports above 1024 do not require root privileges
  • Avoid conflicts - check that the chosen port is not already used by another application
  • Remember about longpolling - if you change the HTTP port, consider changing the longpolling port as well
  • Update the documentation - inform your team about the port change and update the internal documentation
  • Test after making changes - always verify that all Odoo features work correctly after the port change, especially real-time notifications
  • Back up the configuration - before making changes, create a backup copy of the configuration file

Try Odoo for free

Troubleshooting common problems

Port still in use

If Odoo does not start after changing the port, the chosen port may already be in use. Check which application is using the port:

sudo lsof -i :8080

No access after changing the port

If you cannot access Odoo after changing the port, check:

  • Whether the Odoo service was restarted correctly
  • Whether the firewall allows traffic on the new port (including longpolling)
  • Whether you are using the correct URL with the new port
  • Whether there are any error messages in the Odoo logs: sudo journalctl -u odoo -n 100
  • Whether the parameter in the configuration file is http_port (newer versions) and not xmlrpc_port (older versions)

Database problems

Changing the port should not affect the connection to the PostgreSQL database, but if you encounter problems, check the database configuration described in the article How to Configure a PostgreSQL Database for Odoo.

Reverse proxy configuration with the new port

If you use Nginx or Apache as a reverse proxy, you must update the proxy configuration after changing the Odoo port. Example for Nginx:

upstream odoo {
    server 127.0.0.1:8080;
}

upstream odoochat {
    server 127.0.0.1:8072;
}

server {
    listen 80;
    server_name yourdomain.com;

    proxy_read_timeout 720s;
    proxy_connect_timeout 720s;
    proxy_send_timeout 720s;

    # Longpolling handling
    location /longpolling {
        proxy_pass http://odoochat;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    # Main Odoo application
    location / {
        proxy_pass http://odoo;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_redirect off;
    }

    # Static files handling
    location ~* /web/static/ {
        proxy_cache_valid 200 90m;
        proxy_buffering on;
        expires 864000;
        proxy_pass http://odoo;
    }
}

FAQ - Frequently Asked Questions

Does changing the Odoo port affect system performance?

No, changing the port has no impact on Odoo performance. A port is just a number identifying a network communication endpoint. System performance depends on hardware resources, database configuration and application optimization, which you can read about in the article on Odoo system requirements.

Can I run Odoo on port 80 or 443?

Yes, it is technically possible, but running Odoo directly on ports 80 (HTTP) or 443 (HTTPS) is not recommended. It requires root privileges, which creates security risks. A better solution is to use a reverse proxy (Nginx or Apache) listening on ports 80/443, which forwards traffic to Odoo running on a higher port (e.g. 8069 or 8080).

What should I do if I forget which port my Odoo instance is running on?

You can check the active port in several ways: check the odoo.conf configuration file and find the http_port parameter (or xmlrpc_port in older versions), use the command sudo netstat -tulpn | grep odoo or sudo ss -tulpn | grep odoo to see which ports the Odoo process is listening on, or check the system logs: sudo journalctl -u odoo | grep -i "http\|port", where you will find information about the port when the service starts.

Do I have to change the longpolling port together with the HTTP port?

It is not mandatory, but it is recommended, especially when you run multiple Odoo instances on the same server. The longpolling port (8072 by default) handles real-time notifications and websocket communication. If you do not change it when starting additional instances, port conflicts and problems with notifications may occur.

Summary

Changing the Odoo port is a simple but important administrative operation that may be necessary for various reasons - from avoiding port conflicts to security requirements or the need to run multiple instances. The best method is to edit the odoo.conf configuration file and set the http_port parameter (in newer Odoo versions, from version 10 onwards) or xmlrpc_port (in older versions) to the chosen value. Do not forget the longpolling port (longpolling_port or gevent_port), which is used for real-time communication.

Remember to restart the Odoo service after making changes and to configure the firewall appropriately. Verify the changes by checking the system logs and testing access through a browser.

Regardless of the method you choose - whether editing the configuration file, startup parameters or Docker configuration - it is crucial to test the changes thoroughly and make sure that all system components work correctly, including real-time notifications. Proper port configuration is the foundation of a stable and secure Odoo installation.

Need help with Odoo configuration or implementing an ERP system in your company? The KK Innovations team of experts has extensive experience in implementing and optimizing Odoo for companies from various industries. Contact us to find out how we can help your organization make full use of the Odoo system!

Contact us