Getting started question - config webui port

Hi,
my name is Milan and I just started to learn IPFS, so hello to everyone here!
I installed IPFS on Cloud 9 virtual box, which has only ports 8080 and 8081 available,
so I think that I would need to change webui port to 8081, but I don’t know how to do it…
Any hint much appreciated!

Anyway if someone has experience to use IPFS on c9.io I would be glad to know,
because it is my development environment… so I do not waste time, if it is not possible…
Thanks for any reply!

Hi Kosim,

I also use C9 and just tried out webui: https://github.com/ipfs/webui

I’ve tried getting it to work by doing the following:

You have to config the dev server (port 8080):

diff --git a/make-config.js b/make-config.js
index ce71b3f..9ed3b50 100644
--- a/make-config.js
+++ b/make-config.js
@@ -13,7 +13,10 @@ module.exports = (isDev) => {
         publicPath: ''
       })
     },
-    clearBeforeBuild: '!(locale|img|favicon.ico)'
+    clearBeforeBuild: '!(locale|img|favicon.ico)',
+    port: 8080,
+    hostname: '0.0.0.0',
+    https: false
   })
 
   // Handle js-ipfs-api
diff --git a/quick-config.sh b/quick-config.sh
index aaa7e97..9f81490 100755

You also need to change the CORS settings in quick-config:

--- a/quick-config.sh
+++ b/quick-config.sh
@@ -1,4 +1,6 @@
-ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://localhost:3000"]'
+ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://0.0.0.0:8080"]'
 ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]'
 ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]'
+ipfs config --json Addresses.API '"/ip4/0.0.0.0/tcp/8081"'
+ipfs config --json Addresses.Gateway '"/ip4/0.0.0.0/tcp/5000"'
 echo "daemon has been configured for local Webui"
diff --git a/src/app/js/services/api.js b/src/app/js/services/api.js
index d24e03e..0ed1744 100644

and also the SPA’s API host and port:

--- a/src/app/js/services/api.js
+++ b/src/app/js/services/api.js
@@ -3,8 +3,8 @@ import {sortBy} from 'lodash-es'
 import {join} from 'path'
 import bl from 'bl'
 
-const host = (process.env.NODE_ENV !== 'production') ? 'localhost' : window.location.hostname
-const port = (process.env.NODE_ENV !== 'production') ? '5001' : (window.location.port || 80)
+const host = window.location.hostname
+const port = 8081

In two files:

--- a/src/app/js/components/ipfs.js
+++ b/src/app/js/components/ipfs.js
@@ -2,8 +2,8 @@ import React from 'react'
 import {toastr} from 'react-redux-toastr'
 import createReactClass from 'create-react-class'
 
-const host = (process.env.NODE_ENV !== 'production') ? 'localhost' : window.location.hostname
-const port = (process.env.NODE_ENV !== 'production') ? '5001' : (window.location.port || 80)
+const host = window.location.hostname
+const port = 8081
 const ipfs = require('ipfs-api')(host, port)
 
 let version = ''

Remember to run the quick-config, then run the ipfs daemon. You should then be able to visit your workspaces preview url. NOTE it has to be http, ex: http://.c9users.io:8080

@KennethHolmSeelig Thanks a lot for quick and comprehensive answer/help!
I will thy to follow your guide. Best regards!