# Install Portainer Agent on Podman

Portainer uses the *Portainer Agent* container to communicate with the *Portainer Server* instance and provide access to the node's resources. This document will outline how to install the Portainer Agent on your node and how to connect to it from your Portainer Server instance. If you do not have a working Portainer Server instance yet, please refer to the [Portainer Server installation guide](https://docs.portainer.io/2.33-lts/start/install/server/docker/linux) first.

In addition to the generic requirements for Podman environments, you will need:

* Port `9001` accessible on this machine from the Portainer Server instance. If this is not available, we recommend using the [Edge Agent](https://docs.portainer.io/2.33-lts/admin/environments/add/docker/edge) instead.

The Portainer Agent installation instructions also make the following additional assumptions about your environment:

* You are accessing Podman via Unix sockets. The Portainer Agent does not support connecting to the Podman engine via TCP.
* You have not set a custom `AGENT_SECRET` on your Portainer Server instance. If you have (by specifying an `AGENT_SECRET` environment variable when starting the Portainer Server container), you will need to provide that same secret to your agent in the same way (as an environment variable) when deploying, for example by adding the following to your `podman run` command:

  `-e AGENT_SECRET=yoursecret`

From the menu expand **Environment-related**, click **Environments**, then click **Add environment**.

<figure><img src="https://3850702872-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXI7douejaBgpZ6CP2zJf%2Fuploads%2Fgit-blob-f31a69819b31614081432a05ff184ac64677664e%2F2.22-environments-add.gif?alt=media" alt=""><figcaption></figcaption></figure>

Next, select **Podman** as the environment type then click **Start Wizard**. Select the **Agent** option, then your environment type. Copy the commands and run them on your Podman instance.

{% hint style="info" %}
If you want to use the [host management features](https://docs.portainer.io/2.33-lts/user/docker/host/setup#enable-host-management-features) of the Portainer Agent, you should add the necessary volume mount to the command that Portainer provides:

```
-v /:/host
```

{% endhint %}

{% hint style="info" %}
If Podman on the environment you're deploying the Agent to has the Podman volume path at a non-standard location (instead of `/var/lib/containers/storage/volumes`) you will need to adjust the volume mount in the deployment command to suit.&#x20;

For example, if your volume path was `/srv/data/podman`, you would change the line in the command to:

```
- v /srv/data/podman:/var/lib/docker/volumes \
```

The right side of the mount should remain as `/var/lib/docker/volumes`, as that is what the Agent expects (even when using Podman).
{% endhint %}

Once the Agent has been deployed, enter the environment details using the table below as a guide:

| Field/Option        | Overview                                                                                                                                                                                                                                                                      |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name                | Give the environment a descriptive name.                                                                                                                                                                                                                                      |
| Environment address | Enter the DNS name or IP address to connect to the Portainer Agent along with the port (the default port is `9001`). Do not provide a protocol - communication with the Agent by the Server is performed over HTTPS with certificates generated by the Agent on installation. |

<figure><img src="https://3850702872-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXI7douejaBgpZ6CP2zJf%2Fuploads%2Fgit-blob-b98daa38b15afb145287d818b11705314cc6eab8%2F2.22.0-environments-add-podman-agent.png?alt=media" alt=""><figcaption></figcaption></figure>

As an optional step you can expand the **More settings** section to categorize the environment by adding it to a [group](https://docs.portainer.io/2.33-lts/admin/environments/groups) or [tagging](https://docs.portainer.io/2.33-lts/admin/environments/tags) it for better searchability.

<figure><img src="https://3850702872-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXI7douejaBgpZ6CP2zJf%2Fuploads%2Fgit-blob-a9c304774991a6d7f64834e45eb6dc95eb6a7499%2F2.18-environments-add-docker-moresettings.png?alt=media" alt=""><figcaption></figcaption></figure>

When you're ready, click **Connect**. If you have other environments to configure click **Next** to proceed, otherwise click **Close** to return to the list of environments.
