Mining Bitcoin and other crypto on AWS (2024)

The Bitcoin mania has struck again. With the BTC and ETH prices at all times high many people look for ways to take part in the frenzy. Start mining on AWS today using our easy to use CloudFormation template. Or better not? Let’s find out…

Typically you can obtain Bitcoins and other crypto-currencies in one of three ways: by buying them, trading them or mining them. Here we will have a look at the latter option — mining crypto on AWS.

Crypto mining is a very computationally intensive adventure for which we need a PC with a high-end graphics card, GPU. That’s something that I don’t have unfortunately. However since AWS offers EC2 instances equipped with many different kinds of GPUs that we can take for a test drive with no upfront cost I decided to give it a go and try mining on this most popular cloud platform and see how rich I can get.

TL;DR — don’t. After some research, I realised that to at least remotely effectively mine Bitcoins it’s no longer enough to have a GPU. I would need specialised single-purpose hardware called ASIC Miner. These are available from many vendors and cost thousands to buy. Not quite what I want to do at the moment.

So is this the end of it? Nope, of course not. There are still some crypto-currencies that can be somewhat effectively mined on GPUs. One such example is Ethereum. Let’s have a look at that.

Don’t, really, it’s not worth it.

Still reading? Ok, ok, let's explore the details. To start mining Ethereum we will need four things:

  • Ethereum wallet for the payouts
  • Mining software
  • Join a mining pool
  • Efficient hardware

Read the January 2022 update:

New AWS instance that makes ETH mining profitableMining Ethereum on AWS so far made no sense. Until now! One new AWS instance is the game changer and mining on AWS is…michael-ludvig.medium.com

My CloudFormation template has been updated to support the latest and most cost effective GPU instance types (as of Jan 2022).

Mining Bitcoin and other crypto on AWS (2)

Launch the EthMiner CloudFormation stack and try for yourself.

The Ethereum Wallet is kind of an account number where we keep our crypto-currency balance. There are many ways to create one — online services, desktop software, or buying an extra-secure offline wallet. Read more about Ethereum wallets here. I chose to create mine on blockchain.org — for no particular reason to be honest. After all, this is just for testing so any service that can create a wallet will do.

Once the wallet is created note down its address, it will be a long string of numbers and letters, something like 0x99b36B[…]21ECac2c15.

The next piece of the setup a Mining Pool. If I was mining on my own I could potentially be crunching the numbers for a long long time before finally cracking a new block. Sure, I would then get a high reward for it (typically around 2 ~ 3 ETH), but it may take a very long time with a very uncertain result. More effective and predictable way to earn crypto through mining is to join a mining pool.

The idea behind mining pools is simple — many miners all contribute their computing power to a common goal and if one of them happens to mine a new block the pool shares the reward between all the miners relative to their contribution. The more computing power you contribute the bigger share of the payout you get (simple arithmetic). Also the bigger the pool the more often the members mine a new block (simple statistics) and the more often the pool receives and distributes a new reward. In large pools, new blocks are mined every couple of minutes.

For my tests I chose to use ethermine.org pool — it is very easy to join, doesn’t require any registration and will pay out your share as soon as you accumulate as little as 0.005 ETH (ca $9 in February 2021) which is less than most other pools. That means that you won’t have to wait too long for your rewards to end up in your wallet.

Now for the software — the most popular at the moment seems to be ethminer available from GitHub. Tried, tested, works. Let’s go with that.

The ethminer program basically takes two parameters — the pool endpoint address and the worker ID, which happens to be the Wallet address that we created before. Both conveniently bundled into a single URI:

ethminer -P stratums://0x99b36B[...][email protected]:5555

So that’s the setup and the software side of things. Now, all we need is somewhere to run it.

Mining Bitcoin and other crypto on AWS (3)

Amazon offers a number of different GPU instances equipped with different models of NVIDIA cards that obviously cost different amounts to run and provide different performance. That’s a lot of variables.

We want the best bang for the buck, i.e. the best outcome for each dollar paid to AWS. How do we measure it though?

Each instance type is for our purposes defined by two variables:

  • the cost per hour, and
  • the hash rate it can generate

The hash-rate is measured in Mega Hash per Second — MH/s — and is one of the units of performance used in the blockchain networks. The more mega-hashes we crunch the bigger share of the pool rewards we get, simple as that.

Our goal is therefore to do as many mega-hashes as possible for as little cost as possible.

Update — end of 2021

I have published an updated research with new results — check it out!

Mining Ethereum on AWS — is it worth it?The Ethereum price increased from $450 to $4500 over the past year. Does that make Ethereum mining on AWS finally…michael-ludvig.medium.com

Let's spin up a few different instance types with different GPU types, run ethminer on them and record the reported hashrate.

Mining Bitcoin and other crypto on AWS (4)

The results are surprisingly varied with the hashrate ranging from 1.8 MH/s in p2.xlarge to 312 MH/s in p3.8xlarge. I haven’t tested all the available instance types, however, the below selection provides a good overview.

The naive conclusion would be to choose the most powerful instance — p3.8xlarge — but is it really the most cost-effective one?

In AWS we may pay different prices for the same instance type, depending on the pricing plan and the region. For example in the case of g4dn.2xlarge the on-demand price can vary from $0.752/hr in the US East — Ohio or US West — Oregon regions, through $0.978/hr in Asia Pacific — Sydney, all the way up to $1.777/hr in Asia Pacific (KDDI) — Tokyo. That’s a massive difference!

Typically the old US regions — Ohio, N. Virginia and Oregon — are the cheapest.

The next factor affecting the cost is the price plan. The most expensive is on-demand at $0.752 per Hour in US East — Ohio as shown above. If we wanted to run the miner continuously for the next 1 or 3 years we could purchase a reserved instance and pay as little as $0.283/hr on a 3 years plan (saving of 62% off the on-demand price). But we certainly don’t want to commit to 3 years, not yet. We only want to test and see if / how mining on AWS works for us.

The best option is Spot pricing where Amazon offers excessive unused capacity at significant discounts. The Spot price can fluctuate with time, depending on demand and if it raises above what you’re willing to pay your instance will be terminated. But that’s OK, we only want to pay as little as possible. At the moment the spot price for g4dn.2xlarge in Ohio is $0.2256 per Hour — a massive 70% discount on the on-demand price!

All we need now is to find the spot prices of all our instance types in Ohio and put them in our table.

With the performance and prices collected we can calculate the performance per dollar, or even calculate the Mega-Hashes we can crunch per dollar. The more the better.

We’ll take the measured MH/s, multiply by 3600 to get MH per hour and divide by the spot price per hour to get Mega Hashes per Dollar.

The final results are in the last column…

Surprisingly the best value by far is g4dn.xlarge at almost 520 GH/$. The fastest instance type p3.8xlarge that won in absolute numbers is still over 40% less effective per dollar. The loser in our contest is p2.xlarge with measly 24 GH/$, which is means that it’s 20x more expensive to get the same result.

Conclusion —g4dn.xlarge in Ohio, Oregon, or North Virginia provides the best value.

Sure we can manually spin up a few instances and watch our ETH balance grow. Or we can use this little project as an opportunity to brush up some Infrastructure as Code (IaC) skills.

Check out the complete CloudFormation template that I published on GitHub with all the necessary resources to start mining — Spot price settings for different instance types, EC2 Launch Template that automatically configures each node and starts the miner, Auto Scaling Group that spins up the required number of nodes, SNS Topic for notifications about instance starts and shutdowns, etc.

Mining Bitcoin and other crypto on AWS (5)

To get the most out of the GPU-enabled instances we’ll use “Deep Learning AMI (Ubuntu 18.04) Version 36.0” that comes with all the necessary NVIDIA drivers preconfigured. That will save us a lot of setup work.

Also in line with the best practices, we won’t configure SSH access. Instead, use SSM Session Manager for interactive access to the instances using a web-based shell session. Or use the super-convenient command-line tool ssm-session for accessing the instance from a Linux or Mac shell.

Once we’ve got access to the instance we can, for example, check out the miner log with tail -f /tmp/ethminer.log and verify the hash rate.

Mining Bitcoin and other crypto on AWS (6)

Well, that’s a tough one. The payout depends on many factors — most importantly on the current Ethereum price, but also on the Ethereum network difficulty, the payout for a mined block, and on the current EC2 spot price of the instances that we use.

At the time when I was running my tests in November 2020, the price for 1 ETH was around $450. With that, the payouts from the pool were around 20% of the AWS cost. In other words for $100 spent on AWS costs, I got around $20 in Ethereums.

Mining Bitcoin and other crypto on AWS (7)

Update Feb ’21: From November last year the ETH price pretty much quadrupled to the current $1800. Does that suddenly give us 80% return on the AWS spend? That’d be nice but not so fast... With more miners in the Ethereum network the Network difficulty also increased 1.4x in the same time so the reward per GigaHash dropped by that factor as well. Since we’re talking approximate, volatile numbers that change every minute let’s just estimate that in February 2021 we should get roughly $50 to $60 back for each $100 spent on AWS costs, or -50% to -60% return. Still not a great investment.

It’s not worth it, don’t do it, you have been warned!!

Ah, wait, maybe read the updates first…

Update Dec ’21: A lot has happened since I first published this research a year ago.

  • The ETH price increased from $450 to $4500
  • AWS have introduced new more powerful instance types
  • The end of Ethereum mining is coming soon with the switch to ETH 2.0

Check out my new up to date research: Mining Ethereum in AWS — is it worth it? to find out.

Update Jan ’22: One new EC2 instance makes ETH mining on AWS finally profitable. Read the latest update: The new AWS instance that makes ETH mining profitable and decide for yourself whether you give it a try :)

Happy mining!

Mining Bitcoin and other crypto on AWS (2024)

FAQs

Is crypto mining allowed on AWS? ›

Well, yes, if you're paying the full price for the AWS services you're not likely to make a profit. But if you've got access to a free AWS account, or have heaps of AWS credits that are about to expire, you may be able to extract some Bitcoins.

Can you mine other crypto besides Bitcoin? ›

Mining other cryptocurrencies, like Litecoin or Dogecoin, may require hardware optimized for the Scrypt algorithm. However, Monero's mining algorithm, RandomX, is designed to be more CPU-friendly, leveling the playing field for miners without access to specialized equipment.

Can you still mine Bitcoin and other crypto from home? ›

Mining Bitcoins on a personal computer at home is not very profitable nowadays due to the high computational power required. The process involves setting up a Bitcoin wallet, downloading mining software, joining a mining pool, and running the mining software to solve complex mathematical problems.

Can I mine Ethereum on AWS? ›

Amazon Managed Blockchain and many partners of AWS offer a convenient way to use Ethereum nodes without operating your own infrastructure. But sometimes, when you want to run archive nodes or participate in Ethereum staking, the managed nodes aren't enough, and you may choose to run your own Ethereum nodes on AWS.

What crypto is Amazon approved? ›

Amazon Managed Blockchain currently supports Ethereum, Polygon, Bitcoin and Hyperledger Fabric blockchains. Learn more about each at AMB Access and AMB Query.

Is mining in the Amazon legal? ›

Today, around 50,000 people are thought to still work as illegal gold miners in Madre de Dios, making up a significant chunk of the local economy. There is also a smaller number of "informal miners" who have some but not all the necessary permits. And then, smallest of all, is the group of legal miners.

Which cryptocurrency will reach $10,000? ›

At the beginning of 2030, the ETH price could reclaim its position of $10,000 and probably be above that level, establishing a robust upward trend. ETH might even bypass this all-time high of around $12,000 and set a new record. But, again, after reaching this peak, a crucial pullback might ensue.

Is GPU mining still profitable in 2024? ›

Crypto mining will still be profitable in 2024, but only if you have the right mining setup.

Which miner is most profitable? ›

The Bitmain Antminer S21 Hyd 335T is the most profitable Bitcoin mining machine currently, followed by the Canaan Avalon Made A1266, and MicroBit Whatsminer M50S. If you want to mine other cryptocurrencies, the Bitmain Antminer KS3, Bitmain Antminer D9, and Bitmain Antminer K7 are all solid choices.

Is it illegal to mine Bitcoin at home? ›

So, while crypto mining remains legal in the U.S., it is essential for those involved in the industry to stay informed about evolving regulations, tax implications, and proposed taxes to ensure compliance and optimize their operations.

What is the easiest crypto to mine? ›

9 Best Cryptocurrencies for Mining (Easy to Hard)
CryptocurrencyMining rewards per blockDifficulty
Dash (DASH)2.3097 DASHEasy/Medium
Ethereum Classic (ETC)2.5 ETCEasy/Medium
Dogecoin (DOGE)10,000 DOGEMedium
Litecoin (LTC)12.5 LTCHard
5 more rows

Is it still profitable to mine Bitcoin at home? ›

Yes. Crypto mining can be profitable - but there are factors miners need to consider including electricity costs, mining difficulty, and market conditions.

Does AWS ban crypto mining? ›

However, cryptocurrency mining is not allowed when using the free tier of AWS services - you may be charged for usage in that case. This is explicitly called out in the AWS Free Tier Terms: You may not use AWS Services under any Offers to mine for cryptocurrency.

How do I use AWS for Bitcoin mining? ›

Cloud Mining on Amazon Web Services
  1. Introduction to Amazon Web Services. 03:27.
  2. Pricing of Amazon Web Services. 13:49.
  3. Create your on-demand test server on AWS. 09:43.
  4. MAC - Setting up your server. 16:23.
  5. WINDOWS - Setting up your server. 17:12.
  6. LINUX - Setting up your server. 16:12.
  7. Create your production instance on AWS. 05:24.

How much of Ethereum is run on AWS? ›

25% of all Ethereum workloads in the world run on AWS. Enterprise customers for Hyperledger Fabric include Nestle, Sony Music, BMW, Sage, Guardian, DTCC, Workday, Klarna Bank, SGX, Legal & General, Splunk, Zilliant, Contura Energy, DVLA UK, and many more.

Can I mine crypto on cloud? ›

Cloud mining is a method to mine cryptocurrencies by leasing equipment or renting computing power from data centers. It offers a more accessible avenue to mining, eliminating hardware and operational challenges.

Where is crypto mining banned? ›

In 2022, Kosovo outlawed all crypto mining in an effort to conserve electricity during an energy crisis. The most recent ban on Bitcoin mining was passed by the Angolan parliament in April 2024. The law criminalizes crypto mining with the goal of protecting the country's electrical grid and energy security.

Does Amazon allow crypto? ›

No cryptocurrency, including Bitcoin, is accepted by Amazon directly.

Where is crypto mining allowed? ›

The top 10 countries for Bitcoin mining represent 93.8% of the entire network by hashrate—a measure of computational power—with the U.S., China, and Kazakhstan rounding out the top three. Together these three countries hosted nearly three-quarters of the network at the end of 2021.

Top Articles
2023 GICS Classification Change: Impact on S&P 500 Earnings | Lipper Alpha Insight | LSEG
Nightbot Twitch 101: A Complete Guide with the Top 10 Nightbot Commands
Fiskars X27 Kloofbijl - 92 cm | bol
417-990-0201
Amc Near My Location
Craigslist Benton Harbor Michigan
Shs Games 1V1 Lol
Ventura Craigs List
Optum Medicare Support
Best Pawn Shops Near Me
Olivia Ponton On Pride, Her Collection With AE & Accidentally Coming Out On TikTok
Things To Do In Atlanta Tomorrow Night
Explore Top Free Tattoo Fonts: Style Your Ink Perfectly! 🖌️
David Turner Evangelist Net Worth
24 Best Things To Do in Great Yarmouth Norfolk
Unit 33 Quiz Listening Comprehension
Condogames Xyz Discord
The Cure Average Setlist
Inside the life of 17-year-old Charli D'Amelio, the most popular TikTok star in the world who now has her own TV show and clothing line
Ally Joann
Hdmovie2 Sbs
Company History - Horizon NJ Health
Rust Belt Revival Auctions
Cain Toyota Vehicles
SOGo Groupware - Rechenzentrum Universität Osnabrück
Nk 1399
Giantbodybuilder.com
Scott Surratt Salary
Gunsmoke Tv Series Wiki
Craigs List Jax Fl
Sam's Club Near Wisconsin Dells
Restaurants Near Calvary Cemetery
How to Draw a Bubble Letter M in 5 Easy Steps
Barrage Enhancement Lost Ark
The disadvantages of patient portals
Stanford Medicine scientists pinpoint COVID-19 virus’s entry and exit ports inside our noses
Electronic Music Duo Daft Punk Announces Split After Nearly 3 Decades
Urban Blight Crossword Clue
Dogs Craiglist
2132815089
Tattoo Shops In Ocean City Nj
Tom Kha Gai Soup Near Me
Gabrielle Abbate Obituary
Frequently Asked Questions
Gonzalo Lira Net Worth
Boyfriends Extra Chapter 6
Paradise leaked: An analysis of offshore data leaks
2000 Ford F-150 for sale - Scottsdale, AZ - craigslist
Latina Webcam Lesbian
Bismarck Mandan Mugshots
Black Adam Showtimes Near Kerasotes Showplace 14
Palmyra Authentic Mediterranean Cuisine مطعم أبو سمرة
Latest Posts
Article information

Author: Melvina Ondricka

Last Updated:

Views: 5836

Rating: 4.8 / 5 (48 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Melvina Ondricka

Birthday: 2000-12-23

Address: Suite 382 139 Shaniqua Locks, Paulaborough, UT 90498

Phone: +636383657021

Job: Dynamic Government Specialist

Hobby: Kite flying, Watching movies, Knitting, Model building, Reading, Wood carving, Paintball

Introduction: My name is Melvina Ondricka, I am a helpful, fancy, friendly, innocent, outstanding, courageous, thoughtful person who loves writing and wants to share my knowledge and understanding with you.