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 and How to navigate in the Linux terminal


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 | sudo bash -

sudo apt-get install nodejs

Step Three: Install Git, Clone Github Repo

git clone

Step Four: Install the Discord Bot

cd DTube-IPFS-Bot

npm install

Step Five: Install IPFS


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

sudo ./

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 '[

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.


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


Choose a good name for your bot.


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.


Next you will want to add your bot.


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


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


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


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.

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.

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


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

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.


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

Without @gray00's help none of this would have been possible.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  trending

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!

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.


Ah, good tip. :D I forgot about the config.json

Nice! Love how simple you kept it

Congratulations @necroth! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You published your First Post
You got a First Vote
You received more than 50 upvotes. Your next target is to reach 100 upvotes.

Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word STOP

Vote for @Steemitboard as a witness and get one more award and increased upvotes!

@necroth, thank you for supporting @steemitboard as a witness.

Here is a small present to show our gratitude
Click on the badge to view your Board of Honor.

Once again, thanks for your support!

Do not miss the last post from @steemitboard:

Are you a DrugWars early adopter? Benvenuto in famiglia!