# Running IPFS on Google Compute Engine instance

**URL:** <https://discuss.ipfs.tech/t/running-ipfs-on-google-compute-engine-instance/1487>\
**Category:** Help\
**Created:** [November 21, 2017, 1:15pm UTC](https://discuss.ipfs.tech/t/running-ipfs-on-google-compute-engine-instance/1487 "2017-11-21T13:15:43Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![HernanPaez](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hernanpaez/32/2544_2.png) [@HernanPaez](https://discuss.ipfs.tech/u/HernanPaez)\
**Post date:** [November 21, 2017, 1:15pm UTC](https://discuss.ipfs.tech/t/running-ipfs-on-google-compute-engine-instance/1487/1 "2017-11-21T13:15:43Z")

</div>

Hi!

I’m trying to run IPFS on a Google Compute Engine Instance. I already installed the linux prebuilt package but, when I first started the daemon I was not able to access the gateway but I fixed it by opening the 5001 tcp and udp ports but it don’t connect to any node.

I tried by opening the following ports I found in another thread [IPFS ports firewall](https://discuss.ipfs.tech/t/ipfs-ports-firewall/996)

TCP 4001 5001 8080 8081  
UDP 4002/udp

I’m also seeing that the fields Peer ID, Location, Agent Version, Protocol Version, Public Key are empty in the webui

I’m working on a small project and I’m trying to make it visible for a small presentation and it will be great if I can run it on a VM to make the public interact with it

---

<div class="post-metadata">

**Author:** ![josselinchevalay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/josselinchevalay/32/3078_2.png) [@josselinchevalay](https://discuss.ipfs.tech/u/josselinchevalay)\
**Post date:** [November 21, 2017, 1:22pm UTC](https://discuss.ipfs.tech/t/running-ipfs-on-google-compute-engine-instance/1487/2 "2017-11-21T13:22:11Z")

</div>

> [@HernanPaez](#):
>
> Hi!
> 
> I’m trying to run IPFS on a Google Compute Engine Instance. I already installed the linux prebuilt package but, when I first started the daemon I was not able to access the gateway but I fixed it by opening the 5001 tcp and udp ports but it don’t connect to any node.
> 
> I tried by opening the following ports I found in another thread [IPFS ports firewall](https://discuss.ipfs.tech/t/ipfs-ports-firewall/996)
> 
> TCP 4001 5001 8080 8081  
> UDP 4002/udp
> 
> I’m also seeing that the fields Peer ID, Location, Agent Version, Protocol Version, Public Key are empty in the webui
> 
> I’m working on a small project and I’m trying to make it visible for a small presentation and it will be great if I can run it on a VM to make the public interact with it

could you precise OS version and ipfs version

could try to run `ipfs init`

regards

---

<div class="post-metadata">

**Author:** ![HernanPaez](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hernanpaez/32/2544_2.png) [@HernanPaez](https://discuss.ipfs.tech/u/HernanPaez)\
**Post date:** [November 21, 2017, 1:28pm UTC](https://discuss.ipfs.tech/t/running-ipfs-on-google-compute-engine-instance/1487/3 "2017-11-21T13:28:36Z")

</div>

I’m running IPFS 0.4.13 over Ubuntu 16.04

This is the full uname -a output

`Linux instance-1 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux`

---

<div class="post-metadata">

**Author:** ![josselinchevalay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/josselinchevalay/32/3078_2.png) [@josselinchevalay](https://discuss.ipfs.tech/u/josselinchevalay)\
**Post date:** [November 21, 2017, 1:36pm UTC](https://discuss.ipfs.tech/t/running-ipfs-on-google-compute-engine-instance/1487/4 "2017-11-21T13:36:06Z")

</div>

could you see your ipfs config ? `ipfs config show`

---

<div class="post-metadata">

**Author:** ![HernanPaez](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hernanpaez/32/2544_2.png) [@HernanPaez](https://discuss.ipfs.tech/u/HernanPaez)\
**Post date:** [November 21, 2017, 1:39pm UTC](https://discuss.ipfs.tech/t/running-ipfs-on-google-compute-engine-instance/1487/5 "2017-11-21T13:39:13Z")

</div>

This is my config

```
{
  "API": {
    "HTTPHeaders": null
  },
  "Addresses": {
    "API": "/ip4/0.0.0.0/tcp/5001",
    "Announce": [],
    "Gateway": "/ip4/0.0.0.0/tcp/8080",
    "NoAnnounce": [],
    "Swarm": [
      "/ip4/0.0.0.0/tcp/4001",
      "/ip6/::/tcp/4001"
    ]
  },
  "Bootstrap": [
    "/dnsaddr/bootstrap.libp2p.io/ipfs/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
    "/dnsaddr/bootstrap.libp2p.io/ipfs/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
  "Reprovider": {
    "/dnsaddr/bootstrap.libp2p.io/ipfs/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
    "/dnsaddr/bootstrap.libp2p.io/ipfs/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
    "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
    "/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM",
    "/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu",
    "/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64",
    "/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd",
    "/ip6/2604:a880:1:20::203:d001/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM",
    "/ip6/2400:6180:0:d0::151:6001/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu",
    "/ip6/2604:a880:800:10::4a:5001/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64",
    "/ip6/2a03:b0c0:0:1010::23:1001/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd"
  ],
  "Datastore": {
    "BloomFilterSize": 0,
    "GCPeriod": "1h",
    "HashOnRead": false,
    "Spec": {
      "mounts": [
        {
          "child": {
            "path": "blocks",
            "shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
            "sync": true,
            "type": "flatfs"
          },
          "mountpoint": "/blocks",
          "prefix": "flatfs.datastore",
          "type": "measure"
        },
        {
          "child": {
            "compression": "none",
            "path": "datastore",
            "type": "levelds"
          },
          "mountpoint": "/",
          "prefix": "leveldb.datastore",
          "type": "measure"
        }
      ],
      "type": "mount"
    },
    "StorageGCWatermark": 90,
    "StorageMax": "10GB"
  },
  "Discovery": {
    "MDNS": {
      "Enabled": true,
      "Interval": 10
    }
  },
  "Experimental": {
    "FilestoreEnabled": false,
    "Libp2pStreamMounting": false,
    "ShardingEnabled": false
  },
  "Gateway": {
    "HTTPHeaders": {
      "Access-Control-Allow-Headers": [
        "X-Requested-With",
        "Range"
      ],
      "Access-Control-Allow-Methods": [
        "GET"
      ],
      "Access-Control-Allow-Origin": [
        "*"
      ]
    },
    "PathPrefixes": [],
    "RootRedirect": "",
    "Writable": false
  },
  "Identity": {
    "PeerID": "QmYYSD3GP88wwMo9MTjM3vze8KR5p4AJfGVkSfUgCQZGqs"
  },
  "Ipns": {
    "RecordLifetime": "",
    "RepublishPeriod": "",
    "ResolveCacheSize": 128
  },
  "Mounts": {
    "FuseAllowOther": false,
    "IPFS": "/ipfs",
    "IPNS": "/ipns"
  },
  "Reprovider": {
    "Interval": "12h",
    "Strategy": "all"
  },
  "Swarm": {
    "AddrFilters": null,
    "ConnMgr": {
      "GracePeriod": "20s",
      "HighWater": 900,
      "LowWater": 600,
      "Type": "basic"
    },
    "DisableBandwidthMetrics": false,
    "DisableNatPortMap": false,
    "DisableRelay": false,
    "EnableRelayHop": false
  }
}
```

---

<div class="post-metadata">

**Author:** ![josselinchevalay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/josselinchevalay/32/3078_2.png) [@josselinchevalay](https://discuss.ipfs.tech/u/josselinchevalay)\
**Post date:** [November 21, 2017, 1:55pm UTC](https://discuss.ipfs.tech/t/running-ipfs-on-google-compute-engine-instance/1487/6 "2017-11-21T13:55:51Z")

</div>

do you check firewall on GCE : [https://stackoverflow.com/a/21068402/3063005](https://stackoverflow.com/a/21068402/3063005)

---

<div class="post-metadata">

**Author:** ![HernanPaez](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hernanpaez/32/2544_2.png) [@HernanPaez](https://discuss.ipfs.tech/u/HernanPaez)\
**Post date:** [November 21, 2017, 2:56pm UTC](https://discuss.ipfs.tech/t/running-ipfs-on-google-compute-engine-instance/1487/7 "2017-11-21T14:56:57Z")

</div>

I opened all ports (incoming and outgoing) on the instance but it can’t connect

 ![](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/1X/55311dbdda703f7ad43cf9ce3f3b032e22c72141.png)

---

<div class="post-metadata">

**Author:** ![josselinchevalay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/josselinchevalay/32/3078_2.png) [@josselinchevalay](https://discuss.ipfs.tech/u/josselinchevalay)\
**Post date:** [November 21, 2017, 4:24pm UTC](https://discuss.ipfs.tech/t/running-ipfs-on-google-compute-engine-instance/1487/8 "2017-11-21T16:24:50Z")

</div>

in your navigator javascript console do you have javascript error ?

---

<div class="post-metadata">

**Author:** ![HernanPaez](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hernanpaez/32/2544_2.png) [@HernanPaez](https://discuss.ipfs.tech/u/HernanPaez)\
**Post date:** [November 21, 2017, 4:29pm UTC](https://discuss.ipfs.tech/t/running-ipfs-on-google-compute-engine-instance/1487/9 "2017-11-21T16:29:48Z")

</div>

yes, I opened inspector and it is showing this error on file `ipfs-webui.0.3.0.js:12:31024`

```
SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 5 of the JSON data
Stack trace:
r/<@http://104.196.10.137:5001/ipfs/QmPhnvn747LqwPYMJmQVorMaGbMSgA7mRRoyyZYz3DoZRQ/ipfs-webui.0.3.0.js:14:30570
n@http://104.196.10.137:5001/ipfs/QmPhnvn747LqwPYMJmQVorMaGbMSgA7mRRoyyZYz3DoZRQ/ipfs-webui.0.3.0.js:2:23902
r/<@http://104.196.10.137:5001/ipfs/QmPhnvn747LqwPYMJmQVorMaGbMSgA7mRRoyyZYz3DoZRQ/ipfs-webui.0.3.0.js:17:30820
n.prototype.emit@http://104.196.10.137:5001/ipfs/QmPhnvn747LqwPYMJmQVorMaGbMSgA7mRRoyyZYz3DoZRQ/ipfs-webui.0.3.0.js:2:366
E@http://104.196.10.137:5001/ipfs/QmPhnvn747LqwPYMJmQVorMaGbMSgA7mRRoyyZYz3DoZRQ/ipfs-webui.0.3.0.js:55:24024
y@http://104.196.10.137:5001/ipfs/QmPhnvn747LqwPYMJmQVorMaGbMSgA7mRRoyyZYz3DoZRQ/ipfs-webui.0.3.0.js:55:23115
n/<@http://104.196.10.137:5001/ipfs/QmPhnvn747LqwPYMJmQVorMaGbMSgA7mRRoyyZYz3DoZRQ/ipfs-webui.0.3.0.js:2:7836
u.prototype.run@http://104.196.10.137:5001/ipfs/QmPhnvn747LqwPYMJmQVorMaGbMSgA7mRRoyyZYz3DoZRQ/ipfs-webui.0.3.0.js:1:26073
s@http://104.196.10.137:5001/ipfs/QmPhnvn747LqwPYMJmQVorMaGbMSgA7mRRoyyZYz3DoZRQ/ipfs-webui.0.3.0.js:1:25581
```

---

<div class="post-metadata">

**Author:** ![josselinchevalay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/josselinchevalay/32/3078_2.png) [@josselinchevalay](https://discuss.ipfs.tech/u/josselinchevalay)\
**Post date:** [November 21, 2017, 4:41pm UTC](https://discuss.ipfs.tech/t/running-ipfs-on-google-compute-engine-instance/1487/10 "2017-11-21T16:41:12Z")

</div>

intresting maybe you can poste this issue on github

---

<div class="post-metadata">

**Author:** ![stebalien](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/stebalien/32/156_2.png) [@stebalien](https://discuss.ipfs.tech/u/stebalien)\
**Post date:** [November 21, 2017, 8:37pm UTC](https://discuss.ipfs.tech/t/running-ipfs-on-google-compute-engine-instance/1487/11 "2017-11-21T20:37:02Z")

</div>

Issue here:

> <https://github.com/ipfs/go-ipfs/issues/4410>
>
> Version information:
> go-ipfs version: 0.4.13-
> Repo version: 6
> System version: amd64/linux
> Golang version: go1.9.2
> Type:
> Bug
> Severity:
> High
> Description:
> I'm trying to run IPFS on a Google Compute Engine Instance running...

However, this doesn’t look like a bug. It looks like a CORS issue. Solution here:

> <https://ethereum.stackexchange.com/questions/15778/ipfs-access-via-port-5001/15781#15781>

* * *

Standard warning: Whatever you do, please do not leave the API exposed on the public internet.

---

<div class="post-metadata">

**Author:** ![decentralizedMe](https://avatars.discourse-cdn.com/v4/letter/d/c89c15/32.png) [@decentralizedMe](https://discuss.ipfs.tech/u/decentralizedMe)\
**Post date:** [November 17, 2018, 12:12pm UTC](https://discuss.ipfs.tech/t/running-ipfs-on-google-compute-engine-instance/1487/12 "2018-11-17T12:12:56Z")

</div>

Hi, I am trying to upload a file to the IPFS node which is running in GCP, CentOS 7 (using js-ipfs).

this.ipfsApi = ipfsAPI(‘localhost’, ‘5001’) - works fine  
but  
this.ipfsApi = ipfsAPI(‘GCP Instance’s IP’, ‘5001’) - does not work and it says connection refused. I have allowed all ports actually, but still no luck reaching out to this.

I want to upload the files from my client to the remote node, without using the local node. Any help would be greatly appreciated.

Thanks in advance.
