Bitcoin Forum
October 31, 2020, 05:31:55 AM *
News: Latest Bitcoin Core release: 0.20.0 [Torrent]
   Home   Help Search Login Register More  
Pages: [1]
Author Topic: Guide: How to run your own P2Pool in Ubuntu 16.04 LTS with merged mining  (Read 3431 times)
Full Member
Offline Offline

Activity: 196
Merit: 100

View Profile
May 17, 2017, 09:57:02 AM
Last edit: May 17, 2017, 04:24:25 PM by murdof

This is a guide on how to run P2Pool on Ubuntu 16.04 LTS Server with merged mining (emercoin)

17-May-2017: 1st version - Please report any issues

IMPORTANT SECURITY NOTE: If you are running your server on a VPS with full internet access make sure you change the rpcpassword or edit your config files and add rpcallowip=

Some history:
I created this guide to have up to date P2Pool installation instructions on latest version of Ubuntu LTS (currently 14.04).
People may consider it difficult to get a P2Pool node up and running but in fact it's very simple if you have some basic Linux knowledge.
In this guide I will provide BTC and merged mining.
Note that althought BTC mining is distributed among P2Pool miners, merged coins will not be distributed to others but you will solo mine those.
If you mine exclusively with P2Pool you will get the same profit (and a bit more) compared to mining to other pools. In the long run NMC/DVC/IXC profit will be the same.

Install Ubuntu 16.04 LTS Server from here:
(note do not install Ubuntu DESKTOP 16.04 LTS - you need Server version for text only install)

I will not cover instructions on how to do this. You can install it in a virtual machine or a physical machine.
For virtual machine start with 2 Processors and 4GB memory. Suggested disk size is 300GB (that's a lot but you will have room to grow).

Create a user and run all the commands as a user NOT as root.

If you find any mistakes please let me know!

First thing after you install ubuntu is to install all updates and prerequisites for Ubuntu:
sudo apt -y update
sudo apt -y install software-properties-common aptitude dialog
sudo add-apt-repository -y ppa:bitcoin/bitcoin
sudo apt-key adv --keyserver --recv B58C58F4
sudo add-apt-repository 'deb xenial emercoin'
sudo apt -y update
sudo apt -y install bitcoind emercoin screen python python-rrdtool python-pygame python-scipy python-twisted python-twisted-web python-imaging
sudo apt -y dist-upgrade

Grab P2Pool:
cd ~
sudo git clone git://

Setup Bitcoin config file:
mkdir ~/.bitcoin/
echo server=1 >~/.bitcoin/bitcoin.conf
echo daemon=1 >>~/.bitcoin/bitcoin.conf
echo rpcuser=bitcoin >>~/.bitcoin/bitcoin.conf
echo rpcpassword=h3wby4zWjGwywZ >>~/.bitcoin/bitcoin.conf
echo rpcallowip= >>~/.bitcoin/bitcoin.conf

About emercoin:
We have already emercoin binary already from official repo.
For each installation a random RPC password is generated so do a:
sudo cat /var/lib/emc/.emercoin/emercoin.conf
Find the line:

And hold on to this password.

Don't just copy paste the lines below.
Change the password after emccoinrpc to match your password you got above:
For example it should be: --merged http://emccoinrpc:PheIHyBs99yyTBgrQGa6mUMmmO8Tq3ht@

echo /usr/bin/bitcoind  >~/start-p2pool
echo sleep 200 >>~/start-p2pool
echo screen -d -m -S p2pool ~/p2pool/ bitcoin h3wby4zWjGwywZ --merged http://emccoinrpc:PheIHyBs99yyTBgrQGa6mUMmmO8Tq3ht@ >>~/start-p2pool
chmod +x start-p2pool

You are not ready to start P2Pool just yet. The BTC blockchain has to be downloaded first and it will take some time...
So execute these commands and wait...

Run this command to start P2Pool:
screen -d -m -S p2pool ~/p2pool/ bitcoin h3wby4zWjGwywZ --merged http://emccoinrpc:PheIHyBs99yyTBgrQGa6mUMmmO8Tq3ht@ >>~/start-p2pool

You can view the P2Pool ouput using
screen -x p2pool

You disconnect from the P2Pool output by pressing: Ctrl-A and then D (nothing will show on screen)

When you reboot your server you can just start it by executing:

The above command includes a wait of 200 seconds (so that bitcoind gets latest updates) before starting p2pool.

Enjoyed it? Buy me a beer Smiley
Send your donations to: 1mrdfyA1GhKmTPhaSkvyq5DBterQ5m7ZK

Buy me a beer: 1mrdfyA1GhKmTPhaSkvyq5DBterQ5m7ZK

Run your own P2Pool with Ubuntu 16.04 LTS and merge mining
Pages: [1]
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!