# Containerized Kopia server setup

**URL:** <https://kopia.discourse.group/t/containerized-kopia-server-setup/510>\
**Category:** General\
**Created:** [July 4, 2021, 5:02pm UTC](https://kopia.discourse.group/t/containerized-kopia-server-setup/510 "2021-07-04T17:02:17Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![jellium](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/jellium/32/236_2.png) [@jellium](https://kopia.discourse.group/u/jellium)\
**Post date:** [October 15, 2021, 6:35pm UTC](https://kopia.discourse.group/t/containerized-kopia-server-setup/510/12 "2021-10-15T18:35:39Z")

</div>

Hello,  
I have pretty much the exact same configuration running Kopia server in an LXC container (run by user `kopia`, on port `51515`) proxied by HAProxy (which takes care of TLS for domain say `kopia.domain.tld`)  
I can access the server Kopia UI from the browser (`https://kopia.domain.tld`) and manage the repository. However, I cannot access the server repository from command line running:

```auto
kopia repository connect server --url=https://kopia.domain.tld:443 --server-cert-fingerprint=<fingerprint> --password=<password>

```

This outputs the following error:

```auto
021-10-15 18:40:47.319294 I [logger.go:244] Connecting to server 'https://kopia.domain.tld:443' as '<$USER>@<hostname>...
2021-10-15 18:40:47.319494 D [logger.go:254] Creating cache directory '/home/<$USER>/.cache/kopia/1b0e0fd7e3249467' with max size 5242880000
2021-10-15 18:40:47.563462 D [logger.go:254] establishing new GRPC streaming session (purpose=)
2021-10-15 18:40:47.621536 D [logger.go:254] GRPC stream read loop terminated with rpc error: code = Unauthenticated desc = unexpected HTTP status code received from server: 401 (Unauthorized); transport: received unexpected content-type "text/plain; charset=utf-8"
2021-10-15 18:40:47.621863 E [logger.go:214] failed to open repository: unable to establish session for purpose=: error establishing session: unable to initialize session: rpc error: code = Unauthenticated desc = unexpected HTTP status code received from server: 401 (Unauthorized); transport: received unexpected content-type "text/plain; charset=utf-8": EOF

```

I have tried [to] `--override-username` and `--override-hostname` using other credentials created beforehand on the Kopia server using `kopia server users add <username>`, in vain.

Besides, the proxy log outputs the following 401 error:

```auto
Oct 15 20:29:39 hostname haproxy[25806]: ::ffff:<remote ip>:40326 [15/Oct/2021:20:29:39.410] main~ KOPIA/KOPIA 0/0/0/1/7 401 221 - - CD-- 2/2/0/0/0 0/0 "POST https://kopia.domain.tld:443/kopia_repository.KopiaRepository/Session HTTP/2.0"

```

Any hints?  
Thanks a lot for your help.

---

_[View the full topic](https://kopia.discourse.group/t/containerized-kopia-server-setup/510)._
