I have a beefy server I am not really using for much right now and I am very interested in using IPFS for a project in the near future.
I started the daemon and below is the output (I turned it off now).
I tried to connect to http://199.223.253.96:5001/webui
and http://199.223.253.96:4001/webui
and even tried http://199.223.253.96:8080/webui
and none of these worked.
Is there something else I need to do to expose the webui to the internet ? It’s on a server so I cannot use localhost.
ipfs daemon
Initializing daemon...
Successfully raised file descriptor limit to 2048.
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/199.223.253.96/tcp/4001
Swarm listening on /ip6/2604:7c00:17:22e::4bed/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /p2p-circuit/ipfs/QmfWj3JQJoUwTsQx451q3hKZrLUom8WBPMSjjMnS2KbLjs
Swarm announcing /ip4/127.0.0.1/tcp/4001
Swarm announcing /ip4/199.223.253.96/tcp/4001
Swarm announcing /ip6/2604:7c00:17:22e::4bed/tcp/4001
Swarm announcing /ip6/::1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Daemon is ready
Thank you,
Thomas
You may need to open the ports in the firewall (depends where the server is, or if you have some firewall locally in the server).
As an alternative you can setup port forwarding for localhost connections via ssh.
Something like:
ssh -L 5001:localhost:5001 user@example.com
and then you should be able to visit http://localhost:5001/webui
Note: you might need to change the options to ssh for the port forwarding
Port 4001 is the IPFS port and isn’t an HTTP server so you won’t be able to access it from your browser.
Port 5001 and 8080 are the HTTP API and HTTP Gateway ports, respectively. However, they listen on localhost by default for security reasons. You can configure them to listen on a public address (e.g., 0.0.0.0) by modifying the config (take a look at the Addresses section). However, I wouldn’t recommend exposing these to the public internet unless you know what you’re doing:
- Exposing the API is almost certainly not a good idea.
- Exposing the Gateway is fine (it allows users to visit http://YourGateway/ipfs/Qm…). However, it will turn your gateway into a public IPFS proxy (which may have legal consequences). We do this for
https://ipfs.io
(that’s why you can visit https://ipfs.io/ipfs/Qm...
), however, we also have to deal with takedown requests and abuse reports.
Note: You can, of course, expose these to your local network without any issues as long as they’re behind a firewall.
3 Likes
Thank you for this information. I appreciate it.
So simply having the daemon running it does contribute to the network because the 4001 is exposed to other IPFS nodes ?
How often is garbage collection done on a given node? (i do assume it’s user configurable) I am asking because I have a project I am working on in the next month or two and I would like to put the files on IPFS to persist them, hopefully indefinitely. I know that FileCoin is supposed to essentially take care of this. Is there any other way to ask that nodes hold on to certain files ?
So simply having the daemon running it does contribute to the network because the 4001 is exposed to other IPFS nodes?
It’ll participate in the DHT so it’ll store IPNS records, peer routing information (peer addresses), and content routing information (who’s storing what files). However, a node don’t store files on behalf of others unless you explicitly ask it to.
I know that FileCoin is supposed to essentially take care of this. Is there any other way to ask that nodes hold on to certain files?
Not in the protocol. You can find ipfs pinning services that store files for some period of time in exchange for payment but you’d have to make an agreement with every service individually.
Note: In IPFS, permanent refers to the addressing. That is, a file’s address doesn’t change.