Kinda Code
Home/Flutter/How to run Flutter web with a custom port

How to run Flutter web with a custom port

Last updated: March 31, 2023

By default, each time you start Flutter web on localhost, it will have a different port. However, there are cases where you need to set up a fixed, unchanged port (like when you want to implement social auth with Google Sign-In). To do that, use the –web-port flag when running your project like so:

flutter run -d chrome --web-port=10000

Screenshot:

That’s it. Further reading:

You can also take a tour around our Flutter topic page and Dart topic page to see the latest tutorials and examples.