A simple, cross-platform, universal web server built using Flask library.
It serves static files from the /static directory and can be run on Windows, Linux, macOS, Android (with Python support), and more!
- Python 3.x
- Flask
-
Setup Virtual Environment (optional):
python3 -m venv my-v-env source my-v-env/bin/activate -
Install:
pip install flask git clone https://github.com/IvanDeus/Flask-Web-Server.git cd Flask-Web-Server mkdir static -
Configure Settings:
- Edit
flask_web_server_cfg.pyto set:- Web server IP address (
HOST) - Web server port (
WPORT) - Debug mode (
DEBUG) - Log file path (
LOGFILE) (optional)
- Web server IP address (
- Edit
-
Place Files:
- Put any static files (HTML, CSS, JS, images, etc.) in the
static/directory. - These will be served at
http://localhost:<port>/filename.ext
- Put any static files (HTML, CSS, JS, images, etc.) in the
In your terminal or command prompt:
python flask_web_server.pyBy default, the server will start on port 1555. You can access it via:
http://localhost:1555/
For production use PM2 service (with Virtual Environment):
pm2 start flask_web_server.py --interpreter /home/user/my-v-env/bin/python3project_folder/
│
├── flask_web_server.py
├── flask_web_server_cfg.py
├── static/
│ ├── index.html
│ └── style.css
└── flask_web_server.log (generated automatically)
The server logs events such as startup and route access into the file defined by LOGFILE in your config.
When DEBUG=True, logs are also printed to the console. To check logs:
tail -f flask_web_server.log
- Windows
- Linux
- Android (via Termux)
2025 [ ivan deus ]