Deploying a Mysterium VPN Node with Microsoft Azure in two commands

Yteyi
Mysterium Network
Published in
5 min readAug 25, 2018

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 Microsoft Azure?

Azure is Microsoft’s answer to a cloud hosting platform that allows you to create Linux Virtual Machines. It allows you to create a wide range of Virtual machines all around the world.

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, DigitalOcean and Vultr so far, with AWS and Google Cloud next.

This guide will show you how to deploy a Mysterium Node on Azure all with two commands.

Deploying an Azure Mysterium Node

We’re upping the ante with Azure by being able to deploy a Mysterium Node in up to 140 countries!

Requirements:

  • An Azure Account
  • Azure CLI
  • My Mysterium Node configuration file
  • These two commands “az group create — name [Resource Name] — location [Region Name]” and “az vm create — resource-group [Resource Name] — name [Node Name] — image Canonical:UbuntuServer:16.04-LTS:latest — size [VM Size] — custom-data AZureMysteriumConfig.yml”

Account and API Setup

First step is creating an account with Azure. Signup can take a little while so be patient.

Due to how Azure CLI authenticates, you do not need to retrieve or add an API key, it authenticates via opening a web portal where you login with your account details. Swish!

Once you have signed up it is time to install the Azure CLI. Azure CLI is a tool that allows you to interact with the Azure cloud network from your terminal. It works on Windows, Linux, and macOS.

AzureMysteriumConfig cloud-config script

Azure allows you to have custom scripts run upon creation of new Virtual Machines, this is called cloud-init scripts. For this guide I will be providing the configuration script below. When you run the az command in the example you can point it to the location of the .yml script created.

#cloud-config
package_update: true
package_upgrade: true
runcmd:
- sysctl -w net.ipv4.ip_forward=1
- iptables -P FORWARD ACCEPT
- 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
- 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

Copy this text and save it to a file called AZMysteriumConfig.yml in a convenient location.

The Azure Mysterium Node Commands

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

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

Due to how Azure works you need to first create a Resource Group which is where you chose the location of the server, then you deploy the server within that resource group. So not a single command like the other tutorials but just as easy!

az group create --name [Resource Name] --location [Region Name]

This command creates the resource group for you to then place Virtual Machines within it.

az vm create --resource-group [Resource Name] --name [Node Name] --image Canonical:UbuntuServer:16.04-LTS:latest --size [VM Size] --custom-data AzureMysteriumConfig.yml

This command actually creates the server within the resource group created above. Below we will be explaining what all the parts of both commands mean.

The two commands in detail:

[Resource Name] — This is the name you want your resource group to be called, it can be whatever you want and is just there for making it easier to organize multiple servers if you have them.

[Region Name] — This is what region, or data center you want your Azure VM to reside in. The available region types can be retrieved with the following command: az account list-locations. The “name” value is the one needed.

Example of an Azure region

[Node Name] — Another simple one, this is what you want your VM to be called.

[VM Size] — This is where you set the option of how big your VM is. A general list of Vm sizes and specs is located here.

Example Command:

az group create --name MysteriumGroup --location canadacentral

This command creates a resource group called Mysterium in the central Canada location.

az vm create --resource-group MysteriumGroup --name Mysterium --image Canonical:UbuntuServer:16.04-LTS:latest --size Standard_B1s --custom-data AzureMysteriumConfig.yml

This command creates a VM in the Mysterium resource group created in the previous command, named Mysterium. It is a Ubuntu 16.04 VM and is the size of “Standard_B1s”, which has 1CPU, 1GB of RAM, 4GB SSD and a 10MB/s connection. Only small but should do the trick, and only costs $10 a month. Do note though that due to Azure being a more enterprise platform, expect to pay more money compared to other providers.

You can then SSH onto your Azure VM with the details provided from your account 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 Azure 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:

Englishhttps://t.me/Mysterium_Network
Rules & FAQhttps://t.me/MysteriumRulesAndFAQ
Announcementshttps://t.me/MysteriumOfficialAnnouncements
中文 / Chinese https://t.me/MysteriumChineseChat
Español / Spanishhttps://t.me/mysterium_network_espanol

--

--