Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I host my flutter web app in my local network?

What I need is to run a web app that can only be accessed from my local network.

I built my web app with flutter by typing:

flutter build web

but now I'm stuck because I don't know which web server should I use. I searched for tutorial but didn't find a solution.

like image 499
Federico Galvagni Avatar asked Sep 14 '25 08:09

Federico Galvagni


1 Answers

The easiest for me was by serving the web build using Python as suggested on this post. Once you got Python installed on your machine, navigate to your Flutter project's build/web/ folder then run python -m http.server {PORT}. You can change the port to any free port available in your machine. If you've installed Python 3, the command most likely should start with python3.

When the server's running, the Flutter web build can be accessed through a browser with the machine's IP address and the port that you've set i.e. http://192.168.x.x:8080

like image 160
Omatt Avatar answered Sep 16 '25 22:09

Omatt