# HaRP Docker container fails to start

**URL:** <https://help.nextcloud.com/t/harp-docker-container-fails-to-start/252015>\
**Category:** ℹ️ Support\
**Tags:** docker\
**Created:** [November 13, 2026, 3:36pm UTC](https://help.nextcloud.com/t/harp-docker-container-fails-to-start/252015 "2026-11-13T15:36:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![awelzel](https://help.nextcloud.com/user_avatar/help.nextcloud.com/awelzel/32/74585_2.png) [@awelzel](https://help.nextcloud.com/u/awelzel)\
**Post date:** [November 13, 2026, 3:36pm UTC](https://help.nextcloud.com/t/harp-docker-container-fails-to-start/252015/1 "2026-11-13T15:36:13Z")

</div>

## The Basics

- Nextcloud Server version _(e.g., 29.x.x)_:
  - `35.0.3`

- Operating system and version _(e.g., Ubuntu 24.04)_:
  - `Ubuntu 24.04`

- Web server and version _(e.g, Apache 2.4.25)_:
  - `Apache 2.4.71`

- Reverse proxy and version \_(e.g. nginx 1.27.2)
  - `none`

- PHP version _(e.g, 8.3)_:
  - `8.4.27`

- Is this the first time you’ve seen this error? (Yes / No):
  - `Yes`

- When did this problem seem to first start?
  - `After one of the past updates of the Docker image`

- Installation method _(e.g. AlO, NCP, Bare Metal/Archive, etc.)_
  - `Bare Metal`

- Are you using CloudfIare, mod\_security, or similar? _(Yes / No)_
  - `No`

### Summary of the issue you are facing:

I start the HaRP container using the following command:

```auto
docker run \
  -e HP_SHARED_KEY="...redacted for security..." \
  -e NC_INSTANCE_URL="https://nextcloud-domain.example" \
  -e HP_EXAPPS_ADDRESS="127.0.0.1:8780" \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v `pwd`/certs:/certs \
  --name appapi-harp -h appapi-harp \
  --restart unless-stopped \
  --network host \
  -d ghcr.io/nextcloud/nextcloud-appapi-harp:release

```

In the past this worked fine. But now the container restarts all the time since it fails to start. The log shows the following error:

```auto
INFO: /run/harp/frps.toml already exists. Skipping FRP server configuration generation...
INFO: /run/harp/frpc-docker.toml already exists. Skipping generation...
INFO: Starting Python HaProxy Agent on 127.0.0.1:8200 and 127.0.0.1:9600...
INFO: Waiting for HaRP Agent HTTP (GET http://127.0.0.1:8200/heartbeat) to be ready...
INFO: Waiting for SPOA port 127.0.0.1:9600...
INFO: Starting FRP server on 0.0.0.0:8782...
INFO: Waiting for FRP server port 127.0.0.1:8782...
INFO: Starting FRP client for Docker Engine...
INFO: Starting HAProxy...
2026-11-13 15:26:39.148 [I] [sub/root.go:194] start frpc service for config file [/run/harp/frpc-docker.toml] with aggregated configuration
2026-11-13 15:26:39.148 [I] [client/service.go:335] try to connect to server...
2026-11-13 15:26:39.155 [W] [client/service.go:346] connect to server error: session shutdown
2026-11-13 15:26:39.155 [I] [sub/root.go:211] frpc service for config file [/run/harp/frpc-docker.toml] stopped
login to the server failed: session shutdown. With loginFailExit enabled, no additional retries will be attempted
ERROR: HaRP process 'frpc' exited unexpectedly (status 1), stopping the container.

```

The image is the latest version as of 2026-11-13, 16:36 CET.

---

<div class="post-metadata">

**Author:** ![awelzel](https://help.nextcloud.com/user_avatar/help.nextcloud.com/awelzel/32/74585_2.png) [@awelzel](https://help.nextcloud.com/u/awelzel)\
**Post date:** [November 13, 2026, 4:02pm UTC](https://help.nextcloud.com/t/harp-docker-container-fails-to-start/252015/2 "2026-11-13T16:02:45Z")

</div>

Since I don’t need a connection to a remote Docker host and the local socket is already passed to the container, I removed the certs mount and also deleted the folder for it.

This seemed to do the trick and also the test deploy worked fine.

At some point I may investigate why the originally created certificates don’t work any longer. At least I could not find any hint in the documentation, that they had to be created again. But since I don’t need remote Docker access anyway, this is ok for now.

---

<div class="post-metadata">

**Author:** ![awelzel](https://help.nextcloud.com/user_avatar/help.nextcloud.com/awelzel/32/74585_2.png) [@awelzel](https://help.nextcloud.com/u/awelzel)\
**Post date:** [November 13, 2026, 5:10pm UTC](https://help.nextcloud.com/t/harp-docker-container-fails-to-start/252015/3 "2026-11-13T17:10:48Z")

</div>

Another lesson learned:

I completely deleted the content of the former folder for certificates and add this as mount again to the start script.

Now the container starts again without any errors and new certificates got created:

```auto
-rw-r--r-- 1 root root 1107 2026-11-13 17:07 ca.crt
-rw------- 1 root root 1704 2026-11-13 17:07 ca.key
-rw-r--r-- 1 root root 41 2026-11-13 17:07 ca.srl
-rw-r--r-- 1 root root 186 2026-11-13 17:07 client-openssl.cnf
-rw-r--r-- 1 root root 1131 2026-11-13 17:07 client.crt
-rw-r--r-- 1 root root 956 2026-11-13 17:07 client.csr
-rw------- 1 root root 1700 2026-11-13 17:07 client.key
-rw-r--r-- 1 root root 172 2026-11-13 17:07 server-openssl.cnf
-rw-r--r-- 1 root root 1111 2026-11-13 17:07 server.crt
-rw-r--r-- 1 root root 940 2026-11-13 17:07 server.csr
-rw------- 1 root root 1704 2026-11-13 17:07 server.key

```

However I wonder, if the certificates have to be renewed at some point and this was the issue here? I did not find anything at all about this in the documentation.

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/6_449c533f586939b6e5f246632a46421f.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [November 14, 2026, 1:15am UTC](https://help.nextcloud.com/t/harp-docker-container-fails-to-start/252015/4 "2026-11-14T01:15:31Z")

</div>

> [@awelzel](#):
>
> However I wonder, if the certificates have to be renewed at some point and this was the issue here?

> <https://github.com/nextcloud/HaRP/pull/109>
>
> Fixes #107.
> 
> The FRP server and client certificates were signed for 365 days whi…le the CA is valid for 5000, so after a year the
> mTLS tunnel between HaRP and its (external) Docker engines silently stopped working: frp verifies certificate expiry
> on both ends, and the certs are never regenerated once \`/certs/frp\` exists.
> 
> \- CA, server and client certificates now share a single, configurable validity: \`HP\_FRP\_CERT\_VALIDITY\_DAYS\`
> (default \`5000\`), validated as a positive integer.
> \- The long default is intentional: the CA and client certificate are copied to external Docker engines and are never
> rotated automatically, so they must outlive the deployment. Admins who run their own renewal can lower it.
> \- README documents the variable and how to regenerate and re-copy the certs.

---

<div class="post-metadata">

**Author:** ![awelzel](https://help.nextcloud.com/user_avatar/help.nextcloud.com/awelzel/32/74585_2.png) [@awelzel](https://help.nextcloud.com/u/awelzel)\
**Post date:** [November 14, 2026, 10:51am UTC](https://help.nextcloud.com/t/harp-docker-container-fails-to-start/252015/5 "2026-11-14T10:51:17Z")

</div>

Thanks for the pointer. I’ll consider implementing some kind of automatic renewal just to be sure.

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [November 22, 2026, 10:51am UTC](https://help.nextcloud.com/t/harp-docker-container-fails-to-start/252015/6 "2026-11-22T10:51:36Z")

</div>

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.
