{"id":2112,"date":"2026-08-05T20:05:37","date_gmt":"2026-08-05T20:05:37","guid":{"rendered":"https:\/\/convly.ai\/?p=2112"},"modified":"2026-08-05T20:05:37","modified_gmt":"2026-08-05T20:05:37","slug":"ollama-port-configuration-guide","status":"publish","type":"post","link":"https:\/\/convly.ai\/it\/ollama-port-configuration-guide\/","title":{"rendered":"Porta Ollama: valore predefinito 11434, come modificarla e risolvere i conflitti"},"content":{"rendered":"<div class=\"convly-tldr\">\n<ul>\n<li><strong>The default Ollama port is 11434<\/strong>, served over plain HTTP and bound to <code>127.0.0.1<\/code> (localhost only).<\/li>\n<li>Change it with the <code>OLLAMA_HOST<\/code> environment variable \u2014 e.g. <code>OLLAMA_HOST=127.0.0.1:11435<\/code>. There is no <code>OLLAMA_PORT<\/code> variable.<\/li>\n<li>To reach Ollama from another machine, bind to <code>0.0.0.0:11434<\/code> and open the firewall \u2014 but the API has <strong>no authentication<\/strong>, so restrict it to a trusted network or put a reverse proxy in front.<\/li>\n<li>Verify with <code>curl http:\/\/127.0.0.1:11434<\/code>, which returns <code>Ollama is running<\/code>.<\/li>\n<\/ul>\n<\/div>\n<p>Ollama listens on <strong>port 11434<\/strong> by default, over HTTP, bound to the loopback address <code>127.0.0.1<\/code>. So the API base URL on the machine itself is <code>http:\/\/127.0.0.1:11434<\/code>. Because it binds to loopback rather than all interfaces, nothing outside that machine can reach it until you deliberately change the bind address.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-flat ez-toc-counter ez-toc-container-direction\">\n<label for=\"ez-toc-cssicon-toggle-item-6a73cbb53684b\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #000000;color:#000000\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #000000;color:#000000\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a73cbb53684b\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/convly.ai\/it\/ollama-port-configuration-guide\/#What_Actually_Runs_on_Port_11434\" >What Actually Runs on Port 11434<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/convly.ai\/it\/ollama-port-configuration-guide\/#OLLAMA_HOST_The_One_Variable_That_Controls_the_Port\" >OLLAMA_HOST: The One Variable That Controls the Port<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/convly.ai\/it\/ollama-port-configuration-guide\/#Changing_the_Ollama_Port_on_Linux\" >Changing the Ollama Port on Linux<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/convly.ai\/it\/ollama-port-configuration-guide\/#Changing_the_Ollama_Port_on_macOS\" >Changing the Ollama Port on macOS<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/convly.ai\/it\/ollama-port-configuration-guide\/#Changing_the_Ollama_Port_on_Windows\" >Changing the Ollama Port on Windows<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/convly.ai\/it\/ollama-port-configuration-guide\/#Verifying_the_Server_Is_Listening\" >Verifying the Server Is Listening<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/convly.ai\/it\/ollama-port-configuration-guide\/#Making_Ollama_Reachable_From_Other_Machines\" >Making Ollama Reachable From Other Machines<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/convly.ai\/it\/ollama-port-configuration-guide\/#Diagnosing_a_Port_Conflict\" >Diagnosing a Port Conflict<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/convly.ai\/it\/ollama-port-configuration-guide\/#Docker_and_WSL\" >Docker and WSL<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/convly.ai\/it\/ollama-port-configuration-guide\/#Frequently_asked_questions\" >Frequently asked questions<\/a><\/li><li class='ez-toc-page-1'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/convly.ai\/it\/ollama-port-configuration-guide\/#Quick_Reference\" >Quick Reference<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"What_Actually_Runs_on_Port_11434\"><\/span>What Actually Runs on Port 11434<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Port 11434 is the Ollama HTTP server \u2014 the same process that <code>ollama serve<\/code> starts, and the same one the desktop app starts in the background. Every part of Ollama talks to it: the <code>ollama<\/code> CLI, the desktop chat window, and any third-party client you point at it.<\/p>\n<table>\n<thead>\n<tr>\n<th>Endpoint<\/th>\n<th>Purpose<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>GET \/<\/code><\/td>\n<td>Health check \u2014 returns the plain text <code>Ollama is running<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>GET \/api\/tags<\/code><\/td>\n<td>Lists locally installed models as JSON<\/td>\n<\/tr>\n<tr>\n<td><code>POST \/api\/generate<\/code>, <code>POST \/api\/chat<\/code><\/td>\n<td>Native Ollama inference endpoints<\/td>\n<\/tr>\n<tr>\n<td><code>POST \/api\/pull<\/code>, <code>DELETE \/api\/delete<\/code><\/td>\n<td>Model management \u2014 download and remove models<\/td>\n<\/tr>\n<tr>\n<td><code>\/v1\/chat\/completions<\/code><\/td>\n<td>OpenAI-compatible layer, for SDKs that expect an OpenAI base URL<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Note that row for <code>\/api\/pull<\/code> and <code>\/api\/delete<\/code>. Anyone who can reach the port can download multi-gigabyte models onto your disk or delete the ones you have. That is the security story in one line, and it is why the default bind is loopback. If you are still deciding what to install locally, the <a href=\"https:\/\/convly.ai\/ollama-models-list-2026\/\">Ollama models list<\/a> covers what is available and how large each one is.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"OLLAMA_HOST_The_One_Variable_That_Controls_the_Port\"><\/span>OLLAMA_HOST: The One Variable That Controls the Port<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Both the bind address and the port come from a single environment variable, <code>OLLAMA_HOST<\/code>. There is no separate port setting and no config file that overrides it.<\/p>\n<table>\n<thead>\n<tr>\n<th>Value<\/th>\n<th>Result<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><em>unset<\/em><\/td>\n<td>Listens on <code>127.0.0.1:11434<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>127.0.0.1:11435<\/code><\/td>\n<td>Same loopback-only behaviour, different port<\/td>\n<\/tr>\n<tr>\n<td><code>0.0.0.0:11434<\/code><\/td>\n<td>Listens on every IPv4 interface \u2014 reachable from the LAN<\/td>\n<\/tr>\n<tr>\n<td><code>192.168.1.50:11434<\/code><\/td>\n<td>Listens on one specific interface only<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Always write it as <code>host:port<\/code>. Shorter forms are accepted in some versions, but the explicit pair behaves consistently across all of them.<\/p>\n<p>One gotcha catches nearly everyone: <strong><code>OLLAMA_HOST<\/code> is read by the client as well as the server.<\/strong> If you move the server to port 11435 but your terminal still has the default, <code>ollama list<\/code> will fail with a connection error while the server is perfectly healthy. Set the variable in both places, or run the CLI as <code>OLLAMA_HOST=127.0.0.1:11435 ollama list<\/code>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Changing_the_Ollama_Port_on_Linux\"><\/span>Changing the Ollama Port on Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The Linux install script registers a systemd service, so environment variables in your shell are irrelevant \u2014 you have to put them in the unit. Use a drop-in override rather than editing the shipped unit file, which package upgrades will overwrite:<\/p>\n<pre><code>sudo systemctl edit ollama.service<\/code><\/pre>\n<p>Add this block (on newer systemd, put it between the <code>### Anything between here...<\/code> marker comments):<\/p>\n<pre><code>[Service]\nEnvironment=\"OLLAMA_HOST=0.0.0.0:11434\"<\/code><\/pre>\n<p>That writes <code>\/etc\/systemd\/system\/ollama.service.d\/override.conf<\/code>. Apply it:<\/p>\n<pre><code>sudo systemctl daemon-reload\nsudo systemctl restart ollama\nsudo systemctl status ollama<\/code><\/pre>\n<p>Add one <code>Environment=<\/code> line per variable \u2014 a second line does not replace the first. If you are also relocating model storage, <code>Environment=\"OLLAMA_MODELS=\/mnt\/models\"<\/code> goes in the same block.<\/p>\n<h3>If you run <code>ollama serve<\/code> manually<\/h3>\n<p>No systemd involved, so just export it: <code>OLLAMA_HOST=0.0.0.0:11434 ollama serve<\/code>. Make sure the systemd service is stopped first (<code>sudo systemctl stop ollama<\/code>) or the two will fight over the port.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Changing_the_Ollama_Port_on_macOS\"><\/span>Changing the Ollama Port on macOS<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The macOS app is launched by the GUI session, which does not inherit your shell profile. Exporting <code>OLLAMA_HOST<\/code> in <code>.zshrc<\/code> changes the CLI but not the background server. Use <code>launchctl<\/code> instead:<\/p>\n<pre><code>launchctl setenv OLLAMA_HOST \"0.0.0.0:11434\"<\/code><\/pre>\n<p>Then quit Ollama from the menu bar icon and relaunch it. The new value only applies to processes started afterwards.<\/p>\n<p><code>launchctl setenv<\/code> does <strong>not<\/strong> survive a reboot. For a permanent change you need to re-run it at login \u2014 a LaunchAgent plist, or a login item that runs the command. Recent versions of the macOS app also expose a network-access toggle in Settings; if your build has it, prefer it, since it persists properly. Check the app&#8217;s own settings pane before building a LaunchAgent, and see the <a href=\"https:\/\/convly.ai\/what-is-ollama-complete-guide-2026\/\">Ollama complete guide<\/a> for what else lives in there.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Changing_the_Ollama_Port_on_Windows\"><\/span>Changing the Ollama Port on Windows<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Ollama on Windows runs as a normal user process with a system tray icon, so a user-level environment variable is enough.<\/p>\n<ol>\n<li>Press <kbd>Win<\/kbd>, type <em>environment variables<\/em>, and open <strong>Edit the system environment variables<\/strong> \u2192 <strong>Environment Variables\u2026<\/strong><\/li>\n<li>Under <strong>User variables<\/strong>, click <strong>New<\/strong>.<\/li>\n<li>Name: <code>OLLAMA_HOST<\/code>. Value: <code>0.0.0.0:11434<\/code> (or your chosen port).<\/li>\n<li>Click OK on both dialogs.<\/li>\n<li><strong>Right-click the Ollama tray icon and choose Quit<\/strong>, then start Ollama again from the Start menu.<\/li>\n<\/ol>\n<p>Step 5 is the one people skip. Closing the window does not stop the server; it keeps running with the old value. Equivalently from a terminal: <code>setx OLLAMA_HOST \"0.0.0.0:11434\"<\/code> \u2014 but <code>setx<\/code> only affects processes launched <em>after<\/em> it runs, so the quit-and-relaunch is still required. If you are setting this up from scratch, the <a href=\"https:\/\/convly.ai\/how-to-install-ollama-2026\/\">Ollama installation guide<\/a> walks through the Windows installer end to end.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Verifying_the_Server_Is_Listening\"><\/span>Verifying the Server Is Listening<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Two checks, in this order: is something bound to the port, and is that something Ollama?<\/p>\n<table>\n<thead>\n<tr>\n<th>Platform<\/th>\n<th>Command<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Any<\/td>\n<td><code>curl http:\/\/127.0.0.1:11434<\/code> \u2192 <code>Ollama is running<\/code><\/td>\n<\/tr>\n<tr>\n<td>Any<\/td>\n<td><code>curl http:\/\/127.0.0.1:11434\/api\/tags<\/code> \u2192 JSON list of models<\/td>\n<\/tr>\n<tr>\n<td>Linux<\/td>\n<td><code>sudo ss -tlnp | grep 11434<\/code><\/td>\n<\/tr>\n<tr>\n<td>macOS<\/td>\n<td><code>lsof -nP -iTCP:11434 -sTCP:LISTEN<\/code><\/td>\n<\/tr>\n<tr>\n<td>Windows<\/td>\n<td><code>netstat -ano | findstr :11434<\/code><\/td>\n<\/tr>\n<tr>\n<td>Windows (PowerShell)<\/td>\n<td><code>Get-NetTCPConnection -LocalPort 11434<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Read the local address column carefully. <code>127.0.0.1:11434<\/code> means loopback only \u2014 a remote machine will never connect, no matter what the firewall says. <code>0.0.0.0:11434<\/code> or <code>*:11434<\/code> means all interfaces.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Making_Ollama_Reachable_From_Other_Machines\"><\/span>Making Ollama Reachable From Other Machines<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Binding to <code>0.0.0.0<\/code> is necessary but usually not sufficient. Three things must all be true: the server is bound to a non-loopback address, the host firewall allows inbound TCP on the port, and the client is using the host&#8217;s LAN IP rather than <code>localhost<\/code>.<\/p>\n<h3>Firewall rules<\/h3>\n<table>\n<thead>\n<tr>\n<th>Platform<\/th>\n<th>How to allow inbound TCP 11434<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Windows<\/td>\n<td>PowerShell as Administrator: <code>New-NetFirewallRule -DisplayName \"Ollama\" -Direction Inbound -Protocol TCP -LocalPort 11434 -Action Allow<\/code><\/td>\n<\/tr>\n<tr>\n<td>Linux (ufw)<\/td>\n<td><code>sudo ufw allow from 192.168.1.0\/24 to any port 11434 proto tcp<\/code><\/td>\n<\/tr>\n<tr>\n<td>Linux (firewalld)<\/td>\n<td><code>sudo firewall-cmd --permanent --add-port=11434\/tcp<\/code> then <code>sudo firewall-cmd --reload<\/code><\/td>\n<\/tr>\n<tr>\n<td>macOS<\/td>\n<td>System Settings \u2192 Network \u2192 Firewall \u2192 Options, then allow incoming connections for Ollama (or answer Yes to the prompt on first launch)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Scope the rule to your subnet where you can, as in the ufw example, rather than allowing the world.<\/p>\n<h3>The security implications, plainly<\/h3>\n<p>The Ollama API has <strong>no authentication, no API keys, and no TLS<\/strong>. Binding to <code>0.0.0.0<\/code> gives everyone who can route to that address full control: run inference, read the model list, pull new models, delete existing ones. Internet-exposed Ollama instances get found by scanners quickly, because 11434 is a well-known port.<\/p>\n<p>Safer options, roughly in order of effort:<\/p>\n<ul>\n<li><strong>SSH tunnel<\/strong> \u2014 leave the bind at loopback and forward it: <code>ssh -L 11434:127.0.0.1:11434 user@server<\/code>. Nothing is exposed; the client talks to its own localhost.<\/li>\n<li><strong>Overlay network<\/strong> \u2014 Tailscale, WireGuard or similar. Bind to the overlay interface&#8217;s IP so only devices on your tailnet can connect.<\/li>\n<li><strong>Reverse proxy<\/strong> \u2014 Caddy or nginx in front, terminating TLS and enforcing basic auth or a bearer token, with Ollama itself still on loopback.<\/li>\n<\/ul>\n<p>If you are weighing a shared home-lab server against paying per token, the <a href=\"https:\/\/convly.ai\/self-hosting-vs-api-calculator\/\">self-hosting vs API break-even calculator<\/a> puts numbers on the trade-off, and the <a href=\"https:\/\/convly.ai\/llm-vram-calculator\/\">VRAM calculator<\/a> tells you whether the box you want to share can actually hold the model.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Diagnosing_a_Port_Conflict\"><\/span>Diagnosing a Port Conflict<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The symptom is a startup failure that names the address, something close to:<\/p>\n<pre><code>Error: listen tcp 127.0.0.1:11434: bind: address already in use<\/code><\/pre>\n<p>Find the owner of the port:<\/p>\n<pre><code># Linux\nsudo ss -tlnp | grep 11434\n\n# macOS\nlsof -nP -iTCP:11434 -sTCP:LISTEN\n\n# Windows \u2014 get the PID, then name it\nnetstat -ano | findstr :11434\ntasklist \/FI \"PID eq 12345\"<\/code><\/pre>\n<p>In practice the culprit is almost always Ollama itself, running twice. Common versions of that:<\/p>\n<ul>\n<li>The desktop app is already running in the tray or menu bar and you typed <code>ollama serve<\/code> in a terminal. The app&#8217;s server is fine \u2014 just use it.<\/li>\n<li>On Linux, the systemd service is active and you ran <code>ollama serve<\/code> manually. Stop one: <code>sudo systemctl stop ollama<\/code>.<\/li>\n<li>A Docker container published <code>-p 11434:11434<\/code> and holds the host port. Check with <code>docker ps<\/code>.<\/li>\n<\/ul>\n<p>If it is genuinely another application, move Ollama instead of fighting it \u2014 pick a free high port such as <code>127.0.0.1:11435<\/code> and set <code>OLLAMA_HOST<\/code> as described above. Remember to update every client&#8217;s base URL, including any OpenAI-compatible SDK config.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Docker_and_WSL\"><\/span>Docker and WSL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Inside the official container the server binds to <code>0.0.0.0:11434<\/code> already, so you only choose the host mapping: <code>docker run -d -p 127.0.0.1:11434:11434 --name ollama ollama\/ollama<\/code> keeps it local, while <code>-p 11434:11434<\/code> exposes it on all host interfaces. To move the host-side port, change the left number only \u2014 <code>-p 11435:11434<\/code> \u2014 and leave the container&#8217;s internal port alone.<\/p>\n<p>From WSL2 to an Ollama running on the Windows host, <code>localhost<\/code> does not always resolve to the host. Bind Windows-side Ollama to <code>0.0.0.0:11434<\/code>, allow the port in Windows Defender Firewall, and connect from WSL using the host IP from <code>\/etc\/resolv.conf<\/code> or the mirrored-networking address, depending on your WSL configuration.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Frequently_asked_questions\"><\/span>Frequently asked questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3>Is there an OLLAMA_PORT environment variable?<\/h3>\n<p>No. Port and bind address are both set through <code>OLLAMA_HOST<\/code>, written as <code>host:port<\/code>. Setting <code>OLLAMA_PORT<\/code> has no effect \u2014 Ollama ignores it and keeps using 11434, which is why the change appears to silently fail.<\/p>\n<h3>I set OLLAMA_HOST to 0.0.0.0 but remote machines still cannot connect. Why?<\/h3>\n<p>Check the three layers in order. Confirm the server is actually bound to <code>0.0.0.0<\/code> and not <code>127.0.0.1<\/code> using <code>ss<\/code>, <code>lsof<\/code> or <code>netstat<\/code>; confirm the host firewall allows inbound TCP on the port; and confirm the client is using the host&#8217;s LAN IP, not <code>localhost<\/code>. The most common single cause is not fully restarting the Ollama process after setting the variable.<\/p>\n<h3>Does changing the port break the ollama CLI?<\/h3>\n<p>It can. The CLI reads the same <code>OLLAMA_HOST<\/code> variable to decide where to connect, so if the server moved but your shell has not, commands like <code>ollama list<\/code> fail with a connection error. Set the variable in your shell profile too, or prefix individual commands with it.<\/p>\n<h3>Can I run two Ollama instances on different ports?<\/h3>\n<p>Yes \u2014 start each with a different <code>OLLAMA_HOST<\/code>. They will share the same model directory unless you also give each its own <code>OLLAMA_MODELS<\/code> path. Be aware that both instances load weights into the same GPU, so two large models running at once will contend for VRAM; the <a href=\"https:\/\/convly.ai\/vram-requirements-every-major-llm-2026\/\">VRAM requirements by model<\/a> reference shows how much headroom you actually have.<\/p>\n<h3>What base URL do OpenAI-compatible clients need?<\/h3>\n<p>Point the SDK&#8217;s base URL at <code>http:\/\/localhost:11434\/v1<\/code> (adjusting host and port if you changed them). Most clients also require an API key field to be non-empty even though Ollama ignores it, so pass any placeholder string such as <code>ollama<\/code>.<\/p>\n<h3>Is it safe to expose port 11434 to the internet?<\/h3>\n<p>No. There is no built-in authentication or encryption, and the exposed API includes model pull and delete. If you need remote access, use an SSH tunnel or a private overlay network, or place an authenticating reverse proxy with TLS in front of it. If remote access is the main requirement, compare the running cost against hosted inference with the <a href=\"https:\/\/convly.ai\/ai-api-cost-calculator\/\">API cost calculator<\/a> before building the plumbing.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Quick_Reference\"><\/span>Quick Reference<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<table>\n<thead>\n<tr>\n<th>Task<\/th>\n<th>Action<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Default port<\/td>\n<td><code>11434<\/code> on <code>127.0.0.1<\/code>, HTTP<\/td>\n<\/tr>\n<tr>\n<td>Change port<\/td>\n<td><code>OLLAMA_HOST=127.0.0.1:11435<\/code><\/td>\n<\/tr>\n<tr>\n<td>Expose to LAN<\/td>\n<td><code>OLLAMA_HOST=0.0.0.0:11434<\/code> + firewall rule<\/td>\n<\/tr>\n<tr>\n<td>Persist on Linux<\/td>\n<td><code>systemctl edit ollama.service<\/code> \u2192 <code>Environment=\"OLLAMA_HOST=\u2026\"<\/code><\/td>\n<\/tr>\n<tr>\n<td>Persist on macOS<\/td>\n<td><code>launchctl setenv OLLAMA_HOST \"\u2026\"<\/code>, re-applied at login<\/td>\n<\/tr>\n<tr>\n<td>Persist on Windows<\/td>\n<td>User environment variable, then quit and relaunch from the tray<\/td>\n<\/tr>\n<tr>\n<td>Health check<\/td>\n<td><code>curl http:\/\/127.0.0.1:11434<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>With the port sorted, the next question is usually which model to put behind it \u2014 <a href=\"https:\/\/convly.ai\/best-local-llms-to-run-on-ollama-2026\/\">the best local models for Ollama<\/a> covers the current options by hardware tier.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The default Ollama port is 11434, served over plain HTTP and bound to 127.0.0.1 (localhost only). Change it with the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2113,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[7],"tags":[],"class_list":["post-2112","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-news"],"_links":{"self":[{"href":"https:\/\/convly.ai\/it\/wp-json\/wp\/v2\/posts\/2112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/convly.ai\/it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/convly.ai\/it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/convly.ai\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/convly.ai\/it\/wp-json\/wp\/v2\/comments?post=2112"}],"version-history":[{"count":1,"href":"https:\/\/convly.ai\/it\/wp-json\/wp\/v2\/posts\/2112\/revisions"}],"predecessor-version":[{"id":2114,"href":"https:\/\/convly.ai\/it\/wp-json\/wp\/v2\/posts\/2112\/revisions\/2114"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/convly.ai\/it\/wp-json\/wp\/v2\/media\/2113"}],"wp:attachment":[{"href":"https:\/\/convly.ai\/it\/wp-json\/wp\/v2\/media?parent=2112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/convly.ai\/it\/wp-json\/wp\/v2\/categories?post=2112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/convly.ai\/it\/wp-json\/wp\/v2\/tags?post=2112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}