create account

How To Install IPFS and Forward Ports In VM by necroth

View this thread on: hive.blogpeakd.comecency.com
· @necroth ·
$1.01
How To Install IPFS and Forward Ports In VM
I have never posted on Steem. I have been in the community for quite awhile, peering from the shadows. Finally I have decided to start an IPFS node to support content on DTube. This guide will show you how to install IPFS alongside @techcoderx's Discord bot. This bot enables user backups of DTube videos, as well as backing up Dsound. It will also explain to you how to forward ports in a VM. Pre-requisite, [How to use NANO](https://www.youtube.com/watch?v=cLyUZAabf4) and [How to navigate](https://www.youtube.com/watch?v=IVquJh3DXUA) in the Linux terminal


![PortForwardIPFS.jpg](https://files.steempeak.com/file/steempeak/necroth/GafB7GNm-PortForwardIPFS.jpg)

We deployed this on the Lubuntu 18.04 Linux Distribution. 


___________________________________________
### Step One
- Create a user name
``adduser username``

- Sudo the user.
``usermod -aG username``

___________________________________________
### Step Two: Install Node 


``curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -``

``sudo apt-get install nodejs``


___________________________________________
### Step Three: Install Git, Clone Github Repo

``git clone https://github.com/techcoderx/DTube-IPFS-Bot.git``

___________________________________________
### Step Four: Install the Discord Bot

``cd DTube-IPFS-Bot``

``npm install``

___________________________________________
### Step Five: Install IPFS
``wget https://dist.ipfs.io/go-ipfs/v0.4.19/go-ipfs_v0.4.19_linux-amd64.tar.gz``

``tar xvfz go-ipfs_v0.4.19_linux-amd64.tar.gz``
``cd go-ipfs``

``sudo ./install.sh``

``ipfs init``

___________________________________________
### Step Six: Configure IPFS 

Edit your config file with
- Disable mDNS discovery
``ipfs config --json Discovery.MDNS.Enabled false``

- Filter out local network addresses
``ipfs config --json Swarm.AddrFilters '[``
  ``"/ip4/10.0.0.0/ipcidr/8",``
  ``"/ip4/100.64.0.0/ipcidr/10",``
  ``"/ip4/169.254.0.0/ipcidr/16",``
  ``"/ip4/172.16.0.0/ipcidr/12",``
  ``"/ip4/192.0.0.0/ipcidr/24",``
  ``"/ip4/192.0.0.0/ipcidr/29",``
  ``"/ip4/192.0.0.8/ipcidr/32",``
  ``"/ip4/192.0.0.170/ipcidr/32",``
  ``"/ip4/192.0.0.171/ipcidr/32",``
  ``"/ip4/192.0.2.0/ipcidr/24",``
  ``"/ip4/192.168.0.0/ipcidr/16",``
  ``"/ip4/198.18.0.0/ipcidr/15",``
  ``"/ip4/198.51.100.0/ipcidr/24",``
  ``"/ip4/203.0.113.0/ipcidr/24",``
  ``"/ip4/240.0.0.0/ipcidr/4"``
``]'``
___________________________________________
### Step Seven: Edit Your Configuration File

Write down your port, and forward your local router or firewalls (if needed) for proper connection on said port. I suggest using high ports. 45,000+. Say your .ipfs folder is in your home directory you can bring up and edit your configuration file with a program called nano. See the commands below.

``cd .ipfs``
``nano config``
Here is a screenshot of it in my configuration file for reference.


![IPFSconfigScreenshot.png](https://files.steempeak.com/file/steempeak/necroth/g34iR3Nh-IPFSconfigScreenshot.png)


You may want to adjust high water and low water to suit your computers performance.
An example for lower end computers, put high water at 65 and the low water at 25.

For you reference the port configuration is under swarm.

______________________________________________
### Step Eight Create/Configure/Find Discord Bot Token 

https://discordapp.com/developers/

![DiscordDeveloper.PNG](https://files.steempeak.com/file/steempeak/necroth/3bxW7nNS-DiscordDeveloper.PNG)

Choose a good name for your bot.

![DiscordDevelopername.PNG](https://files.steempeak.com/file/steempeak/necroth/mpqJ1yik-DiscordDevelopername.PNG)

Here you will see your client ID, this is very important. Make sure to copy it and save it for the time being. Take the client ID and create your invite link. 

![DiscorddeveloperID.PNG](https://files.steempeak.com/file/steempeak/necroth/2p18jj2g-DiscorddeveloperID.PNG)

Next you will want to add your bot.

![discordDeveloperADDBOT.PNG](https://files.steempeak.com/file/steempeak/necroth/kz5jfSyH-discordDeveloperADDBOT.PNG)

Here you will see how to get your bot token. You will need this to make your invite link.


![DeveloperBotToken.PNG](https://files.steempeak.com/file/steempeak/necroth/5YhlYilM-DeveloperBotToken.PNG)


Enter the token you got from the discord developers section into the "auth.json" file in the DTube-IPFS-Bot directory

![BotTOkenJSON.png](https://files.steempeak.com/file/steempeak/necroth/pAUYyO1r-BotTOkenJSON.png)


_________________________________________
### Step Nine: Configure the settings for the discord bot in config.json

![DiscordBot.PNG](https://files.steempeak.com/file/steempeak/necroth/pvRhbycv-DiscordBot.PNG)

_________________________________________
### Step Ten: Invite the bot to the discord you would like (by creating an invite link)

Right after client_id=, the zeroes represent where you need to put your client id. Which you can find in the discord developers section. This is how you make your invite link.

https://discordapp.com/oauth2/authorize?client_id=000000000000000000&scope=bot&permissions=523328

_________________________________________
### Step Eleven: Install pm2 software

``sudo npm install pm2@latest -g``

_________________________________________
### Step Tweleve:Node Start

This command starts your nodejs bot

``pm2 start bot.js``

This command starts your IPFS daemon

``pm2 start "ipfs daemon --enable-gc"``

_________________________________________
### Step Thirteen: Test to see if your bot is responding with a !ping command.
If successful, then test to see if the bot pins DTube/Dsound content.

________________________________________
### Step Fourteen:Portr Forward in VM



This website was very helpful in helping me forward my Virtual machine port.

With the port you have selected, go into you router settings. If you do not know how to, you should have documentation on how to, or call you ISP. Input the IP address you obtained from your VM for the port forwarding IP.

A video explaining how to [port forward](https://www.youtube.com/watch?v=2G1ueMDgwxw). 


To forward your port in your Virtual Machine, first you need to click on your connection. 


![Step14connectionRevised.png](https://files.steempeak.com/file/steempeak/necroth/FjlIdXkN-Step14connectionRevised.png)


As it states in the picture you only need the IP address and the port you have chosen to forward. 

https://www.howtogeek.com/122641/how-to-forward-ports-to-a-virtual-machine-and-use-it-as-a-server/

In the picture, where it says guest IP, input the IP from your VM. For host leave blank. The host port and guest port will be the port you have chosen to forward.

![portForwardGuestIP.PNG](https://files.steempeak.com/file/steempeak/necroth/1wfoCCXU-portForwardGuestIP.PNG)

**Congratulations, you have successfully set up an IPFS node in a vm!!**

Without @gray00's help none of this would have been possible.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 37 others
properties (23)
authornecroth
permlinkhow-to-install-ipfs-and-forward-ports-in-vm
categorydtube
json_metadata{"community":"steempeak","app":"steempeak/1.8.4b","format":"markdown","tags":["dtube","ipfs","onelovedtube","oneloveipfs","guide"],"users":["techcoderx","latest","gray00"],"links":["/@techcoderx","https://www.youtube.com/watch?v=cLyUZAabf4","https://www.youtube.com/watch?v=IVquJh3DXUA","https://discordapp.com/developers/","https://discordapp.com/oauth2/authorize?client_id=000000000000000000&scope=bot&permissions=523328","https://www.youtube.com/watch?v=2G1ueMDgwxw","https://www.howtogeek.com/122641/how-to-forward-ports-to-a-virtual-machine-and-use-it-as-a-server/","/@gray00"],"image":["https://files.steempeak.com/file/steempeak/necroth/GafB7GNm-PortForwardIPFS.jpg","https://files.steempeak.com/file/steempeak/necroth/g34iR3Nh-IPFSconfigScreenshot.png","https://files.steempeak.com/file/steempeak/necroth/3bxW7nNS-DiscordDeveloper.PNG","https://files.steempeak.com/file/steempeak/necroth/mpqJ1yik-DiscordDevelopername.PNG","https://files.steempeak.com/file/steempeak/necroth/2p18jj2g-DiscorddeveloperID.PNG","https://files.steempeak.com/file/steempeak/necroth/kz5jfSyH-discordDeveloperADDBOT.PNG","https://files.steempeak.com/file/steempeak/necroth/5YhlYilM-DeveloperBotToken.PNG","https://files.steempeak.com/file/steempeak/necroth/pAUYyO1r-BotTOkenJSON.png","https://files.steempeak.com/file/steempeak/necroth/pvRhbycv-DiscordBot.PNG","https://files.steempeak.com/file/steempeak/necroth/FjlIdXkN-Step14connectionRevised.png","https://files.steempeak.com/file/steempeak/necroth/1wfoCCXU-portForwardGuestIP.PNG"]}
created2019-03-12 09:10:09
last_update2019-03-12 09:10:09
depth0
children7
last_payout2019-03-19 09:10:09
cashout_time1969-12-31 23:59:59
total_payout_value0.862 HBD
curator_payout_value0.146 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length6,880
author_reputation27,129,939,188
root_title"How To Install IPFS and Forward Ports In VM"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id81,124,851
net_rshares1,639,636,728,474
author_curate_reward""
vote details (101)
@apshamilton ·
$0.33
Great explanation and sorely needed. 
I just set up Dtube IPFS node and it was quite hard to do despite great help from @vaultec and @graylan.

I wish I'd had this detailed description with screenshots last week!
👍  , , , , , ,
properties (23)
authorapshamilton
permlinkre-necroth-how-to-install-ipfs-and-forward-ports-in-vm-20190312t121409795z
categorydtube
json_metadata{"tags":["dtube"],"community":"steempeak","app":"steempeak/1.8.4b"}
created2019-03-12 12:14:09
last_update2019-03-12 12:14:09
depth1
children0
last_payout2019-03-19 12:14:09
cashout_time1969-12-31 23:59:59
total_payout_value0.248 HBD
curator_payout_value0.078 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length212
author_reputation214,010,912,760,441
root_title"How To Install IPFS and Forward Ports In VM"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id81,134,939
net_rshares472,889,579,985
author_curate_reward""
vote details (7)
@frankbacon ·
Highly rEsteemed!
👍  ,
properties (23)
authorfrankbacon
permlinkre-necroth-how-to-install-ipfs-and-forward-ports-in-vm-20190312t175121560z
categorydtube
json_metadata{"tags":["dtube"],"app":"steemit/0.1"}
created2019-03-12 17:51:21
last_update2019-03-12 17:51:21
depth1
children0
last_payout2019-03-19 17:51:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length17
author_reputation36,630,927,301,955
root_title"How To Install IPFS and Forward Ports In VM"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id81,158,809
net_rshares13,398,055,308
author_curate_reward""
vote details (2)
@solominer ·
Nice! Love how simple you kept it
👍  , ,
properties (23)
authorsolominer
permlinkre-necroth-how-to-install-ipfs-and-forward-ports-in-vm-20190313t154911554z
categorydtube
json_metadata{"tags":["dtube"],"app":"steemit/0.1"}
created2019-03-13 15:49:12
last_update2019-03-13 15:49:12
depth1
children0
last_payout2019-03-20 15:49:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length33
author_reputation1,906,760,901,359,236
root_title"How To Install IPFS and Forward Ports In VM"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id81,236,956
net_rshares28,862,637,473
author_curate_reward""
vote details (3)
@steemitboard ·
Congratulations @necroth! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td>https://steemitimages.com/60x60/http://steemitboard.com/notifications/firstpost.png</td><td>You published your First Post</td></tr>
<tr><td>https://steemitimages.com/60x60/http://steemitboard.com/notifications/firstvoted.png</td><td>You got a First Vote</td></tr>
<tr><td>https://steemitimages.com/60x70/http://steemitboard.com/@necroth/voted.png?201903120937</td><td>You received more than 50 upvotes. Your next target is to reach 100 upvotes.</td></tr>
</table>

<sub>_[Click here to view your Board](https://steemitboard.com/@necroth)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) and get one more award and increased upvotes!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-necroth-20190312t121243000z
categorydtube
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2019-03-12 12:12:42
last_update2019-03-12 12:12:42
depth1
children0
last_payout2019-03-19 12:12:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length982
author_reputation38,975,615,169,260
root_title"How To Install IPFS and Forward Ports In VM"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id81,134,832
net_rshares0
@steemitboard ·
@necroth, thank you for supporting @steemitboard as a witness.

[![](https://steemitimages.com/70x70/http://steemitboard.com/notifications/supportboard.png)](http://steemitboard.com/@necroth) Here is a small present to show our gratitude
<sub>_Click on the badge to view your Board of Honor._</sub>

Once again, thanks for your support!

**Do not miss the last post from @steemitboard:**
<table><tr><td><a href="https://steemit.com/drugwars/@steemitboard/drugwars-early-adopter"><img src="https://steemitimages.com/64x128/https://cdn.steemitimages.com/DQmYGN7R653u4hDFyq1hM7iuhr2bdAP1v2ApACDNtecJAZ5/image.png"></a></td><td><a href="https://steemit.com/drugwars/@steemitboard/drugwars-early-adopter">Are you a DrugWars early adopter? Benvenuto in famiglia!</a></td></tr></table>
properties (22)
authorsteemitboard
permlinksteemitboard-notify-necroth-20190313t091719000z
categorydtube
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2019-03-13 09:17:18
last_update2019-03-13 09:17:18
depth1
children0
last_payout2019-03-20 09:17:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length778
author_reputation38,975,615,169,260
root_title"How To Install IPFS and Forward Ports In VM"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id81,211,067
net_rshares0
@techcoderx · (edited)
$0.02
Don't forget to configure the bot in `config.json` file :D

And please change the node id to something that uniquely identifies your bot. It may be a string or a number. `1`, `2` and `3` have been taken.
👍  , , ,
properties (23)
authortechcoderx
permlinkre-necroth-how-to-install-ipfs-and-forward-ports-in-vm-20190312t094547578z
categorydtube
json_metadata{"tags":["dtube"],"app":"steemit/0.1"}
created2019-03-12 09:45:48
last_update2019-03-12 09:47:54
depth1
children1
last_payout2019-03-19 09:45:48
cashout_time1969-12-31 23:59:59
total_payout_value0.019 HBD
curator_payout_value0.005 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length203
author_reputation48,655,732,596,186
root_title"How To Install IPFS and Forward Ports In VM"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id81,126,963
net_rshares36,298,825,705
author_curate_reward""
vote details (4)
@graylan ·
Ah, good tip. :D I forgot about the config.json
properties (22)
authorgraylan
permlinkre-techcoderx-re-necroth-how-to-install-ipfs-and-forward-ports-in-vm-20190312t104901845z
categorydtube
json_metadata{"tags":["dtube"],"app":"steemit/0.1"}
created2019-03-12 10:49:03
last_update2019-03-12 10:49:03
depth2
children0
last_payout2019-03-19 10:49:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length47
author_reputation2,589,357,790,031
root_title"How To Install IPFS and Forward Ports In VM"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id81,129,893
net_rshares0