nsheremet
nsheremet

Reputation: 21

How to open 3000 port on Amazon EC2 for Docker Container?

I have a 3 docker containers on my EC2 server. In Security Group, I already add a TCP rule for 3000 port. Security Grops

My Container with API must work on 3000 port.

sudo docker run -d -p 3000:3000 server

When I run

sudo docker ps
PORTS
0.0.0.0:3000->3000/tcp

But nmap says me:

PORT     STATE  SERVICE
22/tcp   open   ssh
80/tcp   open   http
3000/tcp closed ppp

And when i try to send POST or GET request, it return me No response.

Upvotes: 2

Views: 1924

Answers (1)

Jason G
Jason G

Reputation: 2733

when you run the container, make sure to port it from 80 or 443 to your 3000.

docker run -d -p 443:3000 <container>

Upvotes: 1

Related Questions