Server Setup

Earn money using the idle power of your VPS or dedicated server

by , , revisited on


Reached optimization nirvana? Proceed.

So you’ve been an owner of a website and using VPS or dedicated server to host it. The traffic is flowing, users are enjoying your fast website. You’ve super optimized it by leveraging The Citrus Stack. There are numerous caches empowering your website now. But it’s somewhat sad seeing this powerful server of yours doing mostly nothing, thanks to Varnish Cache…

So what’s next?

I’ll share with you how to generate easy passive income by using your server’s idle CPU power. You may be procrastinating or working at your actual job, but your server can dig bucks for you, 24/7.

Sounds interesting?

Monero

The cryptocurrency hype has been all over the Internet for past few years. And with the arrival of Monero cryptocurrency and its adoption throughout the web, things are more interesting for server owners. Monero is designed for CPU mining, which means you can easily generate Monero coins by simply running miner software. Monero is convertible to USD via a multitude of online exchangers.

You can have your server generate Monero coins, and it can do so by using idle server power and not affecting primary server’s function – web hosting.

For folks who are unfamiliar with cryptocurrencies

You can treat Monero as just another foreign currency you own. Treat it as such and it makes for easy understanding of how to work with it.

As all things money, we need:

  • A wallet, to hold the coins
  • A job or a business that will earn the coins
  • A bit of wisdom to spend the money wisely 🙂

The Wallet

Getting Monero wallet is easy through MyMonero.
Simply visit the site, then click Create Account.

On the next page, you’ll see some cautionary text, basically asking you to keep things secure and to save your private key. This is quite important.
The private key is what you use to login to your wallet later. It is a lengthy text with random words, e.g.:

smuggled daft soothe soothe library hashing ripped rotate emulate apricot agony basin smuggled

So make sure to save it somewhere safe. Then copy paste it in the confirmation field and click I've written down my private Login key, log me in!.

Now you’re in your Monero wallet. It holds no value as the balance is 0 XMR (the XMR is the currency code for Monero by the way).

Copy your Monero address from that page, e.g.: 4ACMQiwMBffBpF4ko6RgkEgYou2RYZD2DYNegPu7G4b2Co1BpmMBtQaBrQMoS5jEAPFxxM9gJ9YazHyZamXQ7sX8Fc1ksNA.

We’re going to use it in the next step, to receive Monero from our server’s mining efforts.

The mining

Choose a mining pool

Here’s some yada-yada. You can skip this section, but may want to try understand it:

For any real-world money making you need two things: the tools (skills, machines, etc.) and a location to apply them. Nothing is different in the cryptocurrencies world.

In the world of cryptocurrencies, the location is mining pools. A mining pool is a third party server which will be sending out tasks for your server to process. Upon completion of a task, your wallet will receive coins. So the tool is the processing power of your server.

So let’s choose the mining pool. I recommend HashVault. We’ll use it in the configuration below (you don’t need to visit it or register there as registration is done automatically by your mining software).

Mining software

Next, we’re approaching the golden part. Having your server generate Monero coins. You can do this by using xmrig mining software. Usually installing it takes time to compile, but with CentOS things are easy.

Install in CentOS 6

yum -y install https://extras.getpagespeed.com/release-el6-latest.rpm
yum -y install xmrig

Install in CentOS 7

yum -y install https://extras.getpagespeed.com/release-el7-latest.rpm
yum -y install xmrig

Configure the miner

You configure the miner software by telling it where to mine (pool location) and your wallet address (where generated coins will go to once reached minimum payout threshold of the pool). Create file /etc/xmrig.json and put the following contents:

{
    "algo": "cryptonight",  
    "av": 0,               
    "background": true,   
    "colors": false,        
    "cpu-affinity": null,   
    "cpu-priority": 0,      // set process priority (0 idle, 2 normal to 5 highest)
    "donate-level": 0,      // donate level
    "log-file": null,       
    "max-cpu-usage": 15,    // maximum CPU usage for automatic mode
    "print-time": 60,       
    "retries": 5,           
    "retry-pause": 5,       
    "safe": false,         
    "syslog": false,        
    "threads": null,        
    "pools": [
        {
            "url": "pool.monero.hashvault.pro:80", 
            "user": "put-your-monero-wallet-address-here", 
            "pass": "mycoolminer:user@gmail.com", 
            "keepalive": true,                 
            "nicehash": false                 
        },
    ],
    "api": {
        "port": 0,                            
        "access-token": null,                 
        "worker-id": null                    
    }
}

Obviously, you need to replace:

  • put-your-monero-wallet-address-here with your actual Monero wallet
  • user@gmail.com with your actual email address

You can also optionally change mycoolminer to anything else you like – this is going to be used as some sort of server identification, in case you mine from many servers at once.

Start mining

CentOS 6

service xmrig on
service xmrig start

CentOS 7

systemctl enable xmrig
systemctl start xmrig

Now the mining process begins and the coins, once generated will accrue to your pool’s due amount.

You can log in to the pool’s dashboard by providing the following credentials:

Username: your Monero wallet address
Password: mycoolminer:user@gmail.com

This will allow you to check the coins generation process.

Upon reaching payment threshold of 0.03 XMR, the coins are automatically sent to your MyMonero wallet address.

Simple and automated passive income achieved 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.