Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
IT Security NachrichtenEU-Gesetz zur Cyber-Resilienz ist in Kraft - Netzpalaver(21.09.2026 um 20:29 Uhr)
Malware / Trojaner / VirenMeta Muse AI app flaw lets local malware redirect dictation traffic(21.09.2026 um 21:59 Uhr)
IT Security NachrichteniPhone 18 Pro (Max): Nutzer melden plötzliche Abstürze durch Face ID(21.09.2026 um 21:18 Uhr)
IT Security DownloadsEs wird Zeit, Word zu löschen(21.09.2026 um 21:53 Uhr)
IT NachrichtenAI can't outprompt a shortage of power, water, and land(21.09.2026 um 18:35 Uhr)
IT NachrichtenLondon neocloud Nscale takes its $1B loss to Wall Street(21.09.2026 um 19:15 Uhr)
IT Security NachrichtenEU-Gesetz zur Cyber-Resilienz ist in Kraft - Netzpalaver(21.09.2026 um 20:29 Uhr)
Malware / Trojaner / VirenMeta Muse AI app flaw lets local malware redirect dictation traffic(21.09.2026 um 21:59 Uhr)
IT Security NachrichteniPhone 18 Pro (Max): Nutzer melden plötzliche Abstürze durch Face ID(21.09.2026 um 21:18 Uhr)
IT Security DownloadsEs wird Zeit, Word zu löschen(21.09.2026 um 21:53 Uhr)
IT NachrichtenAI can't outprompt a shortage of power, water, and land(21.09.2026 um 18:35 Uhr)
IT NachrichtenLondon neocloud Nscale takes its $1B loss to Wall Street(21.09.2026 um 19:15 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Host a Simple Python App on a Virtual Machine (Step-by-Step)

Serve a Python App from a VM: From Local Server to Public Access In this guide, we’ll deploy a simple Python HTTP server on an AlmaLinux virtual machine and explore how network traffic flows from the VM to the host machine and beyond. By …

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




Serve a Python App from a VM: From Local Server to Public Access



In this guide, we’ll deploy a simple Python HTTP server on an AlmaLinux virtual machine and explore how network traffic flows from the VM to the host machine and beyond. By the end, you’ll be able to access your app from your local network and from external devices using a public tunnel.






Let's learn how to:




  • Set up a Python HTTP server on a VM

  • Access the server from the host machine

  • Expose the VM to external devices via Localtunnel

  • Understand the traffic flow from client to VM



In this setup, the AlmaLinux VM runs a Python HTTP server, the Fedora host acts as a KVM/QEMU host and NAT gateway, and the smartphone simulates an external client. We’ll show how to make the server accessible locally and over the internet using a tunnel.






1️⃣ Environment Setup





  • AlmaLinux 10 VM (Guest)


    • IP: 192.168.122.88

    • Runs the Python HTTP server








  • Fedora Host


    • IP: 192.168.0.136

    • Acts as KVM/QEMU host and NAT gateway








  • Smartphone / External Device


    • Connected via mobile network (e.g., Airtel)

    • Accesses the server through a public tunnel









          ┌─────────────┐
│ Smartphone │
│ (Mobile Data)│
└─────┬───────┘


┌─────────────────┐
│ Public Tunnel │
│ (Localtunnel) │
└─────┬───────────┘


┌─────────────┐
│ Fedora Host │
│ 192.168.0.136 │
│ KVM/QEMU + NAT│
└─────┬───────┘


┌───────────────┐
│ AlmaLinux VM │
│ 192.168.122.88│
│ Python HTTP │
│ Server :8000 │
└───────────────┘












2️⃣ Start the Python HTTP Server on the VM






# Start Python HTTP server on all interfaces, port 8000
python3 -m http.server 8000 --bind 0.0.0.0






Explaination:




  • The server serves the current directory as a simple web app.

  • You can test locally inside the VM:




curl http://127.0.0.1:8000









Access from the Host Machine



The host machine can reach the VM directly using its private IP. This is useful for testing that the Python HTTP server is running before exposing it externally.




# Test access from Fedora host
curl http://192.168.122.88:8000









✅ Expected output:




  • A directory listing of the files served by the Python HTTP server

  • Or the contents of an index.html file if present




💡 Tip: If you see a connection refused error, make sure the Python server is running and bound to 0.0.0.0.










Access from External Devices / Smartphone



Smartphones or external devices on a different network cannot reach the VM’s private IP directly. To solve this, we use Localtunnel to create a public HTTPS URL that forwards traffic to the VM.




  1. Install Node.js and Localtunnel on the VM




# Install Node.js and npm (if not already installed)
sudo dnf install -y nodejs npm

# Install Localtunnel globally
sudo npm install -g localtunnel







  1. Start the tunnel




# Forward port 8000 to a public URL
lt --port 8000






-Localtunnel will generate a public URL, e.g., https://hot-deer-send.loca.lt




  • Open this URL in your smartphone browser → you should see the Python app content.




💡 Tip: Each time you start Localtunnel, the URL changes unless you specify a custom subdomain.










Content Served by Python Server



By default, the Python HTTP server serves the current directory as a simple web app. Example directory structure:




/home/alok/systems-thinking
├── server.py
├── venv/
└── README.md







  • Accessing the server URL lists these files automatically in HTML

  • You can place an index.html file to serve a custom homepage









Traffic Flow Diagram






[Smartphone / Mobile Data]


[Public Tunnel via Localtunnel]


[Fedora Host 192.168.0.136]
(KVM/QEMU + NAT)


[AlmaLinux VM 192.168.122.88]
Python HTTP Server :8000







  • Smartphone requests → public tunnel → host → VM → Python server → response flows back the same way.






This completes the core tutorial flow: from environment setup → VM server → host access → external access → traffic understanding.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Host a Simple Python App on a Virtual Machine (Step-by-Step)

Thematisch verwandte Begriffe: Host, Simple, Python, Virtual · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94494 | jshERP through 3.6 contains a tenant isolation bypass vulnerability that…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick