Before diving into the steps, it’s important to understand why you might need to change the default port. The standard port for Odoo is 8069. However, altering this can enhance security by reducing the predictability of your system setup. Additionally, if you run multiple instances of Odoo or other applications, changing the port can prevent conflicts and ensure smoother operation.
- Odoo Installation: Ensure you have Odoo installed on your server.
- Server Access: Administrative or root access to the server where Odoo is hosted.
- Basic Knowledge: Familiarity with command-line operations and server management.
Step 1: Locate the Odoo Configuration File
The first step is to locate the Odoo configuration file. This file typically resides in
/etc/odoo[version].conf depending on your installation.
sudo nano /etc/odoo.conf
sudo nano /etc/odoo/odoo.conf
Step 2: Modify the Port Number
Within the configuration file, look for the line that specifies the port. It usually appears as:
xmlrpc_port = 8069
Change 8069 to your desired port number. Ensure that the new port is not already in use by another service and is open in your firewall settings.
xmlrpc_port = 8090
After changing the port number, save the changes and exit the text editor. For instance, in nano, you would press CTRL + X, then Y to confirm, and Enter to exit.
Step 3: Restart the Odoo Service
For the changes to take effect, restart the Odoo service. This can be done with the following command:
sudo service odoo restart
Or, depending on your installation,
sudo systemctl restart odoo
Step 4: Verify the Change
To ensure that the port change has been successful, access Odoo through your web browser using the new port:
Replace 8090 with the port number you set, and yourserverdomain.com with your actual server domain or IP address.
Step 5: Additional Consideration
Should you have set up Apache or Nginx to function as a reverse proxy for Odoo, it’s essential to also update the respective configuration settings. For guidance on configuring Apache or Nginx as a reverse proxy for Odoo, please refer to the following instructional resources:
Changing the default port in Odoo is a straightforward process that can significantly impact your system’s security and efficiency. By following these steps, you can customize your Odoo installation to better fit your operational environment and enhance overall system management.
Remember, while changing the port is a simple task, always ensure you have proper backups and understand the implications of making such changes, especially in a production environment.