About me

Paolo Iannelli Picture

Paolo Iannelli

Sr. Software Engineer / Software Architect at LeaseWeb

Amsterdam Area, Netherlands
Information Technology and Services
Python, Big Data, Scalability, High Availability, Performance
Senior Software Engineer and Architect with more than 8 years experience.
Strong in critical thinking, problem solving and high performance architectures.
Paolo Iannelli Labs Rss

Share files via HTTP without installing any webserver

Posted on : 20-07-2013 | By : Paolo Iannelli | In : Linux administration, Python, System Administration, Uncategorized


Did you ever been in a situation where you want to share a file and you don’t really have a way to do it ?

I mean, those situations when :

  • you would like to SCP a file, but you can’t because you don’t have your key in the other machine or is not directly reachable
  • you would like to send a file via FTP, but you don’t want to install any FTP server
  • you decide to share the file via HTTP, but then you realize you need to install a webserver with all its dependencies and nevertheless configure it

I have a solution !

Since most distributions nowadays have python installed by default, you can simply go to the directory that hosts the file and run

Port is optional and by default 8000 if you don’t specify a different one.

File listing is enabled by default, so be sure not to share any directory that contains sensitive files!

My suggestion is to put the files you want to expose to a dedicated directory and then start the HTTP server. When you are done, you can safely remove the directory.

Happy serving!

Write a comment