khoj-ai / khoj

Your AI second brain. Self-hostable. Get answers from the web or your docs. Build custom agents, schedule automations, do deep research. Turn any online or local LLM into your personal, autonomous AI (e.g gpt, claude, gemini, llama, qwen, mistral).
https://khoj.dev
GNU Affero General Public License v3.0
14.7k stars 731 forks source link

How to define non -standard postgresql port? #922

Closed andreiramani closed 1 month ago

andreiramani commented 1 month ago

Describe the bug

I have non-standard postgresql port, how do we config custom port for khoj?

--- error in python terminal --- conn = _connect(dsn, connection_factory=connection_factory, **kwasync) django.db.utils.OperationalError: connection to server at "localhost" (::1), port 5432 failed: Connection refused (0x0000274D/10061) Is the server running on that host and accepting TCP/IP connections? connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused (0x0000274D/10061) Is the server running on that host and accepting TCP/IP connections?

Platform

debanjum commented 1 month ago

You'd need to set the POSTGRES_PORT environment variable to the port your Postgres DB is available on. You can also set POSTGRES_HOST if it's at a non-standard url.

See the Khoj docker-compose.yml to find configurable environment variables for reference