# Portainer API Setup

To allow Portainer to add an environment. Docker must be configured to open the port for remote access. The firewall must also allow this port. Below is for no TLS.

Edit:

```bash
nano /lib/systemd/system/docker.service
```

Add the line and comment out the other ExecStart line.

```bash
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
```

Reload systemctl after the change

```bash
systemctl daemon-reload
```

Add fire exception (RHEL)

```bash
firewall-cmd --zone=public --add-port=2375/tcp --permanent
firewall-cmd --reload
```

Restart the service

```bash
systemctl restart docker.service
```