How to specify a port number while running flutter web


Is there any way to start Flutter web, with a Headless-Server target, always on the same specified port number ?

Today, running the web application with:

flutter run -d headless-server

Provides a random port number.


I found the answer inside the flutter_tools source code:

flutter run -d headless-server --web-port=1234

Answered By – Omar BELKHODJA

Answer Checked By – David Marino (FlutterFixes Volunteer)

Leave a Reply

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