5 methods for setting up a Private Blockchain Network
Tags: blockchain, ethereum, web3, terraform
Published: 2022-04-03 14:11:35

---
title: 5 methods for setting up a Private Blockchain Network
published: true
date: 2022-04-03 13:54:54 UTC
tags: #blockchain, #ethereum, #web3, #terraform
canonical_url: https://jamesmiller.blog/5-methods-for-setting-up-a-private-blockchain-network/
---
![Header Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l3x8f2hucz2y53o683eo.png)

How to deploy a Private Blockchain Network to a cloud based environment.

### Intro

I’ve recently been using Solidity to write Smart Contracts and have been looking at several different ways for testing them.

I decided on setting up a private Ethereum Blockchain for my usecase, what I found from my exploration is that:

- Public test networks (e.g Rinkeby, Ropsten and Kovan) are useful for testing DApps that you plan on hosting publically.
- Private test networks are useful if you plan on launching your DApp to a private network, or if development is in early stages where you wouldn’t want to deploy it to a public test network.

### 5 ways to set up a Private Blockchain Network for development & testing

Along my journey of looking at ways to set up a Private Blockchain, I came across some great resources that I thought I’d share.

These 5 methods aren’t the only ways to set up a Private Blockchain network for development, but they are a good place to start!

#### Geth

[Go Ethereum](https://geth.ethereum.org/) (abbreviated as Geth) is an implementation of the Ethereum blockchain, which is written in Go Lang.

There are some great tutorials for creating a [localhost environments using Geth](https://medium.com/@yangnana11/how-to-setup-a-local-test-node-with-initial-ether-balance-using-geth-b0ad90ff697b), here are a couple I found for creating a private Ethereum Blockchain on your own server:

- [Use GETH github repo to create private ethereum](https://medium.com/@rktkek456/build-private-ethereum-network-and-test-step-by-step-ff50a2c88eca)
- [Set up a private Ethereum Blockchain using Geth and Brew commands](https://arvanaghi.com/blog/how-to-set-up-a-private-ethereum-blockchain-using-geth/)

#### Docker and Docker Compose

Tools like Docker, can be used to simplify and speed up this process by leveraging an instance of Geth via a pre-made image, which can then be deployed on a Virtual Machine easier.

Here is a nice tutorial that shows you how to [create a private ethereum blockchain using docker and docker-compose](https://medium.com/scb-digital/running-a-private-ethereum-blockchain-using-docker-589c8e6a4fe8).

#### Terraform and Amazon ECS

Using Geth as the Ethereum Implementation and Docker to help with deployment is a great way to deploy your own private instance, but we can make this even better through automation.

Tools like Terraform (an Infrastructure as Code framework) and Amazon ECS (Elastic Container Service) can help make this even quicker and written as a code component that can be re-used across projects.

Terraform is a great tool, which you should [consider learning](https://jamesmiller.blog/terraform-aws-mac-setup/) — here are some tutorials that you can use it to spin up a Private Ethereum Blockchain.

- [Use Terraform to create a private Ethereum Blockchain Network](https://github.com/SCB-TechX-Saber-Labs/terraform-aws-ecs-private-ethereum-blockchain)
- [Terraform module for creating a private Blockchain Ethereum network using ECS](https://registry.terraform.io/modules/SCB-TechX-Saber-Labs/ecs-private-ethereum-blockchain/aws/latest)
- [Great tutorial for creating a private ethereum blockchain using Terraform and Amazon ECS](https://medium.com/scb-techx/a-terraform-module-to-setup-a-private-ethereum-network-on-aws-500d51681c6f)

#### Amazon Managed Blockchain

Platforms like Amazon Web Services (AWS) offer out of the box methods to create Ethereum nodes and private Hyperledger Fabric Blockchain networks.

The power of this approach, is that AWS allows you to spin up your own Blockchain network in a few clicks of your mouse — which is really amazing.

Here are a couple of tutorials I found that could be useful:

- [Create a Private Amazon Managed Hyperledger Fabric Blockchain](https://eu-west-2.console.aws.amazon.com/managedblockchain)
- [Use CloudFormation on AWS to create a Private Ethereum Blockchain Network](https://aws.amazon.com/blogs/database/deploy-smart-contracts-to-your-private-ethereum-blockchain-network-on-aws/)

#### Polygon

Polygon is a side chain to Ethereum, which is growing in popularity for developers due to faster transaction speeds, lower gas prices and the ability to deploy smart contracts with Solidity (just like you would with the Ethereum Mainnet).

I may do a post about side chains in the future to properly detail how they work and why they are great, but for now — here is a nice link on how to [spin up your own Private Blockchain Network on the cloud via Polygon Edge](https://edge-docs.polygon.technology/docs/get-started/set-up-ibft-on-the-cloud/).

### Conclusion

There are many different ways to go about setting up a Private Blockchain Network, I hope this post helped give you a useful place to start.

Personally, the Terraform approach was most helpful to me — but I’m super excited about using Polygon some point in the future!!

Have fun developing!! :D