In this how to tutorial, Let’s see how to install Bitcoin daemon full node wallet on a Ubuntu server.
Make sure you have installed Apache or nginx on your server before starting with the installation. Type the below commands to install Apache on ubuntu server:
sudo apt-get update
sudo apt-get install apache2
You will be requested to enter Y/N. Type Y to proceed with the installation
Download PPA repository by running the below command from home/root directory (Type cd ~ )
sudo add-apt-repository ppa:luke-jr/bitcoincore
When prompted, click ENTER key to proceed with the installation.
sudo apt-get update
sudo apt-get install bitcoind
When prompted, type Y to proceed with the installation.
A. Creating .bitcoin folder in root directory.
Run the following command to check if you are in the root directory:
cd ~
Then run the following command to create the .bitcoin directory. For starters: mkdir stands for make directory. And and dot folder means it is a hidden folder. You can not view the folder normally with ls command and you need to use ls-a command to view the hidden folder.
mkdir .bitcoin
change or move into the newly created directory using the below command:
cd .bitcoin
B. Setting config file
Creating the config file. In this tutorial i am using nano editor in ubuntu. You can also use vi editor if you wish. Run the below command to create the file:
sudo nano bitcoin.conf
You will see an editor like in the below screenshot:
Copy the below configuration and paste it in the text editor:
server=1
rpcport=18523
rpcallowip=ip_address_of_your_external_application/0
rpcuser=yokesh_explains
testnet=1
rpcpassword=32_character_alphanumeric_string
and click ctrl+X. Prompt will ask you to save and exit. Type Y and hit enter. Your configuration file is saved now.
Let’s see about these configurations now.
There are more configurations which you can do. Lets see more in detail about it in upcoming articles.
C. Setting up Firewall
Run the below commands to open the required ports and to turn on ubuntu default firewall.
Enabling SSH port with Firewall –
sudo ufw allow 22
Enabling HTTP port with Firewall –
sudo ufw allow 80
Enabling HTTPS port with Firewall –
sudo ufw allow 443
Enabling our RPC port with Firewall. make sure you give the same port number as you have given in conf file.
sudo ufw allow 18523
Finally enable Firewall –
sudo ufw enable
D. Configuring Cron
Run the below command to make sure bitcoind continues to run when server is restarted:
sudo crontab -e
Type 1 and hit enter. Next in the editor goto the last and paste it in a new line.
@reboot bitcoind -daemon
Finally the setup is now done. Lets start the bitcoin server and access the wallets.
Run the below daemon command to initialize bitcoin blockchain in background:
bitcoind -daemon
We will have to wait for the blockchain to complete downloading and sync with the current block to send and receive transactions. The blocks and headers number will be equal in numbers when the blockchain is downloaded and in sync.
Use the below JSON-RPC commands to interact with the bitcoin blockchain:
Complete of bitcoin-cli commands can be found from HERE
Note that when you do getblockchaininfo, you see that the blocks and headers are not in sync initially
Alright! You are all ready now. You have successfully completed bitcoin installation on ubuntu server successfully. Let me know in comments if you face any issue in the above steps.
Introduction In spite of the modernity advancements, supply chain control remains intricate but imperative in…
EIP-4844 suggests a new way to handle transactions on Ethereum so that it can scale…
The industry is experiencing a significant change as a result of the tokenization of real…
What is BRC20 Token? Domo, a confidential inventor, introduced BRC-20 tokens to the open on…
What is Zero-Knowledge Proof (ZKP-TECH) Confidence in zero knowledge proof is necessary between two individuals.…
By implementing over 1000 projects, software development became an expert field for Sparkout tech. We…