Skip to content

Instantly share code, notes, and snippets.

@jancel
Forked from tannerdsilva/hostXMRNode.md
Created February 18, 2024 01:05
Show Gist options
  • Select an option

  • Save jancel/bd26b984f56069ffdf5eda09d18d75c8 to your computer and use it in GitHub Desktop.

Select an option

Save jancel/bd26b984f56069ffdf5eda09d18d75c8 to your computer and use it in GitHub Desktop.
How To Build And Host a Monero Node from Source

How To Built And Host a Monero Node from Source

Hello. In this document, we will walk through the steps of building and hosting your own Monero node from source on a Debian-based Linux system. These systems including Raspbian, Debian, and Ubuntu. This tutorial assumes that you are capable of accessing the ROOT terminal of your Debian-based system, and are capable of getting your system online if necessary. You may plan on using an external storage device to store the blockchain, this tutorial will include the optional steps to support external storage if necessary.

Here are some useful links for reaching this prerequisite if you do not currently have access to a Debian-based system that meets the recommended system requirements for monerod.

How to spawn a VPS in the Linode Cloud Platform How to spawn a VPS in the Digital Ocean Cloud Platform Getting started with the Rhaspberry Pi

Recommended System Requirements

  • OS: Debian-based Linux

  • RAM: 1GB

  • CPU: 1 CORE

  • Storage: > 150 GB (internal or external)

1. Getting Started

Now that you have access to the terminal of your Debian-based system, we can begin setting up the monerod node. Lets start by confirming that your are currently the root user.

THIS TUTORIAL ASSUMES THAT YOU WILL REMAIN THE ROOT USER FOR THE ENTIRETY OF THE SETUP PROCESS

$ whoami

If the result of this command is root, you may proceed with the tutorial. If you are not the root user, it is highly recommended you log in as root using either su or sudo su before proceeding with the tutorial.

Additionally, you may confirm the connectivity of your device by checking your external IP address.

$ curl ifconfig.me

The result of this command should be your external IPv4 address.

2. Downloading Software

Lets install the necessary packages that we will need to operate and set up monerod. First, we will update our package manager and install a few basic utilites such as nano and git

$ apt-get update
$ apt-get install -y nano git

Next, lets download the Monero source code and enter the root directory of the source code

$ cd /root
$ git clone 'https://github.com/monero-project/monero.git'
$ cd monero

...and change to the latest release of the source code...

$ git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
$ git submodule init
$ git submodule update

Now, we will install the required packages to build the Monero source code. As of v0.17.1.8, Monero requires the following packages...

$ apt-get install -y build-essential cmake pkg-config libboost-all-dev libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libldns-dev libexpat1-dev doxygen graphviz libpgm-dev qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev

These dependencies may change with future updates. You can confirm that you have all package dependencies by viewing the Compiling Monero from source -> Dependencies section the README.md file.

$ cat ./README.md

Alternatively, you can view the README file on a web browser.

3. Building

Now it is time to build the Monero source code. This command will use the full capacity of your systems CPU so you wont wait as long.

$ cd "$(make -j $(nproc) release | tail -1 | grep -oP '(?<='"'"').*(?<!'"'"')')"

Verify that the build worked by running the following command and verifying that the output is ZERO.

$ echo $?

Congratulations! You have successfully built your first Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment