<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									How to Install Portainer Agent to Manage Multiple Docker Hosts - Home Lab Forum				            </title>
            <link>https://www.virtualizationhowto.com/community/home-lab-forum/how-to-install-portainer-agent-to-manage-multiple-docker-hosts/</link>
            <description>Virtualization Howto Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Sun, 19 Jul 2026 07:02:07 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>How to Install Portainer Agent to Manage Multiple Docker Hosts</title>
                        <link>https://www.virtualizationhowto.com/community/home-lab-forum/how-to-install-portainer-agent-to-manage-multiple-docker-hosts/#post-1156</link>
                        <pubDate>Fri, 31 Jan 2025 04:04:18 +0000</pubDate>
                        <description><![CDATA[Portainer is one of the best Docker environment management utilities. It allows you to easily have a GUI to manage Docker instead of having to manage everything from the command line. It als...]]></description>
                        <content:encoded><![CDATA[<p>Portainer is one of the best Docker environment management utilities. It allows you to easily have a GUI to manage Docker instead of having to manage everything from the command line. It also has a lot of great tools that allows you to visibly see things that need to be addressed, such as old images, etc.</p>
<p>Using agents, you can manage multiple hosts from a single interface without having to install the server installation on each host you need to manage. It also allows you to manage app stacks using a stack file to easily deploy your applications and software as a bundle instead of piecing together individual containers.</p>
<div class="wp-block-image">
<figure>
501
<br />
<figcaption class="wp-element-caption">portainer management gui for managing docker containers</figcaption>
</figure>
</div>
<p>Portainer has come a long way as well and has evolved from simply a “Docker management tool” to a tool that can manage Docker Swarm, Kubernetes, Nomad, KaaS, and even orchestrate deploying your own Kubernetes cluster using Microk8s on your own infrastructure.</p>
<h2 id="what-is-the-portainer-agent" class="wp-block-heading">What is the Portainer Agent?</h2>
<p>The portainer agent or portainer edge agent are lightweight software installations that allow you to connect multiple managed nodes to a Portainer server instance. The Portainer server instance is the instance that runs the full Portainer server installation running as a container.</p>
<p>The Portainer instance will run on your Docker host with Docker installed and has access to the Docker service locally and via the agent to the service running remotely. You can think of the server instance as the manager node for your Portainer environment.</p>
<p>The agent allows you to manage your Docker hosts all from a single pane of glass and eliminates the need to install the Portainer server on each Docker standalone host. This makes managing things much simpler and you don’t have to manage users and such on each Portainer server installation. You have one server and all the agent installations will exist on the one Portainer server installation.</p>
<h2 id="install-the-portainer-agent" class="wp-block-heading">Install the Portainer Agent</h2>
<p>Let’s look at how to install the portainer agent on a standalone Docker host as an example. You need to have command line access to your Docker container host for deploying portainer agent installations.</p>
<p>On your Docker container host that will be managed by your Portainer manager node, this is a simple one-liner Docker run command:</p>
<p>To install the agent, you use the following command and add any other environment variables needed to your Docker run command:</p>
<pre class="wp-block-code" contenteditable="false"><code>docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent:latest</code></pre>
<p>As you can see the default port for the agent is<span> </span><strong>port 9001</strong>.</p>
<div class="wp-block-image">
<figure>
502
<br />
<figcaption class="wp-element-caption">install the portainer agent installation on a docker host</figcaption>
</figure>
</div>
<h2 id="add-the-remote-portainer-agent-environment-to-portainer-manager-node" class="wp-block-heading">Add the remote Portainer agent environment to Portainer manager node</h2>
<p>Now that we have the Portainer agent installed, we can add the remote Docker host installation to our Portainer manager node. We can do this by logging into the Portainer manager GUI.</p>
<p>Navigate to<span> </span><strong>Settings &gt; Environments &gt; Add environment</strong>.</p>
<div class="wp-block-image">
<figure>
503
<br />
<figcaption class="wp-element-caption">adding a new environment in portainer using the portainer agent</figcaption>
</figure>
</div>
<p>You will see the following screen where you can select the environment you want to add. Choices include:</p>
<ul class="wp-block-list">
<li>Docker standalone</li>
<li>Docker Swarm cluster</li>
<li>Kubernetes</li>
<li>ACI</li>
<li>Nomad</li>
<li>Provision KaaS Cluster</li>
<li>Create a Kubernetes cluster</li>
</ul>
<div class="wp-block-image">
<figure>
504
<br />
<figcaption class="wp-element-caption">select the environment to connect to in portainer</figcaption>
</figure>
</div>
<p>Next, we select how we connect to our Docker standalone environment. Choices here include:</p>
<ul class="wp-block-list">
<li>Agent</li>
<li>Docker API</li>
<li>Docker socket</li>
<li>Edge Agent Standard</li>
<li>Edge Agent Async</li>
</ul>
<p>Below we are selecting the<span> </span><strong>Agent</strong><span> </span>which means we will be communicating via the Portainer API with the remote agent. Note how we have named the new environment and entered the connection information.</p>
<p>Hit the<span> </span><strong>Connect</strong><span> </span>button and you should have the agent successfully connected to your Portainer server.</p>
<div class="wp-block-image">
<figure>
505
<br />
<figcaption class="wp-element-caption">select how to connect to the remote docker standalone host</figcaption>
</figure>
</div>
<p>As we can see over in the right-hand column, it has added our remote Docker host.</p>
<div class="wp-block-image">
<figure>
506
<br />
<figcaption class="wp-element-caption">the new docker standalone environment has been added</figcaption>
</figure>
</div>
<p>Now, if we go back to our Home menu, we will see both container hosts listed, the local host itself, and then the remote host we just added to our Portainer instance.</p>
<h2 id="troubleshooting" class="wp-block-heading">Troubleshooting</h2>
<p>If you run into issues getting the Portainer agent deployed, check the following:</p>
<ul class="wp-block-list">
<li>The agent container is running on the remote host</li>
<li>If the agent container is not running, use the<span> </span><strong>docker logs</strong><span> </span>command and check the logs for the Portainer agent container to help diagnose the underlying issue</li>
<li>If you have a firewall in between your Docker container hosts and filtering/scoping traffic between them, you will need to allow port 9001 by default for agent communication</li>
</ul>]]></content:encoded>
						                            <category domain="https://www.virtualizationhowto.com/community/home-lab-forum/">Home Lab Forum</category>                        <dc:creator>Brandon Lee</dc:creator>
                        <guid isPermaLink="true">https://www.virtualizationhowto.com/community/home-lab-forum/how-to-install-portainer-agent-to-manage-multiple-docker-hosts/#post-1156</guid>
                    </item>
							        </channel>
        </rss>
		