Published: 6 years ago

How to mine Primecoin (XPM) in the cloud

Today’s buzz is all about Bitcoin reaching $1,000 with people all over the internet crying about not jumping on the opportunity when it was early enough.

A few days ago, after discussing with some friends about alternative cryptocurrencies, I decided to see if it was feasible mining them in the cloud (on Digital Ocean) and making a profit from it. The reason I chose to go with alternative cryptocurrencies instead of going with Bitcoin, is that I believe at the moment it’s possible achieve a much higher ROI. They are still in their infancy and we can see some of them doubling their value in a matter of a couple of days as people is looking to alternative coins to invest.

For my experiment I picked Primecoin, since there was a enough documentation around, it’s still profitable to mine and it seems growing pretty quick. I also decided to mine with a pool called, since mining by yourself is much harder and this pool was very small-miners friendly.

As right now I see almost a 90% ROI with this setup.

Here’s a step-by-step guide on how to easily setup your cloud miner on Digital Ocean.

  1. Create an account on Digital Ocean (this link has my referral code)
  2. Create a Droplet. Select the 512MB / 1 CPU that only costs $5/mo (obviously bigger instances will mine faster but this is good for our experiment) and select Ubuntu 13.04 x64 as Image for the server.
  3. Once it has been created, you’ll receive an email containing instructions on how to connect to the server. Open the Terminal app and SSH into the server following the instructions in the email.
  4. Type the following commands in the Terminal (of course wait for them to be fully executed before typing the next one):

    sudo apt-get update
    sudo apt-get install yasm -y git make g++ build-essential libminiupnpc-dev
    sudo apt-get install -y libboost-all-dev libdb++-dev libgmp-dev libssl-dev dos2unix
    git clone
    sudo dd if=/dev/zero of=/swapfile bs=64M count=16
    sudo mkswap /swapfile
    sudo swapon /swapfile
    cd ~/primecoin/src
    make -f makefile.unix

    This last command is going to take a while to execute. Just be patient. Once done, you have the machine ready to mine.

  5. Before starting to mine, I decided I wanted to have my miner to automatically start in case it crashes or the server is restarted for any reason. To do that you need to follow the following steps:

    apt-get install supervisor
    mkdir -p /var/log/supervisor
    touch /etc/supervisor/conf.d/primecoin.conf
    nano /etc/supervisor/conf.d/primecoin.conf

    (this will open a terminal editor)

  6. Paste the following text into the editor, making sure to add your actual Primecoin address (that you can get by registering on BTC-E, click on finances and click on deposit next to Primecoin) instead of XXXXXXXXXXXXXXXXXXX:

    command=/root/primecoin/src/primeminer -pooluser=XXXXXXXXXXXXXXXXXXX -poolip= -poolport=1337 -genproclimit=1 -poolpassword=PASSWORD
  7. Press Ctrl + X to exit and save
  8. /etc/init.d/supervisor stop
    /etc/init.d/supervisor start

  9. Congrats, your are a miner now :) You can see your miner in action with the command
    tail -f /var/log/supervisor/primecoin.log

  10. You can later check your earnings with the mining pool visiting
    (make sure to replace XXXXXXXXXXXXXXXXXXX with your Primecoin address)

If you enjoyed this tutorial, feel free to donate to my beer fund :)
Donate Bitcoins

  • GB

    I have encountered an enigma. The first droplet that I created at minimal settings is averaging at over 400 pps while two subsequent droplets at the same settings perform at an average of 200 pps. All droplets were created on New York 2.

    • Davide Di Cillo

      It depends who else is using the actual hardware your droplet is on. I suggest you to try San Francisco or Amsterdam since it seems they are less crowded.

  • bitmining

    Hi, I am newbie, I was try this tutorial with another VPS with ubuntu 13.04×64, everything ok, but on this step :

    sudo mkswap /swapfile

    appear “did not find UIDxxx

    and I passed that step untill finish succesfully

    and this not fully work on

    tail: cannot open ‘/var/log/supervisor/primecoin.log’ for reading: No such file or directory Invalid address

    on my VPS that i used there is a driver like this, how to set it up

    Primecoin Miner 0.1.2-hp11

    • Davide Di Cillo

      That url is usually update once you submit the first successful chain you find.

  • Shane McLeod

    ive loaded 100$ into digital ocean mined xpm per the instructions and have a grand total of 12.31XPM for 100$ totally not worth it. that was the 4 core cpu x 5

    • Davide Di Cillo

      Surprisingly the most efficient machine to mine on Digital Ocean is the $5 on (cores and price don’t increase proportionally).

  • Dennis

    When i type

    tail -f /var/log/supervisor/primecoin.log… I get the error “cannot open for reading No such file or directory

    I have tried in root and in ~/primecoin/src/#

    What is going wrong?

    • Kevin

      I had this same problem, I solved it by changing the primecoin.conf file. Before it had “command=/root/primecoin/src/primeminer” change that to “command=/home/YOURUSERNAME/primecoin/src/primeminer”. Then stop and start the supervisor and it should work.

  • Sadrach Stramieri

    To monitor the use of the VPS.
    sudo apt-get install -y build-essential git screen htop
    When you want to see how the use of ram, Proc …
    $ htop
    F10 To exit

  • Daniel

    Can you mine from the DigitalOcean for yourself instead on pool?

    • Davide Di Cillo

      Yes, but things are different (and slightly more complex). Also it may not be as profitable.

  • Quadrapus

    I’m getting a maximum of 250 primes/s. What’s going on?

  • readyrmca

    Bad ass. I’ve never even seen a linux terminal or typed a single character into one, but followed the instructions and got it working on the first try with only one type mistake. You may want to add to the tutorial how to download and run PuTTy for people who don’t have linux or are new to linux and still running windows. This is my first try at linux and I’ll be slowly but surely leaving windows in the rearview thanks to you. I will def. donate to the fund as soon as I get my deposit to BTC-E completed. Thanks for everything!!!
    @readyrmca Follow me on twitter for daily buy and sell points for BTC. Amazing analysis and results recently!!

  • Mikhail Malyshev

    How did you get 400 PPS? I’me only have 160, which makes no sence to continue

    • edreamer

      I recently set up a new droplet and have similar results. I think it might just be luck of the draw. Depending on what physical server your VM is allocated to and how many people are sharing that hardware with VMs.

  • readyrmca

    I’ve now got two droplets configured and running I suppose. I’m also having issues with the
    tail -f /var/log/supervisor/primecoin.log command.

    When i log in to either one of my droplets and then try to run this it just sits there and does nothing, I am uisng puTTy for a terminal on a Windows 7 machine. I don’t know if this has any affect or not. Please let me know if I’m doing something wrong. I checked my primecoin address and I do have some found chains, so I think at least one of my droplets is working.

  • readyrmca

    I would also be really interested in knowing how to change this to mine in ypool. The interface is so much better and you can see which of your miners is connected at all times. Can I just re-do the command to open the termnal editor and overwrite the information that is in there and use the address in place of the ip. There is also a worker id and password associated with ypool. I’m wondering if the pooluser could be replaced with the worker name and then another command added for the worker password. If so what would that command be. I may be totally off and there may be a lot more to it than just that.

    • Davide Di Cillo

      For Ypool you need a different miner that performs better on Windows machines, so you’d would loose something as far as performances on Linux since it would run on a virtualized machine.

  • cryptocoin noob

    When I enter tail -f /var/log/supervisor/primecoin.log, all I get is:
    usage: /root/primecoin/src/primeminer -poolfee== -pooluser= -poolpassword=
    ***Xolominer – Primecoin Pool Miner v0.8 RC1
    ***by xolokram/TB – – glhf
    ***thx to Sunny King & mikaelh
    ***press CTRL+C to exit
    usage: /root/primecoin/src/primeminer -poolfee== -pooluser= -poolpassword=

    …and that’s all. I don’t know if it’s working. Is this normal? I don’t see anything working.

  • readyrmca

    Davide, Thanks so much for all your help with getting me started in this. I’ve been doing some more reading on this and I’m using the Putty app to input all my commands into my droplet and I was wondering “Do I have to keep these putty sessions open on my Windows machine to be mining” Also, what is the proper way to end one of these sessions?

  • usnoobx

    Why do you have to do all the programming? Why can’t you just download the miner on the vps as you would on your own CPU? Noob so just wondering

  • kyrian

    great tutorial! currently mining with 2 droplets with both around 250-300 pps (sfo + ams). looking good! :)

  • Pingback: 如何利用VPS在ypool矿池里挖Primecoin | 绳墨()

  • joshka

    Good post 😉

    I have created a 5$ droplet and I have this stats:

    [STATS] 2014-01-02 11:51:33 | 168 primes/s, 2688 tests/s, 60 5-chains/h, 0.006 chains/d
    [MASTER] work received
    [STATS] 2014-01-02 11:52:33 | 171 primes/s, 2745 tests/s, 60 5-chains/h, 0.005 chains/d
    [MASTER] work received
    [STATS] 2014-01-02 11:53:33 | 167 primes/s, 2630 tests/s, 60 5-chains/h, 0.006 chains/d
    [MASTER] work received
    [STATS] 2014-01-02 11:54:33 | 167 primes/s, 2668 tests/s, 0 5-chains/h, 0.006 chains/d

    Are they good?

    • zKyrii

      With these chains per day you are going to make less primecoins than you paid for the server
      Try hanging around the internet to find some solution

    • Davide Di Cillo

      They seems a bit low. I’d destroy the droplet and rebuild it (maybe trying a different location like San Francisco or Amsterdam).

  • zKyrii

    Dear Davide
    I know a local host VPS on my country that have 2 cores at 2.3GHz and costs only 100$ a year to use , but it only have 128mb of RAM . Could you share with me the quantity of RAM that you use to mine primecoin ?
    I know the server is good, but I’m affraid of paying and the RAM isn’t being that enough

    • Davide Di Cillo

      The RAM amount doesn’t matter much. I’d be curious to see the performance of that server.

      • zKyrii

        I use linux and i know SWAP works almost as well different from Windows.If it wasn’t Virtualization i could also install some kernel patches to make SWAP more efficient

        Thanks for sharing

  • Clipper Eagle Wing

    sudo dd if=/dev/zero of=/swapfile bs=64M count=16
    sudo mkswap /swapfile
    sudo swapon /swapfile

    What are the reasons for changing the swap file? I haven’t seen them in other guides. Does it make the minig faster or are there other reasons?


    • Davide Di Cillo

      On the $5 droplet you don’t have enough run to compile the miner and it would crash the server when you try to install it. This step isn’t needed for bigger droplets (but it won’t hurt either).

  • Duncan Armstrong

    So… One month in and I’m making a profit… just. It helps when Btc is strong (the recent crash from 1k to ><$700 didn't help. Again, you're not gonna make a lot from this, but as an experiment (and a "fire'n'forget" kinda thing) it's okay. Reckon i spent $8.50 and made $15.00 (keep an eye on your pps and destroy/remake droplets that are underperforming) ; such a shame it doesn't scale. zKyrii – you're in Brazil? Me too. Care to share info on your VPS host? Might be worth a try…

    • Davide Di Cillo

      That’s awesome! I’m actually writing a little app that can monitor multiple servers and eventually I’d like to get it to a point where it can turn on-off servers based on profitability.

      • Duncan Armstrong

        Cheers Davide – all credit to you for walking us through this. Good luck with the app – keep us posted

      • zKyrii

        I think that you can write a sheelscript that connects to the ssh via key ( no pass needed) , do a grep/tails command to check if the mining is ok, exit and go to the next server
        Just a suggestion

        • Davide Di Cillo

          Oh I’m already beyond that point. I built a rails app that pings all the servers with sshpass and store and display all the info returned.

    • zKyrii

      Eu tenho uns coupons da LocaWeb de 50%
      O cloud server mais barato deles e 411 reais anuais com o cupon fica 205, porém ele é de uso único e ganhei numa feira de tecnologia :s

      • Duncan Armstrong

        Obrigado zKyrii. Thought it might be locaweb – alas I have no coupons

  • Zlatych

    ***Xolominer – Primecoin Pool Miner v0.8 RC1
    ***by xolokram/TB – – glhf
    ***thx to Sunny King & mikaelh
    ***press CTRL+C to exit
    tail -f /var/log/supervisor/primecoin.log
    Is that good?

  • alex


    After following your very detailed instructions it seemed I finally managed to set up a working miner at digital ocean, but
    if i test the miner with tail -f /var/log/supervisor/prime.log

    i just see

    connecting to


    I see others had the same problem before.
    I just want to know how to stop the miner on the server to correct my wallet address that might be wrong? Or is it the only way to solve it that I delete the droplet and start everything from the beginning?

  • DannyBoy

    Hi, when I have typed this” tail -f /var/log/supervisor/primecoin.log” I got error “tail: cannot open ‘ /var/log/supervisor/primecoin.log ‘ for reading: No such file or directory I’m sure that I have put all correct details, please help

    • zKyrii

      It’s seen to be that you don’t have compiled the code ( the make part)
      Try doing this part again: cd ~/primecoin/src && make -f makefile.unix
      This should, but if you still having a error try deleting the droplet or creating a new one

  • cassiofg13

    To miner another coins on the cloud, it’s more dificult or is just about configuration?

  • Pingback: Learning by doing()

  • Bryan

    Thanks for the step by step. I’m rather new to this and seem to have things running. Not making much….pennies, but it was more to see it work before I invest in a system with some mining power. Great instructions for getting started!!!

    Will donate when my pennies turn to dollars!!!

    Thanks again.

  • Pingback: Primecoin – Showing coins coming in but not in the wallet? | WEB Server ip Reverse VPS hosting()

  • Prime

    After last comand I see

    “connecting to


    What could I have done wrong?

  • Romizta

    Hi Davide ! I found your tutorial really neat and helpfull ! I want to get into the Cryptocurrency world and I found your page when i was doing research about the cloud servers. I was wondering if you could help me set up couple CPUs to mine Primecoin or any other cryptocurrency.(I want to know what would be the more profitable), . I’m not rich but I would like to dedicate one of those if you can help me with that :). If you are interested please send me an email. Cheers Thank you, and sorry for my bad english. I guess as a mod you will be able to see my email :)

  • Blaw Paw

    Hey david! Im mining for two days now! i shoud be getting for about 0.03I havent seen any deposits in my wallet! when does this payments occur?

    • Alfred

      Payouts on beeeeer are executed when you hit 3XPM. So I guess you’ll have to mine a bit more to get there.

  • William Bowers

    could i have some help i am getting the followin after i have enter /etc/init.d/supervisor start

    Starting supervisor: Error: Format string ‘/var/log/super visor/%(proxc2xadgram_name)s.log’ for ‘stdout_logfile’ contains names which cannot be expanded

    For help, use /usr/bin/supervisord -h

    the rest of process is ok

  • Ben Berry

    Hey Chief,
    Thanks for putting this up. I got it running first time.
    But after a day it broke or my internet went down or putty freaked out or something. Now when I log back in I cant see if it is working. Ive tried to open the supervisor but it says it doesnt exist, nor does
    tail -f /var/log/supervisor/primecoin.log
    So im kinda stuck, I assumed it would keep going, but the info on my beeeeeeer page indicates nothing has happened in quite some time :-(
    Any ideas?

    • Ben Berry

      It looks like it is continuing to work without being logged into putty which is great :-)

  • Donchi

    Do it still works? I am new to this and want to start with 24 cores Server!

    • Ben Berry

      Yeh works fine for me. Whether it is economical or not is another matter… But it sure is fun 😀

      • Cammo

        Where do I input my number of cores? How it will know that it have to go with all 24 cores??? :)

  • Cammo

    Why are you deleting coments rather than help and answer them?

    • Cammo

      I just want to know if I start with 24 core processor where do I put in my cores? How do I make that server will mine with all 24 cores?

  • Tahir

    Im having trouble running the miner with only 256mb ram. After the “make -f makefile.unix” command I encounter an error 4? Has anyone experienced this? any solutions? Thank you

  • Pingback: pNut FTW Information | MiningPools()

  • HappyJohn

    I see on xpm.syware site i have already like 0,036 XPM. When I enter btc-e my wallet is totally empty. I checked twice. address on my droplets is exactly same like my btc-e wallet. Will i receive money or something is wrong ?Does it work well if i just use primecoin-qt instead btc-e virtual wallet?
    ANyway marvellous tutorial

    • Oran Bertelsen

      Same here. I have about 0.8 XPM but nothing in the BTC-E Wallet.
      Is there a minimum amount to transfer?

      • DJ Mordi

        Yes, you need 3.0 XPM before it will transfer.

  • coinster

    Great tutorial thanks! – I was hoping to use the same command line instructions to try with Vertcoin, I get the github package fine, all installed, but then no go when it comes to running the miner – I’m wondering if specific arguments differ (besides the obvious like pool ip and user pass)? Any help is appreciated.

  • Jarett LeBlang

    Be aware that, without my permission, DigitalOcean logged into all my servers recently and factory reset thereby wiping my primecoin configuration. I’m guessing they’re not happy bout it’s use for mining.

  • zipply

    I get to the end and then can’t run: tail -f /var/log/supervisor/primecoin.log

    I get the error that it cannot open : No such file or directory. I’m logged in as root – so is it running or not?

  • zipply

    Also tried running: ps aux | grep prime miner and I get this: root 11326 0.0 0.0 9392 896 pts/0 S+ …. does that mean it’s running?

  • Jarett LeBlang

    I got lazy and set up a shell script for installing and starting the primecoin setup the first time for when i had to rebuild Ubuntu 13.10 64 bit droplets. Here it is:

    apt-get update

    apt-get install yasm -y git make g++ build-essential libminiupnpc-dev

    apt-get install -y libboost-all-dev libdb++-dev libgmp-dev libssl-dev dos2unix python-meld3 python-support

    git clone

    dd if=/dev/zero of=/swapfile bs=64M count=16

    mkswap /swapfile

    swapon /swapfile

    cd ~/primecoin/src

    make -f makefile.unix

    apt-get install supervisor

    mkdir -p /var/log/supervisor

    touch /etc/supervisor/conf.d/primecoin.conf

    echo -e “[program:primecoin]ncommand=/root/primecoin/src/primeminer -pooluser= -poolip= -poolport=1337 -genproclimit=1 -poolpassword=nstdout_logfile=/var/log/supervisor/%(program_name)s.lognstderr_logfile=/var/log/supervisor/%(program_name)s.lognautorestart=true” > /etc/supervisor/conf.d/primecoin.conf

    /etc/init.d/supervisor stop

    /etc/init.d/supervisor start

    tail -f /var/log/supervisor/primecoin.log

  • Frem

    Once everything is ready can I close the the terminal.
    Or must remain open.

  • Yousef Baitalmal

    I keep getting this every single time

    root@ypool:~/primecoin/src# make -f makefile.unix

    make: makefile.unix: No such file or directory

    make: *** No rule to make target `makefile.unix’. Stop.

    Any ideas?

  • suman

    hi all, how much amount can we earn like if we mine using 10$/month digital ocean cpus? please help me out,i am new to crypto currencies and right now which cryptocurrency is best to mine

  • Jeroen Tuyn

    make -f makefile.unix does not work fore me, gives me this error: make: *** No rule to make target `makefile.unix’. Stop.

  • Andres Caicedo

    I cant get past “make -f makefile.unix” It says no rule to make target ‘makefile.unix’

  • nawab

    Can any one gude me to mine prime coin– make -f makefile.unix does not work fore me, gives me this error: make: *** No rule to make target `makefile.unix’. Stop.

Some HTML is OK