# Cannot connect mender client to hosted mender server

**URL:** https://hub.mender.io/t/cannot-connect-mender-client-to-hosted-mender-server/3228
**Category:** General Discussions
**Created:** [February 17, 2021, 6:23am UTC](https://hub.mender.io/t/cannot-connect-mender-client-to-hosted-mender-server/3228 "2021-02-17T06:23:48Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![SamanRatna](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@SamanRatna](https://hub.mender.io/u/SamanRatna)
#### Post date: [February 17, 2021, 6:23am UTC](https://hub.mender.io/t/cannot-connect-mender-client-to-hosted-mender-server/3228/1 "2021-02-17T06:23:48Z")

</div>

Hi there,

I tried installing mender-client using the Debian package. When I run sudo mender setup to provide credentials of the hosted mender server, it showed: “We couldn’t find a Hosted Mender account with those credentials.” I am sure that the credentials are correct.

I then removed all the mender files and directories it had created, using ‘sudo apt purge mender-client’. I later tried to install the client again from the UI of the hosted mender server using the ‘CONNECT A DEVICE’ button of the dashboard. It didn’t show the device on the pending tab of the server UI. I similarly ran the ‘sudo mender install’. It again showed: “We couldn’t find a Hosted Mender account with those credentials.”

I had been doing the same setup steps previously. It is not working now.

Regards,  
Saman

---

<div class="post-metadata">

### Author: ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)
#### Post date: [February 17, 2021, 3:52pm UTC](https://hub.mender.io/t/cannot-connect-mender-client-to-hosted-mender-server/3228/2 "2021-02-17T15:52:52Z")

</div>

@peter can you help here?

---

<div class="post-metadata">

### Author: ![tranchitella](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/tranchitella/32/606_2.png) [@tranchitella](https://hub.mender.io/u/tranchitella)
#### Post date: [February 18, 2021, 4:23am UTC](https://hub.mender.io/t/cannot-connect-mender-client-to-hosted-mender-server/3228/3 "2021-02-18T04:23:51Z")

</div>

Hello @SamanRatna, are you accessing Hosted Mender using OAuth 2 authentication (Google or GitHub) or standard email and password?

---

<div class="post-metadata">

### Author: ![SamanRatna](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@SamanRatna](https://hub.mender.io/u/SamanRatna)
#### Post date: [February 18, 2021, 7:13am UTC](https://hub.mender.io/t/cannot-connect-mender-client-to-hosted-mender-server/3228/4 "2021-02-18T07:13:26Z")

</div>

standard email and password

Saman

---

<div class="post-metadata">

### Author: ![tranchitella](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/tranchitella/32/606_2.png) [@tranchitella](https://hub.mender.io/u/tranchitella)
#### Post date: [February 18, 2021, 7:20am UTC](https://hub.mender.io/t/cannot-connect-mender-client-to-hosted-mender-server/3228/5 "2021-02-18T07:20:25Z")

</div>

@SamanRatna I suppose the same credentials work for logging into Hosted Mender, right? Can you please share with us the full transcript of your console installing the client and running the setup?

---

<div class="post-metadata">

### Author: ![kele6ra](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kele6ra/32/1375_2.png) [@kele6ra](https://hub.mender.io/u/kele6ra)
#### Post date: [January 5, 2023, 11:44am UTC](https://hub.mender.io/t/cannot-connect-mender-client-to-hosted-mender-server/3228/6 "2023-01-05T11:44:54Z")

</div>

I have similar problem. I think that mender-client config tries to connect to [hosted.mender.com](http://hosted.mender.com) by default. And if have created account in the eu server, then it can’t connect to it. It will be nice if mender asks which server we need to connect before insert credentials.

---

<div class="post-metadata">

### Author: ![arp\_insens](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@arp\_insens](https://hub.mender.io/u/arp_insens)
#### Post date: [June 7, 2023, 8:49am UTC](https://hub.mender.io/t/cannot-connect-mender-client-to-hosted-mender-server/3228/7 "2023-06-07T08:49:35Z")

</div>

I think I have this same probleme, I am 100% sure of my credentials for [hosted.mender.io](http://hosted.mender.io) but I have a eu account and have this messsage: We couldn’t find a Hosted Mender account with those credentials.

---

<div class="post-metadata">

### Author: ![mister\_kanister](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mister\_kanister](https://hub.mender.io/u/mister_kanister)
#### Post date: [June 12, 2023, 11:01am UTC](https://hub.mender.io/t/cannot-connect-mender-client-to-hosted-mender-server/3228/8 "2023-06-12T11:01:42Z")

</div>

Right! You must distinguish between **[hosted.mender.io](http://hosted.mender.io)** and **[eu.hosted.mender.io](http://eu.hosted.mender.io)**.

```auto
                mender setup \
                --device-type "$DEVICE_TYPE" \
                --server-url "https://eu.hosted.mender.io" \
                --demo-polling

```

---

<div class="post-metadata">

### Author: ![arp\_insens](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@arp\_insens](https://hub.mender.io/u/arp_insens)
#### Post date: [June 19, 2023, 8:12am UTC](https://hub.mender.io/t/cannot-connect-mender-client-to-hosted-mender-server/3228/9 "2023-06-19T08:12:05Z")

</div>

thank you, is it possible for me to connect to it when I first install the mender-client ? (sudo apt-get install mender-client)

---

<div class="post-metadata">

### Author: ![mister\_kanister](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mister\_kanister](https://hub.mender.io/u/mister_kanister)
#### Post date: [June 19, 2023, 8:30am UTC](https://hub.mender.io/t/cannot-connect-mender-client-to-hosted-mender-server/3228/10 "2023-06-19T08:30:50Z")

</div>

After you installed mender client you need to configure it. Recommended way is with `mender setup`. Or you can edit `/etc/mender/mender.conf` and overwrite it after mender client is installed. Use `jq` tool to update or add config values to `mender.conf`. So its scriptable with shell.  
Example:

```auto
jq '. + { "ArtifactVerifyKey": "/etc/mender/artifact-verify-key.pem" }' /etc/mender/mender.conf > \ /tmp/mender.conf.tmp && mv /tmp/mender.conf.tmp /etc/mender/mender.conf

```
