I am running into the following problem setting up a IPFS node on an AWS Lightsail instance.
The steps:
(1) Launch a ubuntu 16.4 instance, download and install go-ipfs.
(2) Edit the config file to change the IP from 127.0.0.1 to 0.0.0.0:
"API": "/ip4/0.0.0.0/tcp/5001",
"Gateway": "/ip4/0.0.0.0/tcp/8080"
(3) Open port 8080 and 5001 from the AWS control panel.
(4) Start ipfs daemon
Initializing daemon...
go-ipfs version: 0.4.20-
Repo version: 7
System version: 386/linux
Golang version: go1.12.4
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/172.26.8.175/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /p2p-circuit
Swarm announcing /ip4/127.0.0.1/tcp/4001
Swarm announcing /ip6/::1/tcp/4001
API server listening on /ip4/0.0.0.0/tcp/5001
WebUI: http://0.0.0.0:5001/webui
Gateway (readonly) server listening on /ip4/0.0.0.0/tcp/8080
Daemon is ready
I can now access IPFS content from [PUBLIC IP]:8080/ipfs/Qm....
Great! But what I am actually looking to do is access the API over port 5001.
Trying this from a node app running on my local machine like so:
const ipfs = ipfsAPI({ host: '[PUBLIC IP]', port: '5001' })
I get this error:
{ Error: connect ETIMEDOUT [PUBLIC IP]:5001
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1161:14)
errno: 'ETIMEDOUT',
code: 'ETIMEDOUT',
syscall: 'connect',
address: '[PUBLIC IP]',
port: 5001 }
Any idea what I am doing wrong here? Is there some additional config I need to do to make the API accessible remotely?
Grateful for any help!