OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions

I am trying to run Tryton with Postgres on Windows. The database is initialised successfully and the postgres server is listening at the correct port.

I am also able to connect to the database using python code. But when I try to start the Tryton server using:

Traceback (most recent call last):
  File "C:\Users\user\Desktop\trytond\trytond-6.0.2\bin\trytond", line 79, in <module>
    run_simple(hostname, port, app,
               
  File "C:\Users\user\anaconda3\envs\trytond-6.0.2\lib\site-packages\werkzeug-1.0.1-py3.9.egg\werkzeug\serving.py", line 1053, in run_simple
    inner()
    
  File "C:\Users\user\anaconda3\envs\trytond-6.0.2\lib\site-packages\werkzeug-1.0.1-py3.9.egg\werkzeug\serving.py", line 997, in inner
    srv = make_server(
        
  File "C:\Users\user\anaconda3\envs\trytond-6.0.2\lib\site-packages\werkzeug-1.0.1-py3.9.egg\werkzeug\serving.py", line 848, in make_server
    return ThreadedWSGIServer(
        
  File "C:\Users\user\anaconda3\envs\trytond-6.0.2\lib\site-packages\werkzeug-1.0.1-py3.9.egg\werkzeug\serving.py", line 741, in __init__
    HTTPServer.__init__(self, server_address, handler)
    
  File "C:\Users\user\anaconda3\envs\trytond-6.0.2\lib\socketserver.py", line 452, in __init__
    self.server_bind()
    
  File "C:\Users\user\anaconda3\envs\trytond-6.0.2\lib\http\server.py", line 138, in server_bind
    socketserver.TCPServer.server_bind(self)
    
  File "C:\Users\user\anaconda3\envs\trytond-6.0.2\lib\socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
    
OSError: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions

It seems there are some kind of firewall or antivirus that prevents the user running trytond to open the listening socket.
You must configure the OS such that this user can open it (the default is 127.0.0.1 port 8000).

Ok, it was an error on my part.
I had the following in my configuration file:

[web]
listen = localhost:5432

[database]
database uri = postgresql://postgres:password@localhost:5432/

Being a noob, I was trying to use the same port for the database and the client!

You have to use a different port for the client.