Share a local folder over the internet
Solution 1:
If you want to do in an easy and quick way, follow these steps:
- Navigate to the directory you want to share, for example:
cd /home/user/Videos
- Type the following:
python -m SimpleHTTPServer
(NOTE: In python3 this changed topython3 -m http.server
). You should see a message sayingServing HTTP on 0.0.0.0 port 8000 ...
, 8000 being the default http port (you can specify it as a parameter in the command at the end) - Test your configuration by typing
http://127.0.0.1:8000
in your browser. You should see a list of files in there. - Find your IP address (for example, 192.168.1.1) and use that as your external address with the :8000 appended to it.
- To terminate the server, hit
CTRL+C
.
.
Solution 2:
If you don't want to worry about port forwarding too much, and allow much more options, you can use syncthing
This will allow you to share multiple folders, each with different people, with unlimited space. Also, they can add files, if you allow them.
Additionally, it's p2p, so even if your pc is offline, and it's already on another client, the third client will be able to sync. There is also no need for worrying about your dynamic ip.