Need a fast VPS server for a Bitcoin node? Sign up to BitLaunch today.
What is a Bitcoin node?
Running a Bitcoin node helps support the network and the future of the crypto currency. If you want to help Bitcoin grow, you can run your very own node, which helps to fully validate transactions and blocks.
Many people and organizations volunteer to run Bitcoin nodes using spare computing and bandwidth resources—but more volunteers are needed to allow Bitcoin to continue to grow.
Usually we would need a VPS with enough space to hold the entire blockchain, but with a few extra bits of configuration, we can get a bitcoin node setup on a surprisingly small and cheap VPS.
Note that it is not recommended to use this node as a personal wallet.
The official bitcoin documentation states the following requirements for running a bitcoin node:
- 145 gigabytes of free disk space
- 2 gigabytes of memory (RAM)
- A broadband Internet connection with upload speeds of at least 400 kilobits (50 kilobytes) per second
- An unmetered connection or a connection with high upload limits
All of our supported hosts provide servers that meet these requirements. We can also save costs by reducing the amount of space required to store blockchain information by using what's called "pruned mode" as part of the bitcoin core software.
Step 1: Choosing a server
To match the necessary requirements, we're going to pick a server with good transfer and 2GB ram at minumum. When choosing how much space we will use to store blockchain information, we need to be sure that it is over 550MB, as that is the minumum required for pruning.
Head over to the server creation panel to begin.
For purposes of this guide, I've chosen a Digital Ocean server in New York and have chosen a server with 2GB ram and 40GB SSD space.
After you have chosen your server, choose an SSH key to login with and give the server a suitable name.
For more information on SSH keys, please see our SSH key guide
Step 2: Installing Bitcoin Core
Once you're logged into your server, we're going to install bitcoin core.
sudo apt-add-repository ppa:bitcoin/bitcoin
This will add the bitcoin package repository. You may be greeted with the following message:
Stable Channel of bitcoin-qt and bitcoind for Ubuntu, and their dependencies Note that you should prefer to use the official binaries, where possible, to limit trust in Launchpad/the PPA owner. No longer supports precise, due to its ancient gcc and Boost versions. More info: https://launchpad.net/~bitcoin/+archive/ubuntu/bitcoin Press [ENTER] to continue or ctrl-c to cancel adding it
enter to continue.
sudo apt-get update sudo apt-get install bitcoind
The commands above update our package list and then installs the bitcoin core package on our server.
We can reduce storage requirements by only storing the most recent blocks. You can decide on how much space you would like to dedicate to blockchain storage. Higher values merely ensure that your node will not shut down upon blockchain reorganizations of more than 2 days - which are unlikely to happen in practice. In future releases of Bitcoin core, a higher value may also help the network as a whole because stored blocks could be served to other nodes.
To do this, we need to add a configuration file in
bitcoin.conf with the following contents;
Be sure to set the amount of MB to at least
550, as that is the minumum. (a value of
0 disables pruning). We recommend setting this to 60% of your disk space, but it's entirely upto you.
Run a bitcoin node with the following command:
The BitNodes project provides an online tool to let you test whether your node accepts inbound connections.
Visit the bitnodes page and scroll down to the tool.
Enter your server's IP into the box and leave the port untouched.
A green box should appear to show that our server is working and can receive incoming connections from other nodes.
Step 3 (optional): Starting Bitcoin Core on reboot
Sometimes servers need to be restarted. It would be useful for us to start bitcoin core automatically on server boot.
The easiest way to set this is to use
crontab. Crontab is a linux utility which allows us to run processes at certain intervals or at events.
This will open up a file. Processes are read from this file by crontab and contains the schedule of cron entries to be run at specified times.
Scroll down to the bottom and add a new line containing the following:
@reboot bitcoind -daemon
That's it! Now
bitcoind will run on boot when the server is restarted.
You are now running a bitcoin node handling real transactions being made and are contributing to the future of Bitcoin.
Now that you have a bitcoin node running, you may wish to further configure your node. Bitcoin.org has excellent documentation and guides on Bitcoin and Bitcoin nodes.