<titledata-rh="true">Using the `DOCKER_HOST` environment variable | Podman Desktop</title><metadata-rh="true"name="viewport"content="width=device-width,initial-scale=1"><metadata-rh="true"name="twitter:card"content="summary_large_image"><metadata-rh="true"property="og:image"content="https://podman-desktop.io/img/banner_podman-desktop.png"><metadata-rh="true"name="twitter:image"content="https://podman-desktop.io/img/banner_podman-desktop.png"><metadata-rh="true"property="og:url"content="https://podman-desktop.io/docs/migrating-from-docker/using-the-docker_host-environment-variable"><metadata-rh="true"property="og:locale"content="en"><metadata-rh="true"name="docusaurus_locale"content="en"><metadata-rh="true"name="docsearch:language"content="en"><metadata-rh="true"name="docusaurus_version"content="current"><metadata-rh="true"name="docusaurus_tag"content="docs-default-current"><metadata-rh="true"name="docsearch:version"content="current"><metadata-rh="true"name="docsearch:docusaurus_tag"content="docs-default-current"><metadata-rh="true"property="og:title"content="Using the `DOCKER_HOST` environment variable | Podman Desktop"><metadata-rh="true"name="description"content="Using the `DOCKER_HOST` environment variable can make it easier to migrate from Docker to Podman Desktop, as it allows you to continue using familiar Docker commands while taking advantage of the benefits of Podman."><metadata-rh="true"property="og:description"content="Using the `DOCKER_HOST` environment variable can make it easier to migrate from Docker to Podman Desktop, as it allows you to continue using familiar Docker commands while taking advantage of the benefits of Podman."><metadata-rh="true"name="keywords"content="podman desktop,podman,containers,docker_host,environment,variable"><linkdata-rh="true"rel="icon"href="/img/favicon.ico"><linkdata-rh="true"rel="canonical"href="https://podman-desktop.io/docs/migrating-from-docker/using-the-docker_host-environment-variable"><linkdata-rh="true"rel="alternate"href="https://podman-desktop.io/docs/migrating-from-docker/using-the-docker_host-environment-variable"hreflang="en"><linkdata-rh="true"rel="alternate"href="https://podman-desktop.io/docs/migrating-from-docker/using-the-docker_host-environment-variable"hreflang="x-default"><linkdata-rh="true"rel="preconnect"href="https://MR01ANKQ9S-dsn.algolia.net"crossorigin="anonymous"><linkrel="alternate"type="application/rss+xml"href="/blog/rss.xml"title="Podman Desktop RSS Feed">
<linkrel="alternate"type="application/atom+xml"href="/blog/atom.xml"title="Podman Desktop Atom Feed">
<li>Your tools, such as <ahref="https://gradle.org/"target="_blank"rel="noopener noreferrer">Gradle</a> or <ahref="https://www.testcontainers.com/"target="_blank"rel="noopener noreferrer">Testcontainers</a>, communicate with Podman without reconfiguration.</li>
<h4class="anchor anchorWithStickyNavbar_JmGV"id="prerequisites">Prerequisites<ahref="#prerequisites"class="hash-link"aria-label="Direct link to Prerequisites"title="Direct link to Prerequisites"></a></h4>
<h4class="anchor anchorWithStickyNavbar_JmGV"id="procedure">Procedure<ahref="#procedure"class="hash-link"aria-label="Direct link to Procedure"title="Direct link to Procedure"></a></h4>
<li>Set the <code>DOCKER_HOST</code> environment variable to your Podman pipe location. You'll need to replace back slashes with forward slashes and add the <code>npipe://</code> scheme to the path retrieved previously: </li>
</blockquote><p>Depending on your terminal emulator of preference there is a little variation between the commands to set a session level environment variable:</p><h5class="anchor anchorWithStickyNavbar_JmGV"id="cmd---command-prompt">cmd - Command Prompt<ahref="#cmd---command-prompt"class="hash-link"aria-label="Direct link to cmd - Command Prompt"title="Direct link to cmd - Command Prompt"></a></h5><divclass="language-cmd codeBlockContainer_mQmQ theme-code-block"style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><divclass="codeBlockContent_D5yF"><pretabindex="0"class="prism-code language-cmd codeBlock_RMoD thin-scrollbar"style="color:#F8F8F2;background-color:#282A36"><codeclass="codeBlockLines_AclH"><spanclass="token-line"style="color:#F8F8F2"><spanclass="token plain">set DOCKER_HOST=npipe://<inspect_command_output></span><br></span></code></pre><divclass="buttonGroup_aaMX"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_z5j7"aria-hidden="true"><svgviewBox="0 0 24 24"class="copyButtonIcon_FoOz"><pathfill="currentColor"d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgviewBox="0 0 24 24"class="copyButtonSuccessIcon_L0B6"><pathfill="currentColor"d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h5class="anchor anchorWithStickyNavbar_JmGV"id="git-bash">Git Bash<ahref="#git-bash"class="hash-link"aria-label="Direct link to Git Bash"title="Direct link to Git Bash"></a></h5><divclass="language-bash codeBlockContainer_mQmQ theme-code-block"style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><divclass="codeBlockContent_D5yF"><pretabindex="0"class="prism-code language-bash codeBlock_RMoD thin-scrollbar"style="color:#F8F8F2;background-color:#282A36"><codeclass="codeBlockLines_AclH"><spanclass="token-line"style="color:#F8F8F2"><spanclass="token builtin class-name"style="color:rgb(189, 147, 249)">export</span><spanclass="token plain"></span><spanclass="token assign-left variable"style="color:rgb(189, 147, 249);font-style:italic">DOCKER_HOST</span><spanclass="token operator">=</span><spanclass="token plain">npipe://</span><spanclass="token operator"><</span><spanclass="token plain">inspect_command_output</span><spanclass="token operator">></span><br></span></code></pre><divclass="buttonGroup_aaMX"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_z5j7"aria-hidden="true"><svgviewBox="0 0 24 24"class="copyButtonIcon_FoOz"><pathfill="currentColor"d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgviewBox="0 0 24 24"class="copyButtonSuccessIcon_L0B6"><pathfill="currentColor"d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h5class="anchor anchorWithStickyNavbar_JmGV"id="powershell">Powershell<ahref="#powershell"class="hash-link"aria-label="Direct link to Powershell"title="Direct link to Powershell"></a></h5><p>Don't miss the quotes on the value or powershell will try to interpret it as a separate command instead of a value.</p><divclass="language-powershell codeBlockContainer_mQmQ theme-code-block"style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><divclass="codeBlockContent_D5yF"><pretabindex="0"class="prism-code language-powershell codeBlock_RMoD thin-scrollbar"style="color:#F8F8F2;background-color:#282A36"><codeclass="codeBlockLines_AclH"><spanclass="token-line"style="color:#F8F8F2"><spanclass="token plain">$env:DOCKER_HOST="npipe://<inspect_command_output>"</span><br></span></code></pre><divclass="buttonGroup_aaMX"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_z5j7"aria-hidden
<li>Set the <code>DOCKER_HOST</code> environment variable to your Podman socket location. Be sure to add the <code>unix://</code> scheme to the path retrieved previously:</li>
<li>Set the <code>DOCKER_HOST</code> environment variable to your Podman socket location. Be sure to add the <code>unix://</code> scheme to the path retrieved previously:</li>
<h4class="anchor anchorWithStickyNavbar_JmGV"id="verification">Verification<ahref="#verification"class="hash-link"aria-label="Direct link to Verification"title="Direct link to Verification"></a></h4>
<li>Your tools using the <code>DOCKER_HOST</code> environment variable, such as <ahref="https://gradle.org/"target="_blank"rel="noopener noreferrer">Gradle</a> or <ahref="https://www.testcontainers.com/"target="_blank"rel="noopener noreferrer">Testcontainers</a>, communicate with Podman without reconfiguration.</li>