Deploying a Mysterium VPN Node with Vultr in one command

What is Mysterium?

Mysterium is a decentralized VPN powered by Blockchain. It’s an Open Sourced Network allowing anyone to rent their unused Network traffic, while providing a secure connection for those in need.

Mysterium is currently undergoing an open TestNet where anyone with the necessary software can set up a Node within the network to act as an endpoint for users traffic. You can see stats of the current TestNet here. This shows the current status of Nodes on the network, where they are based, and how much traffic the network is pushing.

What is Vultr?

Vultr is a cloud hosting platform that allows you to create Linux Virtual Machines, Bare Metal and Dedicated instances. Not only can you create virtual machines in minutes all around the world, you can automate it!

This is the latest installment of my cloud automation series where I show how to deploy Mysterium Nodes on various cloud infrastructures. I have covered Linode and DigitalOcean so far, with Azure, AWS and GCE next.

This guide will show you how to deploy a Mysterium Node on Vultr all with one command.

Deploying a Vultr Mysterium Node

Does the sound of deploying nodes in 15 locations around the world sound enticing? Well below we will run though the steps to do so!

Requirements:

  • A Vultr Account
  • Vultr CLI
  • My Mysterium Node startup script
  • This command “vultr server create -n [Node Label] -r [Region Number] -p [Server Type] -o 215 -s [Script ID]”

Account and API Setup

First step is creating an account with Vultr. Signup is quick and should take a few minutes.

Now to retrieve your API Key. This allows the Vultr CLI to connect to your account and create your Mysterium Node(s). Once your account is created go to this location in your account setting and create a new API key.

Select Enable API and you will be displayed your API Key. It will also whitelist your public IP address for accessing your API key for you under Access Control. You can also select Allow All IPv4 so it does not do IP verification. You can also manually add what IP addresses are allowed to use your API Key.

Once you have signed up and made an API key it is now time to install the Vultr CLI. Vultr CLI is a CLI program that allows you to interact with the Vultr API from your terminal. It works on Windows, Linux, and macOS.

Adding the Mysterium Node startup script

To make use of automated deployment in Vultr you need to manually add your startup script to you account, which you can then call when you create a new instance, which we will be doing.

Firstly, navigate to the following section within your Vultr account and select Add Startup Script.

It will take you to a form where you can enter the name of your script (it can be anything), the type and then the actual script itself. Below is an example of what yours should look like when completed.

Vultr Startup Script for Mysterium Node

Enter the following code in the Script section:

#!/bin/bash
# Initial updates
apt update
apt upgrade -y
DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
# Create mysterium-node firewall rules
sysctl -w net.ipv4.ip_forward=1
iptables -P FORWARD ACCEPT
# Install Docker
apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
apt update
apt-cache policy docker-ce
apt install docker-ce -y
# Pull mysterium-node image and create mysterium-node container
docker pull mysteriumnetwork/mysterium-node
docker run --cap-add NET_ADMIN --net host --publish "1194:1194" --name mysterium-node -d mysteriumnetwork/mysterium-node --agreed-terms-and-conditions
# Final update of packages
apt update
apt upgrade -y

Once that is done click Add Script. You now have have created your startup script to automatically configure Mysterium Nodes. Once you click add, the page will refresh and your address bar will update with a new URL. In the URL at the end there is a section that has the following:

SCRIPTID=327635

This is your script ID and is needed for using from the Vultr CLI. Make a note of this number and save it for later.

The Vultr Mysterium Node Command

This section will run through the command used, what the sections mean, and how you can customize it.

Below is an outline of the command we will run, with the four sections where you can choose your own parameters, if you want.

vultr server create -n [Node Label] -r [Region Number] -p [Server Type] -o 215 -s [Script ID]

The four parameters are as follows:

[Node Label]— This is very straightforward, this is the name you want your VM to be called, it can be anything you want.

[Region Number] — This is what region, or data center you want your Vultr VM to reside in. The available region types and their corresponding API DCIDs are below:

Available Vultr Regions

[Server Type] — This is the VPSPLANID of the size of server you want. The more powerful and larger the server, the more expensive it is. The available server types are below:

Vultr Plans

[Script ID] — This is the ID of the startup script created earlier.

Example Script:

vultr server create -n MysteriumNode -r 9 -p 201 -o 215 -s 326979

This command creates a Vultr Ubuntu 16.04 1GB VM called MysteriumNode, in Frankfurt, and uses the startup script added to your account. This startup script updates the new VM, configures the firewall, installs docker, then deploys the Mysterium Node container.

It will ask you for your API key, then deploy the node for you. The whole process from running the Vultr CLI command to having your fully configured and working Mysterium Node should be around 7 minutes.

You can then SSH onto your Vultr VM with the details provided from your server overview for your new VM. You can then run the following command to find your Node ID.

docker logs -f mysterium-node

You will be able to see your Mysterium Node appear on the network by visiting the following link.

Important Further Configuration

The Vultr VM created using this method has very basic security and account configuration completed.

IT IS STRONGLY RECOMMENDED YOU RUN THROUGH THE STEPS IN THE BELOW GUIDE:

Initial Server Setup with Ubuntu 16.04

I will be looking to update the startup script so it automates the majority of these steps for you, in the future.

Need more help?

If you need more help with specifics to running a Mysterium Node, there is a wiki with common issues on the Mysterium Github, located here.

You can also join our Telegram community for help from our community!

Telegram

Links

Please be sure to follow and subscribe to the following:

Website — https://mysterium.network
Twitter — https://twitter.com/MysteriumNet
Medium — https://medium.com/mysterium-network
Reddit — https://www.reddit.com/r/MysteriumNetwork
Facebook — https://www.facebook.com/MysteriumNet
Slack — https://mysterium-network.slack.com
Bitcointalk — https://bitcointalk.org/index.php?topic=1895626.0
Steemit — https://steemit.com/@mysteriumnetwork
YouTube-https://www.youtube.com/channel/UCBxzWnZEHvuj-nfP00YImHQ
GitHub — https://github.com/MysteriumNetwork
Newsletter — http://www.subscribepage.com/MysteriumNetwork
Whitepaper — https://mysterium.network/whitepaper.pdf

Telegram:

English — https://t.me/Mysterium_Network
Rules & FAQ — https://t.me/MysteriumRulesAndFAQ
Announcements — https://t.me/MysteriumOfficialAnnouncements
中文 / Chinese — https://t.me/MysteriumChineseChat
Español / Spanish — https://t.me/mysterium_network_espanol