# Keycloack standalone works fine on terminal but on ip:8080 i get This site can’t be reached

**URL:** <https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100>\
**Category:** Configuring the server\
**Created:** [February 1, 2021, 2:11pm UTC](https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100 "2021-02-01T14:11:02Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![gradCoder](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/gradcoder/32/2252_2.png) [@gradCoder](https://forum.keycloak.org/u/gradCoder)\
**Post date:** [February 1, 2021, 2:11pm UTC](https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100/1 "2021-02-01T14:11:02Z")

</div>

Ubuntu VM 16.04 (real server not localhost).

Steps to reproduce :  
wget keycloak .  
Unzip on /opt  
sudo ./standalone.sh  
Go to ip:8080

Logs:

 ![image](https://global.discourse-cdn.com/free1/uploads/keycloak/original/2X/e/efd6f25c0367cd11be6bb484c8c8b27a6587597b.png)

I tried docker installation and it works fine .  
I tried standalone on my local ubuntu machine (my laptop) and it works fine.  
I tried running it with this command sudo ./standalone.sh -Djboss.socket.binding.port-offset=100 so i can get a new port still doesnt work.  
Why would this not work ? ☹

---

<div class="post-metadata">

**Author:** ![Marius](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Marius](https://forum.keycloak.org/u/Marius)\
**Post date:** [February 1, 2021, 2:24pm UTC](https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100/2 "2021-02-01T14:24:03Z")

</div>

Hi there, it should be because if you launch the process like that it will only listen on the 127.0.0.1 interface, you should try launching it with -b=0.0.0.0 and -bmanagement=0.0.0.0 too, that way the process will listen on all interfaces and you should be able to access it using your ip. Let me know if this works

Best regards

---

<div class="post-metadata">

**Author:** ![gradCoder](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/gradcoder/32/2252_2.png) [@gradCoder](https://forum.keycloak.org/u/gradCoder)\
**Post date:** [February 1, 2021, 3:47pm UTC](https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100/3 "2021-02-01T15:47:52Z")

</div>

Hello thanks for the quick reply .  
Now i am suddenly getting .  
15:46:59,013 FATAL [org.keycloak.services] (ServerService Thread Pool – 56) Error during startup: java.lang.RuntimeException: Failed to connect to database  
Full logs : [15:53:18,406 FATAL [org.keycloak.services] (ServerService Thread Pool -- 62) Err - Pastebin.com](https://pastebin.com/rdMmWWmY)

As said this is a fresh ubuntu 16.04 i just downloaded keycloak and runned standalone.sh , it should play right of the box but it’s not , any help would be appreciated.

@ [Marius](http://forum.keycloak.org/u/Marius)

---

<div class="post-metadata">

**Author:** ![Marius](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Marius](https://forum.keycloak.org/u/Marius)\
**Post date:** [February 1, 2021, 4:07pm UTC](https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100/4 "2021-02-01T16:07:15Z")

</div>

I haven’t seen that error with the default datasource but looking at the stack trace the cause seems to be "org.h2.jdbc.JdbcSQLException: IO Exception: “java.net.UnknownHostException: ca: ca: Name or service not known”, can you try adding the hostname into /etc/hosts and seeing what happens next

---

<div class="post-metadata">

**Author:** ![gradCoder](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/gradcoder/32/2252_2.png) [@gradCoder](https://forum.keycloak.org/u/gradCoder)\
**Post date:** [February 1, 2021, 4:08pm UTC](https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100/5 "2021-02-01T16:08:19Z")

</div>

just add the ip address of the server e.g 42.435.234.2 on the last line?  
Yea it’s weird it’s doing it now, it wasn’t doing it yesterday but i did clean install ubuntu again today.

---

<div class="post-metadata">

**Author:** ![Marius](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Marius](https://forum.keycloak.org/u/Marius)\
**Post date:** [February 1, 2021, 4:12pm UTC](https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100/6 "2021-02-01T16:12:48Z")

</div>

No, not the ip address but the server’s hostname, try simply running this command  
printf “127.0.0.1 $(hostname)” \>\> etc/hosts

---

<div class="post-metadata">

**Author:** ![gradCoder](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/gradcoder/32/2252_2.png) [@gradCoder](https://forum.keycloak.org/u/gradCoder)\
**Post date:** [February 1, 2021, 4:13pm UTC](https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100/7 "2021-02-01T16:13:46Z")

</div>

printf “127.0.0.1 $(hostname)” \>\> etc/hosts  
-bash: etc/hosts: No such file or directory

---

<div class="post-metadata">

**Author:** ![Marius](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Marius](https://forum.keycloak.org/u/Marius)\
**Post date:** [February 1, 2021, 4:14pm UTC](https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100/8 "2021-02-01T16:14:21Z")

</div>

I forgot a ‘/’ my bad, it’s  
printf “127.0.0.1 $(hostname)” \>\> /etc/hosts

---

<div class="post-metadata">

**Author:** ![gradCoder](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/gradcoder/32/2252_2.png) [@gradCoder](https://forum.keycloak.org/u/gradCoder)\
**Post date:** [February 1, 2021, 4:15pm UTC](https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100/9 "2021-02-01T16:15:15Z")

</div>

> [@Marius](#):
>
> printf “127.0.0.1 $(hostname)” \>\> /etc/hosts

unfortunately i am getting permissions denied even if i have sudo privs.  
but on hosts i can see 2 lines with  
127.0.0.1 localhost  
127.0.0.1 prob our hostname.

It’s weird everything worked just fine until i did a clean install of ubuntu again today . Now i regret that.

If i do sudo hostname i get an answer though  
should i add that answer  
127.0.0.1 hostname\_answer ?

this is how etc/hosts  
 ![image](https://global.discourse-cdn.com/free1/uploads/keycloak/original/2X/8/84736576393b2546bd7f31daa917c928441da8ed.png)  
It worked , i will run the command u said now , finger crossed.

---

<div class="post-metadata">

**Author:** ![gradCoder](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/gradcoder/32/2252_2.png) [@gradCoder](https://forum.keycloak.org/u/gradCoder)\
**Post date:** [February 1, 2021, 4:33pm UTC](https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100/10 "2021-02-01T16:33:33Z")

</div>

@ [Marius](http://forum.keycloak.org/u/Marius) this seems to be working just fine . What i did for people reading this in the future is add what sudo hostname said in etc/hosts  
so sudo hostname  
it the answer was for example “x” then i added on etc/hosts  
127.0.0.1 x  
That’s it.  
I had to create an admin from the terminal but now when i try to log in i get  
" We are sorry…

HTTPS required"

How can i disable SSL this is a test environment i don’t need it . Do you know ?

Like on my localhost (laptop) it runs fine without SSL.

---

<div class="post-metadata">

**Author:** ![Marius](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Marius](https://forum.keycloak.org/u/Marius)\
**Post date:** [February 1, 2021, 4:40pm UTC](https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100/11 "2021-02-01T16:40:13Z")

</div>

Try disabling the ssl, in the “master” realm, over login tab. Change ‘Require SSL’ property to none

---

<div class="post-metadata">

**Author:** ![gradCoder](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/gradcoder/32/2252_2.png) [@gradCoder](https://forum.keycloak.org/u/gradCoder)\
**Post date:** [February 1, 2021, 4:41pm UTC](https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100/12 "2021-02-01T16:41:57Z")

</div>

The thing is as soon as i press administration console i get the error so i cant go to master realm.

Maybe this can be achieved via the terminal ? do u know …  
Thanks for the help btw i truly appreciate it.

Console error :  
16:41:15,362 WARN [org.keycloak.events] (default task-2) type=LOGIN\_ERROR, realmId=master, clientId=null, userId=null, ipAddress=…1, error=ssl\_required

I found this but no idea where all the default thing are to replace the values or if it’s even a workable solution

java -cp .jar org.h2.tools.Shell -url “jdbc:h2:file:” -user -password -sql “update REALM set ssl\_required=‘NONE’ where id = ‘master’”

---

<div class="post-metadata">

**Author:** ![Marius](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Marius](https://forum.keycloak.org/u/Marius)\
**Post date:** [February 1, 2021, 4:51pm UTC](https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100/13 "2021-02-01T16:51:33Z")

</div>

Oh, I see, you could try doing it from the cli on the server like this

```auto
./kcadm.sh config credentials --server http://localhost:8080/auth --realm master --user admin
./kcadm.sh update realms/master -s sslRequired=NONE

```

or you could try to tunnel from your local machine into the server on port 8080 or whatever port you have it running on and then access the web console from your local machine, the tunnel syntax is

sudo ssh -N -L 8080:localhost:8080 username@serverip

this will forward your local 8080 port to the port 8080 on the server and you can simply open a browser on your machine and type localhost:8080/auth and then you should be able to access it

---

<div class="post-metadata">

**Author:** ![gradCoder](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/gradcoder/32/2252_2.png) [@gradCoder](https://forum.keycloak.org/u/gradCoder)\
**Post date:** [February 1, 2021, 4:57pm UTC](https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100/14 "2021-02-01T16:57:47Z")

</div>

G.O.A.T

❤ ❤ ❤ ❤ ❤

For people reading this what i did is the second option  
sudo ssh -N -L 8080:localhost:8080 username@serverip  
Where username = the username u ssh into your virtual matchine  
serverip = the ip of your virtual machine

e,g if you ssh root@43500  
username=root  
ip=43500  
Went into localhost:8080 log in with the user/pass i created earlier via the script and disable ssl.

---

<div class="post-metadata">

**Author:** ![MXSXJBPJ](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/mxsxjbpj/32/2275_2.png) [@MXSXJBPJ](https://forum.keycloak.org/u/MXSXJBPJ)\
**Post date:** [February 3, 2021, 8:38am UTC](https://forum.keycloak.org/t/keycloack-standalone-works-fine-on-terminal-but-on-ip-8080-i-get-this-site-can-t-be-reached/7100/15 "2021-02-03T08:38:12Z")

</div>

> [@gradCoder](#):
>
> Ubuntu VM 16.04 (real server not localhost).
> 
> Steps to reproduce :  
> wget keycloak .  
> Unzip on /opt  
> sudo ./standalone.sh  
> Go to ip:8080
> 
> Logs:
> 
> ![image](https://global.discourse-cdn.com/free1/uploads/keycloak/original/2X/e/efd6f25c0367cd11be6bb484c8c8b27a6587597b.png)
> 
> I tried docker installation and it works fine .  
> I tried standalone on my local ubuntu machine (my laptop) and it works fine.  
> I tried running it with this command sudo ./standalone.sh -Djboss.socket.binding.port-offset=100 so i can get a new port still doesnt work.  
> Why would this not work ? ☹

bind 0.0.0.0 😀
