Keycloak + Docker on AWS EC2 (We are sorry... HTTPS required)

I set up a EC2 instance on AWS and I run this command:

docker run -p 80:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin quay.io/keycloak/keycloak:12.0.1

When I navigate to:

“ec2-XX-XX-XXX-XX.us-east-2.compute.amazonaws(dot)com”

I get:

We are sorry… HTTPS required

I’ve searched at Stack Overflow but not being able to solve it. Some of the posted solutions mention, changing port to 8443

docker run -p 8443:8443 -e KEYCLOAK_USER=username -e KEYCLOAK_PASSWORD=password jboss/keycloak

Yet going to:

“ec2-XX-XX-XXX-XX.us-east-2.compute.amazonaws(dot)com:8443/auth”

Does not resolve. Also testing 8080 does not resolve.

Any ideas?

What is not working on that command (“it doesn’t work” is really vague error description)?:

docker run -p 8443:8443 -e KEYCLOAK_USER=username -e KEYCLOAK_PASSWORD=password jboss/keycloak

It works for me. If it is not your case, then of course check the logs first.

But I guess you didn’t configure AWS sec. groups, etc.

AWS configuration is not in the scope of this forum. You should to know how is your AWS infrastructure configured: public/private network, NAT, sec. groups, …

The issue related to the browser not being able to resolve…

Adding port 8443 in the security groups to My IP and forcing “https” on the address solved the issue:

So instead of:

ec2-XX-XX-XX-XX.us-east-2.compute.amazonaws.com:8443/

https://ec2-XX-XX-XX-XX.us-east-2.compute.amazonaws.com:8443/

Solved the issue.

Thx.