[GH-ISSUE #2472] How do I change the API's localhost to access it via the local machine's IP? #1605

Closed
opened 2026-02-22 18:25:38 -05:00 by yindo · 2 comments
Owner

Originally created by @zhijianren on GitHub (Oct 15, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2472

Based on AnythingLLM + Ollama, I deployed a model, and it works fine when accessing it with curl -X POST http://localhost:3001/api/v1/workspace/llm/chat.... However, when I replace localhost with the IP address (e.g., curl -X POST http://172.13.x.xxx:3001/api/v1/workspace/llm/chat...), it shows curl: (7) Failed to connect to 172.13.x.xxx port 3001 after 2055 ms: Could not connect to server. In summary, I can access it using localhost and 127.0.0.1 with the port number, but using the local machine's IP address with the port number does not work. How can AnythingLLM listen on all IPs so that other devices can access it via the IP address?

Originally created by @zhijianren on GitHub (Oct 15, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2472 Based on AnythingLLM + Ollama, I deployed a model, and it works fine when accessing it with curl -X POST http://localhost:3001/api/v1/workspace/llm/chat.... However, when I replace localhost with the IP address (e.g., curl -X POST http://172.13.x.xxx:3001/api/v1/workspace/llm/chat...), it shows curl: (7) Failed to connect to 172.13.x.xxx port 3001 after 2055 ms: Could not connect to server. In summary, I can access it using localhost and 127.0.0.1 with the port number, but using the local machine's IP address with the port number does not work. How can AnythingLLM listen on all IPs so that other devices can access it via the IP address?
yindo closed this issue 2026-02-22 18:25:38 -05:00
Author
Owner

@timothycarambat commented on GitHub (Oct 15, 2024):

Are you on the desktop app?
If so, then you should go to the settings > security and enable "Disoverable on network".
Close and reopen app again and now the backend server for the app will listen on 0.0.0.0:3001 making is discoverable by other machines on the LAN.

If on Docker, this is a configuration issue that can be solved by attaching a network bridge or more commonly is blocked by computer firewalls and is outside of the AnythingLLM software directly.

@timothycarambat commented on GitHub (Oct 15, 2024): Are you on the desktop app? If so, then you should go to the settings > security and enable "Disoverable on network". Close and reopen app again and now the backend server for the app will listen on `0.0.0.0:3001` making is discoverable by other machines on the LAN. If on Docker, this is a configuration issue that can be solved by attaching a network bridge or more commonly is blocked by computer firewalls and is outside of the AnythingLLM software directly.
Author
Owner

@zhijianren commented on GitHub (Oct 16, 2024):

Thank you very much for your reply. The problem has been solved.

@zhijianren commented on GitHub (Oct 16, 2024): Thank you very much for your reply. The problem has been solved.
yindo changed title from How do I change the API's localhost to access it via the local machine's IP? to [GH-ISSUE #2472] How do I change the API's localhost to access it via the local machine's IP? 2026-06-05 14:41:41 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1605