{"id":10098,"date":"2020-05-25T16:20:01","date_gmt":"2020-05-25T16:20:01","guid":{"rendered":"http:\/\/ubuntuhandbook.org\/?p=10098"},"modified":"2020-07-03T02:06:33","modified_gmt":"2020-07-03T02:06:33","slug":"http-file-server-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2020\/05\/http-file-server-ubuntu-20-04\/","title":{"rendered":"How to Quickly Setup HTTP File Server in Ubuntu 20.04"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2017\/07\/python-icon245.png\" alt=\"\" width=\"245\" height=\"250\" class=\"aligncenter size-full wp-image-6928\" \/><\/p>\n<p>There are quite a few ways to transfer files over home network. One of the easiest ways is to run a single python command in terminal.<\/p>\n<p>Python contains a script that sets up simple http server. <b>No need to install anything<\/b>, and even <b>no internet connection required<\/b>.<\/p>\n<p><b>1.<\/b> Simply right-click on the folder that contains the files you want to transfer, then select &#8216;<b>Open in Terminal<\/b>&#8216; <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/05\/open-interminal.png\" alt=\"\" width=\"600\" height=\"354\" class=\"aligncenter size-full wp-image-10099\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/05\/open-interminal.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/05\/open-interminal-450x266.png 450w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><b>2.<\/b> When terminal opens, run the single command:<\/p>\n<pre style=\"border:None;\">python3 -m http.server<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/05\/python3-httpserver.png\" alt=\"\" width=\"600\" height=\"155\" class=\"aligncenter size-full wp-image-10100\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/05\/python3-httpserver.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/05\/python3-httpserver-450x116.png 450w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p><b>UPDATE:<\/b> You can specify the listening port (e.g., 9900) if you get &#8220;<b>Address already in use<\/b>&#8221; error, by running command:<\/p>\n<pre style=\"border:None;\">python3 -m http.server 9900<\/pre>\n<p>That&#8217;s it!<\/p>\n<p>Now any device in the same network can access the http file server by going to (<i>change 8000 if you specified another listening port<\/i>): <code>http:\/\/server_ip:8000<\/code><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/05\/pythonhttpserver.png\" alt=\"\" width=\"600\" height=\"312\" class=\"aligncenter size-full wp-image-10101\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/05\/pythonhttpserver.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/05\/pythonhttpserver-450x234.png 450w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>In addition, you may run <code>python3 -m http.server &<\/code> instead to start the http server in background, so the terminal window can be closed.<\/p>\n<p>To check your IP address, go to <u>Settings > Wi-Fi (or Network)<\/u>, click on the gear button after your connected network and check the IPv4 Address.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/05\/ipaddress.png\" alt=\"\" width=\"600\" height=\"285\" class=\"aligncenter size-full wp-image-10102\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/05\/ipaddress.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2020\/05\/ipaddress-450x214.png 450w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>","protected":false},"excerpt":{"rendered":"<p>There are quite a few ways to transfer files over home network. One of the easiest ways is to run a single python command in terminal. Python contains a script that sets up simple http server. No need to install anything, and even no internet connection required. 1. Simply right-click on the folder that contains [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1914],"class_list":["post-10098","post","type-post","status-publish","format-standard","hentry","category-howtos","tag-http-file-server"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/10098","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=10098"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/10098\/revisions"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=10098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=10098"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=10098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}