Dart2 – webdev serve in a docker container


Running webdev serve in a docker container is not working.

I am running docker run -p 8080:8080

And in the container it says:

Serving `web` on http://localhost:8080
Serving `test` on http://localhost:8081

Do you know how to run this in a docker container?


This issue is likely due to the fact you are serving on localhost in the container. An easy way around this is to bind to all interfaces.

e.g. webdev serve --hostname

Answered By – Alex Haslam

Answer Checked By – David Marino (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *