All entries

    Ollama Environment Variables on Windows: Why Your Changes Did Not Apply

    Ollama ignores a new environment variable on Windows? Check the running process, user context and restart path before changing networking or model storage.

    A pixel-art Windows workstation passes a new configuration card to a restarted application while an older process keeps its previous card.
    Original GPT-generated pixel-art editorial illustration; conceptual artwork, not a product screenshot or test result.

    On Windows, Ollama inherits user and system environment variables when its process starts. Changing a variable in Settings does not rewrite the environment of an already-running application. If a documented setting appears ignored, quit Ollama fully, save the variable in the intended account context, and start the app again using the documented Windows procedure.

    Find the process that is actually serving requests

    First determine whether you use the Windows desktop app, a manually launched server, a service wrapper or a container. Those launch paths can inherit configuration differently. A setting changed for your interactive account may not apply to a process started under another account or a container configuration.

    Also check whether an older instance is still running. Starting another shell and setting a variable there does not necessarily replace the background app answering requests. Use supported application controls to quit and restart the intended process rather than killing unrelated processes indiscriminately.

    Distinguish variable scope from variable spelling

    Check the exact documented variable name and accepted value for your installed version. Then inspect where you set it. In PowerShell, the process environment is visible through the Env provider; user and machine values can also be inspected explicitly. Do not confuse a correctly spelled value in one scope with proof that another process inherited it.

    These commands inspect values, not the complete running server state. Do not publish private hostnames in their output. If you use another variable containing sensitive data, avoid printing it at all; verify behaviour through a safe supported diagnostic instead.

    PowerShell — inspect one non-sensitive setting locally
    $env:OLLAMA_HOST
    [Environment]::GetEnvironmentVariable('OLLAMA_HOST', 'User')
    [Environment]::GetEnvironmentVariable('OLLAMA_HOST', 'Machine')
    EXPLAINED / SEQUENCE

    Configuration is inherited at process start

    A simplified Windows process model; service and container launchers may have their own configuration paths.

    Before restart

    1. Saved variable

      A new user or system value exists for future processes.

    2. Existing process

      Can retain the environment it inherited earlier.

    After restart

    1. Intended launcher

      Starts Ollama in the intended user context.

    2. Observed behaviour

      Verify the setting through a supported diagnostic or harmless request.

    THE KEY DISTINCTION

    A saved value and a running process using that value are two different observations.

    Author-created explanatory diagram. Arrows show the process described in the article, not measured performance.

    Follow the Windows restart sequence

    Ollama's FAQ describes quitting the app, editing the account's environment variables through Windows settings, saving the changes and starting Ollama again from the Start menu. Use that sequence for the ordinary desktop setup. If you intentionally use a service or container, follow that launcher's configuration instructions instead.

    A browser refresh is not a server restart. Nor does closing a terminal necessarily stop an independently running desktop application. The process that receives the request must be the one started after the new configuration became available.

    Scroll the table horizontally to see all columns.

    Follow the Windows restart sequence
    ObservationWhat it provesWhat remains to check
    Variable visible in current shellThat shell has the valueBackground app inherited it
    Value saved at user scopeFuture relevant processes can inherit itCorrect user and launch path
    App restartedA new process should existIt is the process serving the request
    Behaviour changed in a testTested path uses the expected settingOther clients or instances behave the same

    Verify with a harmless request

    Choose a supported check tied to the setting you changed. For a model directory change, inspect the documented storage behaviour and installed model availability. For a connection setting, confirm the intended local endpoint and client path. Do not expose the service on every network interface merely to prove that a configuration was read.

    Record the installed version, setting name, launch method and observed result. Keep secret values out of the record. If the value is accepted but the behaviour still differs, inspect whether another configuration source, instance or client route explains the discrepancy.

    Avoid turning a scope problem into a networking problem

    A common wrong turn is broadening OLLAMA_HOST or allowing every browser origin because a client cannot connect. Those changes affect exposure and browser access, not simply environment inheritance. First verify which process is running and which address the client is using.

    Similarly, increasing queue or context settings without confirming the active process can create confusion: the new value may not be in effect, or it may take effect later after an unrelated restart. Make one deliberate change and verify it before adjusting capacity controls.

    Keep a small working configuration record

    The general lesson applies to many developer tools: configuration is data consumed by a process at a particular time and scope. Checking that consumption is more useful than repeatedly typing the same value into different windows.

    • Record the app version and launch path.
    • Record variable names and intended scopes without secret values.
    • Quit the intended process before testing a restart-dependent change.
    • Verify the actual request route after restart.
    • Remove obsolete settings only after understanding why they were present.

    Frequently asked questions

    Why did editing an Ollama environment variable have no effect? An already-running process can retain its previous environment. Confirm the correct user context, quit Ollama fully and restart it using the documented Windows procedure.

    Does setting a variable in PowerShell update every running app? No. A process-scoped setting affects that shell and processes it launches. It does not rewrite the environment of an existing Ollama desktop process or a separate service.

    Should I post all environment variables in a bug report? No. Inspect only the relevant non-sensitive variable and sanitise the output. A full environment dump can contain credentials and unrelated private configuration.

    FURTHER READING

    Sources

    Technical references checked .

    END OF ENTRY / 132
    Eeshan Singh with Big Ben in London
    BEHIND THE JOURNAL

    Eeshan Singh

    I’m Eeshan Singh Pokharia, an AI Full Stack Developer and CoFounder of UltraFit360. I work across AI features, full-stack product development, and web and mobile experiences—from Figma and frontend interactions to the systems behind them.

    This guide is about process inheritance, not a private deployment incident. The example checks one non-sensitive setting and avoids dumping a developer machine's entire environment into logs or public support threads.

    Meet the author
    THE CONVERSATION

    Your side of the story.