<p>This guide will set up everything you need on a single machine.</p>

<p>Let's get started by setting up the environment:</p>

<pre><code>sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install automake gcc
sudo apt-get install libevent-dev libmemcached-dev libcurl4-openssl-dev zlib1g-dev libjansson-dev curl memcached
</code></pre>

<p>Depending on your distro some of these may not be available (libjansson-dev for example is not available on Lucid), and you may have to download and compile the sources.</p>

<p>Pushpool requires a database to work so we have to install either SQLite3 or MySQL. MySQL probably is the better choice, but SQLite3 suffices to just test pushpool:</p>

<pre><code>sudo apt-get install libsqlite3-dev sqlite3
</code></pre>

<p>To get MySQL you'd instead install <code>libmysql++-dev</code>.</p>

<p>Next we download the pushpool source and extract it to <code>/tmp/</code>:</p>

<pre><code>cd /tmp/
curl -s http://yyz.us/bitcoin/pushpool-0.5.1.tar.gz | tar -xvz
cd pushpool-0.5.1
</code></pre>

<p>Now let's get on with it by configuring, compiling and installing it into /opt/pushpool:</p>

<pre><code>./configure --prefix=/opt/pushpool/
make
sudo make install
cd /opt/pushpool/
</code></pre>

<p>At this point we can quickly check that everything worked:</p>

<pre><code>$ sbin/pushpoold -E -F
[2013-01-04 16:00:40.682356] config file(server.json): No such file or directory
</code></pre>

<p>All we need to do now is to configure the pushpool server.</p>

<pre><code>sudo cp /tmp/pushpool-0.5.1/example-cfg.json /opt/pushpool/server.json
sudo nano /opt/pushpool/server.json
</code></pre>

<p>Here's mine for example:</p>

<pre><code>{
        # network ports
        "listen" : [
                # binary protocol (default), port 8336
                { "port" : 8336 },

                # HTTP JSON-RPC protocol, port 8337
                { "port" : 8337, "protocol" : "http-json" }

        ],

        # database settings
        "database" : {
                "engine" : "sqlite3",
                "name" : "/tmp/data.sqlite",
                "stmt.pwdb" :
                  "SELECT password FROM pool_worker WHERE username = ?"

        },

        # cache settings
        "memcached" : {
                "servers" : [
                        { "host" : "127.0.0.1", "port" : 11211 }
                ]
        },

        "pid" : "/tmp/pushpoold.pid",

        # overrides local hostname detection
        "forcehost" : "localhost.localdomain",

        "log.requests" : "/tmp/request.log",
        "log.shares" : "/tmp/shares.log",

        # the server assumes longpolling (w/ SIGUSR1 called for each blk)
        "longpoll.disable" : false,

        # length of time to cache username/password credentials, in seconds
        "auth.cred_cache.expire" : 75,

        # RPC settings
        "rpc.url" : "http://127.0.0.1:8332/",
        "rpc.user" : "bitcoinrpc",
        "rpc.pass" : "bitcoinpassword",

        # rewrite returned 'target' to difficulty-1?
        "rpc.target.rewrite" : true,

        # allow clients to update the ntime field of their work
        "roll.ntime.disable" : false
}
</code></pre>

<p>And finally we get to the database setup:</p>

<pre><code>sqlite3 /tmp/data.sqlite "CREATE TABLE pool_worker (username VARCHAR(32), password VARCHAR(32))"
sqlite3 /tmp/data.sqlite "INSERT INTO pool_worker VALUES ('username', 'password');
</code></pre>

<p>At this point we have created the database and inserted a new user called <code>username</code> and password <code>password</code>. Running <code>sbin/pushpoold -E -F</code> again will start the daemon.</p>

<p>Pointing your miner to <code>http://username:password@127.0.0.1:8336/</code> should get you mining.</p>

CC BY-SA 3.0
2013-04-17T17:11:37.627Z
Thanks cdecker ... And how do you send the bitcoins you create to your wallet?
balavec
CC BY-SA 3.0
2013-04-17T17:39:28.930Z
Well the coins that are mined should end up in your `bitcoind` instance, as this is also used to create the initial work for the miners. You will then have to implement some way of calculating the share of the reward that each participant should get and then distribute the reward accordingly. This is the part you'll have to implement yourself.
cdecker
CC BY-SA 3.0
2013-05-14T16:29:09.060Z
@cdecker I know this is very stupid to ask, but you seem to know much about this... I have some questions I'd like you to take a look at :) Click my profile. Thanks
Robin Jonsson
CC BY-SA 3.0
2013-01-04T16:26:08.003Z
2013-01-04T16:26:08.003Z
cdecker
<p>How can I setup pushpool on my ubuntu dedi?</p>

<p>I have bitcoind up and running with latest blocks, what's next?</p>

CC BY-SA 3.0
2012-08-10T07:24:05.360Z
I'd suggest you follow [this](https://bitcointalk.org/index.php?topic=10321.0) comprehensive guide on the forums.
BinaryMage
CC BY-SA 3.0
2012-10-14T15:34:41.217Z
@BinaryMage, you could probably make this an answer instead of a comment.
D.H.
CC BY-SA 3.0
2013-01-04T16:26:47.457Z
I rewrote the guide to be more concise and less trial-and-error.
cdecker
<mining-pools><server><pushpool>
How to setup pushpool?
Exposed
# How to setup pushpool?

(Asked by: username_0 on 2012-07-29)

How can I setup pushpool on my ubuntu dedi?

I have bitcoind up and running with latest blocks, what's next?

**Tags:** mining-pools, server, pushpool

> **Comments:**
> **username_1**: I'd suggest you follow [this](https://bitcointalk.org/index.php?topic=10321.0) comprehensive guide on the forums.  
> **username_2**: @username_1, you could probably make this an answer instead of a comment.  
> **username_3**: I rewrote the guide to be more concise and less trial-and-error.  

---

## 1 answers

### Answer by username_3 on 2013-01-04. Score: 4

This guide will set up everything you need on a single machine.

Let's get started by setting up the environment:

```
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install automake gcc
sudo apt-get install libevent-dev libmemcached-dev libcurl4-openssl-dev zlib1g-dev libjansson-dev curl memcached

```

Depending on your distro some of these may not be available (libjansson-dev for example is not available on Lucid), and you may have to download and compile the sources.

Pushpool requires a database to work so we have to install either SQLite3 or MySQL. MySQL probably is the better choice, but SQLite3 suffices to just test pushpool:

```
sudo apt-get install libsqlite3-dev sqlite3

```

To get MySQL you'd instead install `libmysql++-dev`.

Next we download the pushpool source and extract it to `/tmp/`:

```
cd /tmp/
curl -s http://yyz.us/bitcoin/pushpool-0.5.1.tar.gz | tar -xvz
cd pushpool-0.5.1

```

Now let's get on with it by configuring, compiling and installing it into /opt/pushpool:

```
./configure --prefix=/opt/pushpool/
make
sudo make install
cd /opt/pushpool/

```

At this point we can quickly check that everything worked:

```
$ sbin/pushpoold -E -F
[2013-01-04 16:00:40.682356] config file(server.json): No such file or directory

```

All we need to do now is to configure the pushpool server.

```
sudo cp /tmp/pushpool-0.5.1/example-cfg.json /opt/pushpool/server.json
sudo nano /opt/pushpool/server.json

```

Here's mine for example:

```
{
        # network ports
        "listen" : [
                # binary protocol (default), port 8336
                { "port" : 8336 },

                # HTTP JSON-RPC protocol, port 8337
                { "port" : 8337, "protocol" : "http-json" }

        ],

        # database settings
        "database" : {
                "engine" : "sqlite3",
                "name" : "/tmp/data.sqlite",
                "stmt.pwdb" :
                  "SELECT password FROM pool_worker WHERE username = ?"

        },

        # cache settings
        "memcached" : {
                "servers" : [
                        { "host" : "127.0.0.1", "port" : 11211 }
                ]
        },

        "pid" : "/tmp/pushpoold.pid",

        # overrides local hostname detection
        "forcehost" : "localhost.localdomain",

        "log.requests" : "/tmp/request.log",
        "log.shares" : "/tmp/shares.log",

        # the server assumes longpolling (w/ SIGUSR1 called for each blk)
        "longpoll.disable" : false,

        # length of time to cache username/password credentials, in seconds
        "auth.cred_cache.expire" : 75,

        # RPC settings
        "rpc.url" : "http://127.0.0.1:8332/",
        "rpc.user" : "bitcoinrpc",
        "rpc.pass" : "bitcoinpassword",

        # rewrite returned 'target' to difficulty-1?
        "rpc.target.rewrite" : true,

        # allow clients to update the ntime field of their work
        "roll.ntime.disable" : false
}

```

And finally we get to the database setup:

```
sqlite3 /tmp/data.sqlite "CREATE TABLE pool_worker (username VARCHAR(32), password VARCHAR(32))"
sqlite3 /tmp/data.sqlite "INSERT INTO pool_worker VALUES ('username', 'password');

```

At this point we have created the database and inserted a new user called `username` and password `password`. Running `sbin/pushpoold -E -F` again will start the daemon.

Pointing your miner to `http://username:password@127.0.0.1:8336/` should get you mining.

> **Comments:**
> **username_4**: Thanks username_3 ... And how do you send the bitcoins you create to your wallet?  
> **username_3**: Well the coins that are mined should end up in your `bitcoind` instance, as this is also used to create the initial work for the miners. You will then have to implement some way of calculating the share of the reward that each participant should get and then distribute the reward accordingly. This is the part you'll have to implement yourself.  
> **username_5**: @username_3 I know this is very stupid to ask, but you seem to know much about this... I have some questions I'd like you to take a look at :) Click my profile. Thanks  

---

