How to Use Python ‘SimpleHTTPServer’ to Create Webserver or Serve Files Instantly

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Thilina Uvindasiri

I'm a BSc Special (Hons) graduate in Information Technology and works as an Engineer-Systems. Love to work, explore and research Linux and play rugby as a hobby.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

18 Responses

  1. Rene says:

    How start in boot (service)?

  2. Igor Ganapolsky says:

    Is it possible to access the SimpleHTTPServer from outside the LAN, like over DNS?

    • Ravi Saive says:


      As far as you’ve static IP address, you can access SimpleHTTPServer from anywhere in the world using IP address and port..

  3. aerin says:

    Hi Thilina, thanks for the awesome post! I ran this as instructed (nohup python -m SimpleHTTPServer 80 &) however after 1-2 days, the server stops. Then I have to ps ax and kill SimpleHTTPServer manually and run again. Can you give me some advice- where to look at, why it stops after some time?

    • Thilina Uvindasiri says:

      Hi aerin,

      I think this can be happen due to a shell change. Cannot tell the exact reason without looking at it. But can you try using absolute path for the “nohup” command.
      Step 01. Enter “which nohup” in your logging shell.
      Below is the sample output.

      [[email protected] ~]# which nohup

      Step 02. Enter your command with absolute path for the “nohup” command.
      [[email protected] ~]# /usr/bin/nohup python -m SimpleHTTPServer 80 &

      Try this and let me know if the error still exists.

Leave a Reply to Rene Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.