How-to: Bitcoin Full Node on Ubuntu 22.04

preview_player
Показать описание
In this video, I talk about how to install and configure a Bitcoin full node using a snap on Ubuntu 22.04.

One important thing I left out of the video is you need to go onto your Internet router and port forward tcp/8333 to your node to allow inbound Bitcoin node connections.

*** Since I recorded the video I've made some tweaks to the log rotation so the below doesn't exactly match the video. ***

The basic steps are:

= Prep OS and install bitcoin core software
sudo su
apt update
apt upgrade
snap install bitcoin-core

= Create an account to run Bitcoin core in even more isolation from the rest of the system
groupadd btc
useradd -g btc -m -s /bin/bash btc
su - btc

= Do a test run:
== If no errors then after 30s:
ctrl-c

= Create the configuration file:
cd ~/snap/bitcoin-core/common
mkdir .bitcoin
externalip=121.98.x.x
externalip=2404:4408:x:x::x
listenonion=0
disablewallet=1
dbcache=2048

= If you created a config file then do another test run:
== If no errors then after 30s:
ctrl-c

= Now setup to run as a daemon:
== Become root again:
exit

[Unit]
Description=Bitcoin daemon

[Service]
User=btc
Group=btc
Type=forking
KillMode=process
Restart=always
TimeoutSec=120
RestartSec=30

[Install]

== Enable and start service
systemctl daemon-reload

= Setup log rotation of debug log
vi /etc/logrotate.d/bitcoind
{
su btc btc
missingok
notifempty
compress
delaycompress
sharedscripts
copytruncate
}

== Check logrotation service is correctly configured

= Check Bitcoin Daemon
su - btc

= This shows disk space used - should grow to begin with, currently 450GB "all up" for me
du -h ~/snap/bitcoin-core/common/.bitcoin/

#bitcoin #ubuntu #howto

Video Content
00:00 Intro
00:11 Why run a Bitcoin full node?
00:51 Requirements
02:22 CPU Load
02:34 Initial setup prep
04:06 Setup separate user to run software
04:32 Initial test run
04:52 Creating a config file
07:28 Create a systemd service
09:39 Setting up log rotation
11:15 Checks and troubleshooting
Рекомендации по теме
Комментарии
Автор

Thank you for this walkthrough! You’ve made running a node accessible to a beginner. Not much bitcoin reference material online for ubuntu 22 or snap so this is very helpful!

kevin
Автор

What a fantastic walk through! I only had one hiccup on Raspberry Pi 4 (2 TB SSD) with having to run "apt install snapd" after the "apt upgrade". I will now proceed with the next walk through for ckpool. Exciting!!! THANK YOU PHILIP !

timb.
Автор

Thank you for this video and for the ckpool installation videos. I will install these on my Lattepanda Sigma when it arrives

Toresh
Автор

Great video Philip!

Would be useful to go over the config file a bit more - thing like RPC?

Anonymous-gfob
Автор

Thank you very much, this was very helpful!

mordinkainen
Автор

Great vid!! Is it necessary to hace this on a separate drive? Or should i create a partition for this? Or theres no need for that? Thanks !!

inbestprogram
Автор

Windows.Server / Mac Guy - 1st time running through this, . Raspberry Pi 5 with 2TB NVMe Hat - Going to just run Core and Lighning - Have to bring over channel backup thouigh.

selfdefensemall
Автор

hI Phil. so i got a small miner to mine solo btc . we can mine direct using ck pool right ? or we make a node ? what difference ?

rprinku
Автор

after getting to step : "Creating Configuration File", I was unable to edit to match your example. I closed the terminal and when I opened the terminal again and typed "su - btc" to get back to the pervious step it asked for a password. I put in my computers password and it states "su: Authentication failure".
Not sure what to do now

arickthompson
Автор

thanks for this, do you mind sharing how to connect to your own node via an api

danieldarko
Автор

Is there a way that I can download the Bitcoin-GUI then stop the bitcoin daemon that you have shown how to setup here and then start the Bitcoin-GUI using the user btc file directories until the complete blockchain has been download then stop the bitcoin-GUI and then restart the bitcoin daemon so that I do not have to issue all of the command line commands to determine that the complete blockchain has been downloaded?

wakirksey
Автор

hi, im a beginner. the commands for setup the full node in an external ssd are the same. directly from external ssd directory?

casbran
Автор

Is it possible to just run bitcoin core on a raspberry pi 4. The OS on pi 4 is dietpi. The pi 4 is run as headless. I am trying to run both pihole and bitcoin core full node.

greythorne
Автор

Thanks for the video. Can you please make a video on how to make a stratum server to work with the btc node in Ubuntu?

silverdesert
Автор

I'm not sure why I had to do this, but it wasn't working for me with "Type=forking".. I had to change this to "Type=simple". I'm using a raspberry PI btw, running it as the root

uneducated_technologist
Автор

Your tutorial show a full node on the mainnet; how do I change that to testnet; right now I just want to learn rpc api with minimal memory requirements

apieproject
Автор

If I have a external harddrive how to I get bitcoin Core to run on that instead of the internal drive

arickthompson
Автор

Can you make a tutorial running on docker?

pedrobarbosa
Автор

How to get address and secret key of the address ?

arghyabs
Автор

Who helps me install a node of these, please?

javierburgos