I want to mine Monero on my dedicated Linux server with xmr-stak-cpu because my websites never use all of the CPU and I want some extra incomes that help me pay the service.

Are there any security risks for my server and websites by doing this? At what do I need to pay attention?

I have never mined cryptocurrency, so I don't know how the entire process works.

  • Are you asking about security risks due to an attacker compromising monerod or your pool client, OR are you asking if the resources required by the miner are going to compromise the stability/performance of your website? Jan 2, 2018 at 12:30
  • I don't care about performance/stability, this is under my control. I care about the security of my customers and my server of course.
    – user4980
    Jan 2, 2018 at 16:31

1 Answer 1


There would be no inherit security risk with mining on your dedicated server. As with all daemons, though, you would want to make sure to run it as an unprivileged (non-root) user just as a best practice.

Since you mention the server is normally doing other things (hosting websites) you could minimize its impact by running it the lowest priority possible (a 'nice' value of 19). If you do that, it should effectively only utilize idle cpu cycles and not noticeably impact the performance of other processes. Doing this is as simple as running:

nice -19 ./xmr-stak-cpu

Some important notes...

  • Keep in mind that your processor(s) will be running at 100% usage 24/7 no matter what's going on. This effectively kills the usefulness of any sort of CPU metrics software and other performance monitoring software.

  • If you provide service to paying customers, note that they will be able to easily see the system is at 100% cpu usage through multiple means (SSH, PHP scripts, hosting control panel, etc). They may not take kindly to this fact and feel you are not providing the service they're paying for. Some users may suspect your server is compromised if they see a miner process in the process list. This is because it is common for malicious users to compromise hosting accounts and run a monero or other cryptonight based coin miner on the server. I imagine there's a debate to be had on the ethics of mining on a production hosting server with paying clients.

  • It will be much harder to identify if/when another user on the system is using excessive CPU since your system will always be at 100% CPU usage, unless you write some custom script that subtracts the relative usage of the miner from the rest of the system's usage. Even then, it's going to be unreliable.

  • Even if you ONLY ran the miner on your server and didn't host websites or anything else, you're probably looking at between 200-250H/ max (for a Quad-Core single CPU dedicated server). At the current network difficulty, a sustained 250H/s is going to net you about 0.05 XMR per month (I used cryptocompare.com's calculator to estimate). A common minimum payout for current Monero mining pools is about 0.3 XMR. So you are looking at 6 months mining before you get your first 0.3 XMR. Coin emission only slows and difficulty only goes up as time goes on, so the reality of it is probably longer than 6 months. If your server is somewhat busy and the miner runs at less H/s, then that time only gets longer.

In the end, only you can decide if it's "worth it". But, it's by no means an ideal or lucrative situation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.