Introduction
In this tutorial I will guide you step by step to install and run a headless Full Node for the IOTA network using the latest stable IRI release and a Virtual Private Server (VPS). We will also install
iota-pm, in order to have a dashboard to control our neighbors perfomance. I will be using Debian 9 in my local machine and in the VPS. If you use other OS such as Windows, you can download a ssh tool such as
putty to connect to your remote server and run the commands we will cover. It should be just the same.
On this guide
This might not be the most complete/extensive guide but it works and is fast. You can get a IOTA Full Node running in a matter of minutes. For a more complex guide
visit IOTA PartnersLast update: 19 Mar 2018
Getting a VPSA Virtual Private Server is a virtual machine based server that allows you to connect and work on a given operating system as if it were a dedicated computer. You will be accesing the server and installing stuff from the scratch on a Debian 9 Linux distribution. Ubuntu and other Debian derivated should be pretty similar -if not the same.
For this tutorial we will be using a
Contabo VPS with 4 CPU cores, 12 GB RAM and 300 GB of SSD storage. As I write this, that plan costs 8.99 Euros.
Once we finished paying for the VPS, we will receive our public IP and the root password to login to the box via ssh. So, lets start there. We will access create a directory for our node and install some packages that will be needed such as Git, Maven, and others.
Starting the setupWe will be assumming that my public IP Address is
173.212.193.00. Last numbers are not shown because this is actually a Full Node I will be running.

To start let’s go to the /opt directory. Once we are there, we will install Git, Maven and Java 8. For get this done, we will use the following commands. Note that everytime you run apt install command you will be prompted to chose if you wanna install the pck or not. Just enter Y and hit enter.
root@vmi152766:/# cd /opt
root@vmi152766:/opt# apt install git
root@vmi152766:/opt# apt install maven
root@vmi152766:/opt# apt install default-jre
root@vmi152766:/opt# apt install default-jdk
If everything went fine, you should be able to see what java version you have installed by typing the following command.
To compile or not to compile, thats the QSince the IRI Github has the source code but also contains an already compiled version of the IRI, you can choose which way you wanna go. Some people would prefer to compile from code (harder road), others will just download the iri.jar and run it. We will cover both. If you dont know what compiling from source is or you dont want to loose time compiling just jump to the method B to downlod de already compiled IRI.
Method A: compile from Source Code

We are now ready to start working with the IOTA IRI. Let’s clone the
iotaledger Github IRI in our ot folder to get the latest version. Once we clone the repo a new iri folder will be created in /opt. We will compile the IRI and build the package with the following commands.
root@vmi152766:/opt# git clone https://github.com/iotaledger/iri
root@vmi152766:/opt# cd iri
root@vmi152766:/opt/iri# mvn clean compile
root@vmi152766:/opt/iri# mvn package
After executing this commands a new folder called
target will be created. Inside that folder we are going to find our executable IRI with this name
iri-1.4.2.1.jar
Method B: download already compiled IRI
In order to keep the same directory structure along the tutorial we will create the folders that the compilation process would create. By doing this, we will have our Node executable in the same place (/opt/iri/target) whether we compile or download the already compiled IRI version.
root@vmi152766:/opt# git clone https://github.com/iotaledger/iri
root@vmi152766:/opt# cd iri
root@vmi152766:/opt/iri# mkdir target
root@vmi152766:/opt/iri# cd target
root@vmi152766:/opt/iri/target# wget https://github.com/iotaledger/iri/releases/download/v1.4.2.1/iri-1.4.2.1.jar
If everything went fine, we should be able to run our node to test it. We still have no neighbors so we will just try starting it up to see if we are fine and then we will stop it with ctrl + c.
root@vmi152766:/opt/iri# cd target
root@vmi152766:/opt/iri/target# java -jar iri-1.4.2.1.jar -p 14265

Because we will need to pass some arguments to the IRI (such as the port in the example), we will create a configuration file and place all the parameters in there. Once we have our config, we will be able to run the node only passing that config file as argument. Let’s create a config file called
iri.ini inside the target folder and place in there the values we will need to have. We will be using nano, a command line based text editor. All you need to know is that you can create a new file by typing
nano newfile.txt. To save the file contents you do
ctrl + o. To exit the file and get back to the terminal you hit
ctrl + x.
root@vmi152766:/opt/iri/target# nano iri.ini
Lets see a little what we are going to include in this file.
[IRI]
PORT = 14265
UDP_RECEIVER_PORT = 14600
TCP_RECEIVER_PORT = 15600
NEIGHBORS = udp://neighbor-1:14600 udp://neighbor-2:14600
IXI_DIR = ixi
HEADLESS = true
DEBUG = true
DB_PATH = mainnetdb
API_HOST = 173.212.193.00
Note that in here you must list your neighbors. In order to have a fully working node you need to exchange your full node address with other users (called neighbors). Only once you add a neighboar to the list and that neighbor do the same with your node, you have a valid pair. It’s very important to have stable dedicated neighbors if you want your Full Node to sync and work properly. So it’s a two way process. You can look for neighbors in the #nodesharing Slack channel.
Neighbors
According to Come From Beyond, it’s better to have 3 or 4 neighbors working fine that a lot that wont run their nodes 24/7. The maximum number of neighbors should be 7. So go to the #nodesharing slack channel and start seeking for neighbors. They will give you their address (
udp://143.22.33.43:14600, for instance) and you will have to give them yours (which is
udp://173.212.193.00:14600)
Everytime you need to add a new neighbor you must stop your Full Node, edit the iri.ini, add the address leaving a space between addresses, save the file (ctrl + o) and exit (ctrl + x). Finally you restart your node .
Once you have your config file ready, you just start the Full Node again with the command used before and the -c iri.ini as only argument. This will run your node using all the settings described in that config file. If your neighbors are working fine you will eventually start getting some data.
root@vmi152766:/opt/iri/target# java -jar iri-1.4.2.1.jar -c iri.ini
Checking your node’s API endpoint
Before you proceed installing some Graphic tool to monitor your and yours neighbors nodes, you should permorm a test to see if your running node has a reachable API. This can be done by using curl as described in the
IRI API Reference Guide. My node IP is
173.212.193.00 so, its API should be reachable at
http://173.212.193.00:14265. In order to check this we will run this Curl command in the terminal.
curl http://173.212.193.00:14265 \
-X POST \
-H 'Content-Type: application/json' \
-H 'X-IOTA-API-Version: 1' \
-d '{"command": "getNodeInfo"}'
If everything went fine we should get a response of this type.
Setting up a Graphic Interface to control your Full NodeSo far we have our node running and we can see the data as it goes down in the terminal. This is not very practical, specially if you wanna have an overview of how your neighbors nodes are working and how is your sync doing. In order to have a tool that makes all this easy we will install
iota-pm. This node.js tool will give us a public point to access our Full Node via our browser.
Lets install Curl, node.js and nmp in order to get this wonderfull tool working.
root@vmi152766:/opt# apt install curl
root@vmi152766:/opt# curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -
root@vmi152766:/opt# apt install nodejs
root@vmi152766:/opt# npm i -g iota-pm
And that’s all! Now, we have our Peer Manager installed. In order to start it and be able to see our dashboard from the browser we must use the following command.
root@vmi152766:/opt# iota-pm -i http://173.212.193.00:14265 -p 127.0.0.1:12000
Once the command is running you can just to your browser and point to
http://127.0.0.1:12000 to see a nicely designed dashboard. Notice that we are using the port 12000 but you could use a different one as long as it's free.
Get your node synced fast!
If you start your Full Node and your IOTA Peer Manager you will see that the values
Latest Milestone Index and
Latest Solid Milestone Index are not the same. This means that your node is not yet synced and, therefore, is not good to use (with your wallet, for instance) yet. If you just let the node running this two values will eventually catchup. Because you might have to wait for a long time to get this done, there is a quick solution: you can download a 30 minutes old image of the Tangle database and start the sync from there. That should allow you to get a synced node in some hours at most.
To do this you will have to delete exsting database, download a 30 minutes old image and place it in your node database folder. Long story short:
root@vmi152766:/opt/iri/target# rm -rf mainnetdb/*
root@vmi152766:/opt/iri/target# wget -P /tmp/ http://db.iota.partners/IOTA.partners-mainnetdb.tar.gz
root@vmi152766:/op/iri/targett# tar xfvz /tmp/IOTA.partners-mainnetdb.tar.gz -C /opt/iri/target/mainnetdb
Because you already started your node but now you have deleted its database to change it with a newer version, you will need to stop and restart to node. But before doing that, there is
an aditional configuration value we must add to our iri.ini file called
DB_RESCAN = true. This param will force our node to clear all database data and rescan from the beginning (which we want since we have a new database image only behind in sync by 30 minutes). So let's edit our iri.ini to add this last param.
[IRI]
PORT = 14265
UDP_RECEIVER_PORT = 14600
TCP_RECEIVER_PORT = 15600
NEIGHBORS = udp://tu-neighbor-1:14600 udp://tu-neighbor-2:14600
IXI_DIR = ixi
HEADLESS = true
DEBUG = true
DB_PATH = mainnetdb
API_HOST= 173.212.193.00
DB_RESCAN = true
And now let's restart the IRI with the usual command. Note that at this stage we dont have a method to start and stop the IRI as a service so we need to find out our node PID (see the las image of this tutorial regarding ps ax) and send a kill signal. Lets assume we do a ps ax and our PID is 10123, so we should do the following to stop the IRI (kill -9).
root@vmi152766:/opt/iri/target# kill -9 10123
root@vmi152766:/opt/iri/target# java -jar iri-1.4.2.1.jar -p 14265
Note: I know this is not the way. We will add some code to manage this with systemctl soon (there is even some code in the comments if you wanna try).
Final considerations
Full Nodes are useful for helping IOTA network to get stronger only if they are running 24/7, in good shape and with neighbors performing reasonable fine. Add some neighbors to see how good they are doing and clean your neighbors list to only keep the ones that are almost up and have good permormance.
When you start running your node, you will have to go though the get in sync process. This can take hours or days depending on your node performance and your neighbors health as well. If you are deleting addresses from your neighbor config section, let them know so they can also remove you.
Sometimes is best to run the Node and iota-pm commands as background tasks, so you can close your terminal without interrupting them. This can be achieved by using nohup and the ampersand at the end. For example:
root@vmi152766:/opt/iri/target# nohup java -jar iri-1.4.2.1.jar -c iri.ini &
root@vmi152766:/opt# nohup iota-pm -i http://173.212.193.00:14265 -p 127.0.0.1:12000 &
Finally, you can easily check if your iri and iota-pm are running by using the
ps ax command, which lists all the processes running at the time in the machine.
Source: http://www.iotahispano.com/setting-up-a-vps-iota-full-node-from-scratch/iota-pm