How To Start An HTTP Server From Any Folder Using Python SimpleHTTPServer

Posted by Weston Ganger on November 24, 2016

If you ever have worked on a simple HTML/CSS/JS site you may want a simple solution to serve it. This is super simple thanks to python and its built in Simple HTTP Server.

cd ~/path/to/my/project/ # this folder must contain index.html

# Default, serve app on
python -m SimpleHTTPServer

# Use Different Port, Ex: Port 7777
python -m SimpleHTTPServer 7777

# Run server in background (requires using pkill to stop the server though)
&python -m SimpleHTTPServer

Related External Links:

Posted in Linux and Tagged with python server 

Need help on your next project or application?

I specialize in Ruby-on-Rails, AngularJS, Javascript, Bootstrap, and Hybrid Mobile Apps with Cordova & Ionic.

Contact Me

Recommended Posts