Install xmr-node-proxy on a Ubuntu 16.04 VPS

Complete guide to install and configure xmr-node-proxy on a Ubuntu 16.04 VPS

xmr-node-proxy is really useful if you’re mining Monero with 10 or more miners. It merges all miners into one and appears to pool as a single miner. This decreases load and bandwidth to the pool. Today I’ll show you how to install xmr-node-proxy on a VPS.

But what’s in it for you as a miner? Well it depend on how many miners you have. xmr-node-proxy works best with 10+ miners. It makes the management really easy. Imagine if you want to change your Monero address and you have like 20 -30 miners. With xmr-node-proxy, you just need to update it on your proxy. Also it allows you to make the most out of your low hashrate miners. I won’t get into much details. Instead I’ll focus on the topic of this tutorial.

Requirements to Install xmr-node-proxy on a VPS

You’ll need Ubuntu 16.04 server with 1GB or more RAM. A 1GB RAM VPS from my recommended VPS providers costs $5/Mo. And that’s pretty much everything you need.

freelancer to install xmr-node-proxy Not a tech guy? Rather have a freelancer install xmr-node-proxy for you? Who’s better than the guy who wrote this tutorial!
Hire me and have your XNP ready within 24 hours!
Get xmr-node-proxy Installed

Prepare VPS for xmr-node-proxy

Once you have a VPS ready with you, there are few things you need to do to make sure xmr-node-proxy runs smoothly on it. We’ll start by updating apt cache,

apt update
apt upgrade
Create a regular user with sudo permissions

xmr-node-proxy should run under a regular user. But the installation script we’re going to run shortly requires root permissions. So we’ll create a new user with sudo access. We’ll call it vpsfix.

adduser vpsfix

You’ll be prompt to set a password and enter few more details about the user. Password is a must, others can be ignored. Next we’ll add vpsfix to the sudoers list.

echo "vpsfix ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
Create swap space

Also called virtual memory. Xmr-node-proxy uses very little server resources. But the installation script eats up lot of RAM. So we’ll configure 512 MB of virtual memory on our system.

dd if=/dev/zero of=/swapfile bs=1M count=512
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile none swap defaults 0 0" >> /etc/fstab
Configure ulimits

Most 1GB RAM servers come with nofile value set to 1024. This is the maximum number of open files per user. You can check the current limit with following command.

ulimit -n

We will increase this value to 9000. Open limits.conf file with nano text editor.

nano /etc/security/limits.conf

Add following two lines to the bottom of that file,

vpsfix  soft  nofile 9000
vpsfix  hard  nofile 65000

Close the file by hitting Ctrl+X on your keyboard. Now open common-session file,

nano /etc/pam.d/common-session

Add following line towards the end,

session required pam_limits.so

Save and close with Ctrl+X. That concludes the VPS preparation. Do a quick reboot with following command and log back into your VPS with vpsfix account when it comes back online.

reboot

Install xmr-node-proxy on Ubuntu 16.04 VPS

Original author of xmr-node-proxy, Snipa22 seems to have abandoned the development. But there’s a fork by MoneroOcean who’s actively working on it. So we’ll use MoneroOcean’s xmr-node-proxy fork instead.

We’ll use official bash script to install xmr-node-proxy on VPS. Logged into VPS as vpsfix, run following command,

curl -L https://raw.githubusercontent.com/MoneroOcean/xmr-node-proxy/master/install.sh | bash

This script will install node.js and other necessary components with xmr-node-proxy on your VPS.

Next up is to configure xmr-node-proxy. I’m not getting in to that on this tutorial. You can refer to official wiki until I come up with a tutorial. Before you do any configuration, you should copy config_example.json file to config.json. Following command should do it.

cp xmr-node-proxy/config_example.json xmr-node-proxy/config.json

Now open config.json,

nano xmr-node-proxy/config.json

Make the changes to that file as needed. Next, activate NVM.

source ~/.bashrc

Start the proxy,

cd ~/xmr-node-proxy/
pm2 start proxy.js --name=proxy --log-date-format="YYYY-MM-DD HH:mm Z"
pm2 save

That’s it. You can now point your miners to your proxy instead of pool. You can check the status of your proxy with PM2 monitor. Following command will launch it.

pm2 monit

Happy mining!!

Tags
Show More

Tharindu

Hey!! I'm Tharindu. I'm from Sri Lanka. I'm a part time freelancer and this is my blog where I write about everything I think might be useful to readers. If you read a tutorial here and want to hire me, contact me here.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button

We use cookies to give you the best online experience. By agreeing you accept the use of cookies in accordance with our cookie policy.

Close