Easiest way to start CPU mining on DigitalOcean, AWS, Google Cloud in under one minute
So, you have probably read a dozen articles or seen a handful of clips on Youtube about how to use DigitalOcean / Amazon AWS / Google Cloud / Azure / PaperSpace or some other cloud server to mine bitcoins (or some other cryptocurrency coins) and you probably already know it’s not profitable. I know that too but still I wanted to experiment with that a bit 🙂
Many cloud providers do not allow mining on their computers since these are mostly distributed systems so they aren’t happy when some user is using a resource at full power all the time. So, once they find out that someone is mining on their hardware they usually shut these servers down or even close accounts (rarely, but it can happen!) Finding that someone is using their hardware for mining is also quite easy since the CPU will be running at 100% all the time. So it will stand out from normal usage that’s probably nowhere close to that.
Also, mining Bitcoins with CPU today is not even theoretically possible now so don’t waste your time with that. On the other side there are some alternative crypto currencies that are made to be mined only with CPU and most of these use cryptonote algorithm. If you’re going to be mining with the CPU – then simply mine these. Currently, Bytecoin, Monero and Dashcoin are the most popular. For the purpose of this post I’ll use Bytecoin (BCN).
This experiment has two goals: first one is to install everything and start mining with just one command and second is to try and limit the CPU usage so and try and stay under the radar…
To install all required software and start with the mining process all you need to do is to just copy/paste and execute this single command in Ubuntu Linux shell:
apt-get update && wget https://minergate.com/download/deb-cli -O minergate-cli.deb && sudo dpkg -i minergate-cli.deb && minergate-cli -user firstname.lastname@example.org -bcn 1
This will download all required software and start with the CPU mining process. The pool used is MinerGate so if you want to take credit for the mining just register your account there and replace your email with mine in the code above.
In case you reboot a server or simply stop the mining, all you need to restart it is to execute this command:
minergate-cli -user email@example.com -bcn 1
CPU mining without any limitations with the basic $5/month DigitalOcean droplet gives about 40 H/s
Now as you can see in screenshots above your CPU usage will be around 100% all the time. Cloud providers can easily spot this kind of behavior and terminate your cloud/vps or even your account (you have been warned for the second time!) So, one possible solution to this problem is to lower the percentage of which the CPU will be used. This will lower the hash power and the returns (we’re not profitable anyways so who cares) but it may allow you to mine longer like this. (This is just an assumption. I haven’t tested this in practice! If you’re doing a such thing it’s your own responsibility for everything that can happen!)
This can be done by installing and using cpulimit, a tool that can limit the amount of CPU usage that some process can use. For the purpose of this experiment we’ll just limit the miner to use 50% of the CPU and to try and stay under the radar. Here’s the command that will automatically install everything needed and start mining with 50% of the CPU power:
apt-get update && apt-get install cpulimit -y && wget https://minergate.com/download/deb-cli -O minergate-cli.deb && sudo dpkg -i minergate-cli.deb && cpulimit -l 50 – – minergate-cli -user firstname.lastname@example.org -bcn 1
In case you need to restart the miner or you want the change the CPU usage limit (-l 50 translates to limit to 50% so you can just change that number) just use the code below:
cpulimit -l 50 – – minergate-cli -user email@example.com -bcn 1
Once with the cpulimit in place to 50% of the available cpu power, our has rate has also lowered in half:
Who can benefit from this: probably no one but it was fun.
Disclamer: Use this information at your own risk. I haven’t used this longer than one or two hours just for testing and for writing this article.
Update Feb 14th 2018:
The miner I used in my original post is no longer available at GitHub, so I have updated this post to use pre-compiled Minergate CLI miner that works and is easy to use.