The Ollama command-line client needs a separate server process, even when both run on one Linux machine. A could not connect to Ollama app error means the client cannot reach that server, and the cause can be a stopped service or an HTTP proxy intercepting the request.
The official Linux installer normally creates an ollama systemd service. Recovering a stopped service needs sudo access; checking its API and listing models do not require a downloaded model or a GPU.
Proxy settings belong to the process that inherits them. The current Ollama CLI bypasses proxies for its default loopback address, but a different local address or hostname in OLLAMA_HOST can still send requests through an HTTP proxy. A proxy variable's presence alone does not establish the cause of a connection error.
Steps to fix the could not connect to Ollama app error:
- Reproduce the connection failure with the Ollama model-list command.
$ ollama list Error: could not connect to ollama server, run 'ollama serve' to start itOlder releases can report could not connect to ollama app, is it running? instead. This Linux procedure assumes an installation managed by systemd on the same machine.
Related: How to install Ollama on Linux - Probe the default local API directly.
$ curl -fsS --noproxy '*' --connect-timeout 3 http://127.0.0.1:11434/api/version curl: (7) Failed to connect to 127.0.0.1 port 11434 after 0 ms: Could not connect to server
–noproxy '*' makes this request direct, and –connect-timeout 3 limits connection setup to three seconds. Connection refusal means no server accepts the request at this address. Version JSON means the local API already answers, so the failing CLI may be using a different endpoint or environment.
- Check whether the Ollama service is running.
$ systemctl is-active ollama inactive
inactive identifies a stopped service; active only confirms process state. A failed result needs service-log inspection before another start attempt. A missing unit requires the Linux installation rather than a second foreground server.
Related: How to check Ollama server status - Start the installed Ollama service if it is stopped.
$ sudo systemctl start ollama
Starting an already active unit leaves its process running. If startup fails, the service journal identifies the failure; an address-in-use message means another process owns the port. No public bind or firewall opening is needed for a local client.
Related: How to manage the Ollama service - Identify exported HTTP proxy variable names in the failing terminal.
$ env | cut -d= -f1 | grep -E '^(HTTP_PROXY|http_proxy)$' HTTP_PROXY http_proxy
No matching output means neither variable is exported. Only names are printed because proxy URLs can contain credentials. The variables affect this terminal's child processes, independently of the systemd service environment.
- Compare the CLI result without HTTP proxy variables.
$ env -u HTTP_PROXY -u http_proxy ollama list NAME ID SIZE MODIFIED
This changes the environment for one command. Success here when the original request fails implicates an HTTP proxy. If both fail while the direct API answers, OLLAMA_HOST may target a different server or port; removing proxy variables does not repair that mismatch. The default local endpoint is http://127.0.0.1:11434.
- Clear the HTTP proxy variables from this terminal when they caused the failure.
Other HTTP clients launched from this terminal will also stop using those variables. A new terminal inherits the original settings again unless their source is changed. HTTPS_PROXY is left intact for HTTPS model downloads. Ollama recommends HTTPS_PROXY for downloads and warns against HTTP_PROXY.
$ unset HTTP_PROXY http_proxy
- Confirm that an ordinary local API request returns the server version. Example output:
$ curl -fsS http://127.0.0.1:11434/api/version {"version":"0.40.16"}
The version follows the installed release. A successful direct probe followed by failure here points to remaining proxy settings; a server that has just started may need a moment before it accepts connections.
- Retest the original Ollama model-list command in the same terminal. Example output:
$ ollama list NAME ID SIZE MODIFIED
The header alone is a successful empty model list. Existing models appear underneath it; neither result requires a download. This request must succeed without the temporary env -u override.