Ether mining – first attempt

This guide outlines my first (and failed) attempt at mining Ether on AWS. I will first show how I set up a GPU instance to mine Ether. Then I will conclude on the profitability of the whole endeavour in a simple way, i.e. profit = [value of generated Ether] - [AWS cost].

The guide is based on this, this, this and this.


Machine p2.xlarge (spot instance)
AMI ami-2cbf3e44
Miner cpp-ethereum
Result -$0.19/hour

Download blockchain

Log into AWS in us-east-1.

Launch an p2.xlarge EC2 machine. Set the bid price to $0.9. Use the image ami-2cbf3e44, which comes with the NVIDIA drivers etc. The instance should have 100gb disk space to hold the blockchain.

(SSH into the machine)

Install Ethereum:

sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum-qt
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo add-apt-repository -y ppa:ethereum/ethereum-dev
sudo apt-get update
sudo apt-get install ethereum

Start a screen session:


Run geth in the screen session, which begins to download the blockchain:


You can now detach from the screen session by hitting ctrl a and d and disconnect from the machine. Periodically check back on the progress of geth downloading the blockchain.

(After a while)

Reattach to the screen session and check the process:

screen -r

You will see an output that looks like the output below. When geth has caught up with the block chain, you will see messages with 1 block per line.

Mine Ether

(When block chain has caught up)

Now we will mine Ether using the default ethminer. This is not recommended according to, but we will see how bad it is.

Install the cpp-ethminer:

sudo apt-get update
sudo apt-get install cpp-ethereum

Benchmark the miner to measure its hash rate. You will need to run it twice. The first time it runs it builds a DAG. The second time it runs it will run the actual benchmark:

# Run twice
ethminer -G -M

I got about 19 MH/s (i.e. 19 million hashes per second) on the p2.xlarge instance.

Create a new screen window by hitting ctrl-a and c.

Now, mine some Ether in the new window. Use the -F option to send it to your account via

ethminer -F -G

The long string that begins with '0x7B...' and ends right before '.' is my Ether wallet. You should obviously use your own.

Now, you can detach from the screen session with ctrl-a and d and check back once in a while to see if it is still running. Also check if Ether accumulates in your wallet. Finally, you can check the dash board (mine) to see the progress.


Now, let's tally the Ether that was generated and subtract the cost for the AWS instance.

The AWS spot price for one p2.xlarge is about $0.2/hour. According to ethermine, my rig generates about $0.01 worth of Ether per hour. That gives a negative result of $0.01 - $0.2 = -$0.19/hour.

The AWS p2.xlarge instance would need to be 20 x more effective to break even. Ethermine reports my effective hashrate as 19 MH/s. In conclusion, we need to squeeze at least 380 MH/s out of the p2.xlarge or find something else to do.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.