<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vasilis Aivalis</title>
    <description>The latest articles on DEV Community by Vasilis Aivalis (@aivalisv).</description>
    <link>https://dev.to/aivalisv</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2837608%2F739d6639-23fb-4809-bae4-4ca799e9b87c.jpg</url>
      <title>DEV Community: Vasilis Aivalis</title>
      <link>https://dev.to/aivalisv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aivalisv"/>
    <language>en</language>
    <item>
      <title>Run a full bitcoin node on Azure</title>
      <dc:creator>Vasilis Aivalis</dc:creator>
      <pubDate>Fri, 14 Mar 2025 18:26:23 +0000</pubDate>
      <link>https://dev.to/aivalisv/run-a-full-bitcoin-node-in-azure-5gao</link>
      <guid>https://dev.to/aivalisv/run-a-full-bitcoin-node-in-azure-5gao</guid>
      <description>&lt;p&gt;In this post, we’ll walk you through the process of setting up and running a full Bitcoin node on Microsoft Azure. Whether you're a Bitcoin enthusiast, developer, or just curious about contributing to the network, deploying your own node helps strengthen the Bitcoin ecosystem while giving you full control over your transactions and data.&lt;/p&gt;

&lt;p&gt;We’ll guide you through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deploying a virtual machine (VM) in Azure&lt;/li&gt;
&lt;li&gt;Installing and configuring Bitcoin Core (bitcoind)&lt;/li&gt;
&lt;li&gt;Optimizing storage and network settings&lt;/li&gt;
&lt;li&gt;Modifying firewall rules to allow RPC communication&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By the end, you’ll have a fully operational Bitcoin node running in the cloud, ready to validate transactions and support the decentralized network. Let’s get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Deploy a Virtual Machine (VM)
&lt;/h2&gt;

&lt;p&gt;Go to &lt;a href="//portal.azure.com"&gt;Azure Portal&lt;/a&gt;&lt;br&gt;
Click: Create a resource → Compute → Virtual Machine&lt;br&gt;
Choose OS: Ubuntu 24.04 LTS x64 Gen2 (Recommended)&lt;br&gt;
Choose Size: Select a VM with:&lt;br&gt;
You can choose any type of machine you like. On the budget side a Standard_DS1_v1 with 1vCPU and 3.5GB RAM will do , but its recommended at least a Standard_D2s_v3 with 2vCPU's and 8GB RAM . Machines with more RAM would be able to sync much faster. &lt;br&gt;
SSD storage, you will need At least 1TB, as the blockchain is growing&lt;br&gt;
Standard, or Premium SSD will do the job.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F77sjusxstc7hrogxcbqo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F77sjusxstc7hrogxcbqo.png" alt="Image description" width="623" height="1084"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Authentication Method:&lt;br&gt;
Use SSH key (Recommended)&lt;/p&gt;

&lt;p&gt;Networking:&lt;br&gt;
Allow SSH (port 22)&lt;/p&gt;

&lt;p&gt;Attach a Data Disk for Blockchain Storage:&lt;br&gt;
Click Disks → Create and Attach a New Data Disk &lt;br&gt;
Click Create and wait for deployment.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Connect to the VM via SSH
&lt;/h2&gt;

&lt;p&gt;If you have chosen to use SSH Key as the authentication method, download the &lt;code&gt;.pem&lt;/code&gt; file that contains the key pair information.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ssh -i C:\path\to\your-key.pem user@hostname&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;replace @hostname with the public IP address as given in the azure portal Virtual Machine Overview&lt;/p&gt;

&lt;p&gt;If you are using windows and receiving errors of type "Permissions for .pem are too open." either move .pem file to your \users\youruser\Documents folder where the permissions are restricted or right-click the &lt;code&gt;.pem&lt;/code&gt; file and navigate to the Security tab to Remove all inherited permissions, and add a Basic read-only permission only for your user. &lt;/p&gt;
&lt;h2&gt;
  
  
  3. Install Bitcoin Core
&lt;/h2&gt;

&lt;p&gt;Step 1: Update and Install Dependencies&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y
sudo apt install -y software-properties-common curl jq
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2: Download Bitcoin Core&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -O https://bitcoincore.org/bin/bitcoin-core-26.0/bitcoin-26.0-x86_64-linux-gnu.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 3: Extract and Install&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tar -xvf bitcoin-26.0-x86_64-linux-gnu.tar.gz
sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-26.0/bin/*

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Create and configure data directory
&lt;/h2&gt;

&lt;p&gt;Once the disk is attached, you need to initialize, partition, and format it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;List the available disks:
&lt;code&gt;lsblk&lt;/code&gt; and look for the new disk for example &lt;code&gt;/dev/sdc&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a partition
&lt;code&gt;sudo fdisk /dev/sdc&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Press n (new partition).&lt;/li&gt;
&lt;li&gt;Press p (primary partition).&lt;/li&gt;
&lt;li&gt;Accept defaults.&lt;/li&gt;
&lt;li&gt; Press w to write changes.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Format the partition:
&lt;code&gt;sudo mkfs.ext4 /dev/sdc1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a mount directory:
&lt;code&gt;sudo mkdir /mnt/datadisk&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Mount the disk:
&lt;code&gt;sudo mount /dev/sdc1 /mnt/datadisk&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a folder in /mnt/datadisk 
&lt;code&gt;mkdir /mnt/datadisk/bitcoin&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  5. Configure Bitcoin Node
&lt;/h2&gt;

&lt;p&gt;Modify the bitcoind configuration file : &lt;br&gt;
&lt;code&gt;nano ~/bitcoin-26.0/bitcoin.conf&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server=1
daemon=1
txindex=1
rpcuser=myusername
rpcpassword=mysupersecurepwd
rpcbind=0.0.0.0
rpcallowip=0.0.0.0/0
prune=0
datadir=/mnt/datadisk/bitcoin
rpcport=8332
listen=1
externalip=40.113.xx.xx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;save and exit. &lt;/p&gt;

&lt;p&gt;ExternalIP is the same that you have used to connect via SSH, (the public IP address of the VM).&lt;br&gt;
you may set rpcbindallowip to 0.0.0.0/0 to allow everybody to connect via RPC to this node, or whitelist your IP address only. &lt;/p&gt;
&lt;h2&gt;
  
  
  6. Start the bitcoin deamon
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;bitcoind -daemon -conf=~/bitcoin-26.0/bitcoin.conf&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;you may verify a successful start by using the command : &lt;br&gt;
&lt;code&gt;bitcoin-cli -conf=~/bitcoin-26.0/bitcoin.conf getblockchaininfo&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;or also by checking the bitcoin daemon running in the process list : &lt;br&gt;
&lt;code&gt;ps -aux |grep -i bitcoind&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;checking the disk usage the datadisk folder size should be increasing&lt;br&gt;
&lt;code&gt;du -h /mnt/datadisk/bitcoin/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgswvsj5uw5zyr4iji4ec.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgswvsj5uw5zyr4iji4ec.png" alt="Image description" width="560" height="151"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  7. Open Firewall for Public P2P Connections
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw allow 8332/tcp
sudo ufw allow 8333/tcp
sudo systemctl restart ufw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We must also allow the ports through azure firewall. so back in the azure portal, inside the Virtual Machine -&amp;gt; Network Settings we configure the following inbound port rules:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff25s3jmbglc4aavwm8t2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff25s3jmbglc4aavwm8t2.png" alt="Image description" width="800" height="210"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  8. Testing the rpc communication
&lt;/h2&gt;

&lt;p&gt;Create a powershell script :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$headers = @{"Content-Type" = "application/json"}
$rpcUser = "myusername"
$rpcPassword = "mysupersecurepwd"
$uri = "http://40.113.xx.xx:8332/"
$body = '{"jsonrpc":"1.0","id":"curl","method":"getblockchaininfo","params":[]}'

Invoke-WebRequest -Uri $uri -Method Post -Headers $headers -Body $body -Credential (New-Object PSCredential $rpcUser, (ConvertTo-SecureString $rpcPassword -AsPlainText -Force))

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;by running it you should be able to get a success response. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9fpga84eqdj5atig3chr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9fpga84eqdj5atig3chr.png" alt="Image description" width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>azure</category>
      <category>bitcoin</category>
      <category>rpc</category>
      <category>cryptocurrency</category>
    </item>
  </channel>
</rss>
