With the rise of cryptocurrencies, financial privacy has become a hot topic.
Monero is currently the best in the field thanks to the fairly big anonymity set, mandatory privacy for all transactions, ring signatures, Ring CT, stealth addresses, and the future Kovri anonymization network.
Although Monero developers have mitigated most, if not all, privacy risks associated with connecting your wallet to a 3rd party node, to get a piece of mind it's recommended to run your own full node.
In this article, I'll go through steps to install and set up monero on Linux, mainly the latest Ubuntu 18.04 bionic.
However, the steps should be the same for any Debian-based distribution using systemd and fairly similar for other distros with the exception of the package manager (apt).
Sorry, no Mac or Windows.
#1 Update the operating system
First, update the system packages:
sudo apt update && sudo apt-get upgrade
#2 Install dependencies
Make sure you have git installed. If not, do it now:
sudo apt install git
Install the rest of dependencies:
sudo apt install build-essential cmake doxygen graphviz miniupnpc pkg-config libboost-all-dev libcurl4-openssl-dev libgtest-dev libminiupnpc-dev libreadline-dev libssl-dev libunbound-dev libunwind8-dev libzmq3-dev libzmq3-dev libpgm-dev libsodium-dev
libgtest-dev doesn't come as binary on Ubuntu, so you'll have to compile it yourself:
sudo cmake .
sudo make -j2
sudo mv libg* /usr/lib/
#3 Download and build Monero
source directory if you haven't already:
Clone the repository and its submodules:
git clone --recursive https://github.com/monero-project/monero
make -j2 release # -j4 for 4 threads etc
It may take a while to compile depending on your machine.
When finished, copy all the binaries to
sudo cp ./build/release/bin/* /usr/local/bin/
#4 Set up the service
I've written a systemd service that automatically starts the node after a reboot or when crashed.
sudo wget https://gist.githubusercontent.com/mariodian/b8bb62de8f5aa5466cccb17f280f439e/raw/db0a98573e0a8cc871781d8d43f03437ca159e22/monerod.service
sudo chmod 644 monerod.service
Make sure to edit the file to match your environment.
You may want to raise
block-sync-size to a higher number if you run on a decent hardware or omit it completely and let the daemon decide automatically.
My node failed to keep up with the chain height after the April's fork so I had to set it manually.
Next, create a config file:
and add the following lines:
echo "data-dir=/home/satoshi/.bitmonero" >> monerod.conf
echo "log-file=/home/satoshi/.bitmonero/monero.log" >> monerod.conf
echo "log-level=0" >> monerod.conf
If you want to be able to connect your wallet from another machine, add the following:
echo "rpc-bind-ip=0.0.0.0" >> monerod.conf
echo "rpc-bind-port=18081" >> monerod.conf
echo "rpc-login=veryLongAndRandomUsername:veryLongAndRandomPassword" >> monerod.conf
Don't forget to change
rpc-login to your own one.
#5 Run the service
Enable the systemd config and start the daemon:
sudo systemctl enable monerod
sudo service monerod start
You can check the progress with:
tail -f monero.log
or using a simpler output:
monerod --config-file /home/satoshi/.bitmonero/monerod.conf status
The synchronization may take from a few hours to a few days depending on your hardware.
Please be patient.
#6 Allow incoming connections (optional)
You can allow two types of incoming connections to your node: P2P and RPC.
The first one lets other nodes download the chain from you. The latter lets a wallet connect to your node and retrieve info about its balance, transactions etc.
For the P2P connection run this command:
sudo iptables -I INPUT -p tcp --dport 18080 -j ACCEPT
For the RPC:
sudo iptables -I INPUT -p tcp --dport 18081 -j ACCEPT
Save the rules permanently:
If you're behind a router, you will have to forward the ports to your machine.
Please refer to your router's manual.
#7 Connect to the node with your wallet
Now test your connection from your wallet.
If you use the GUI wallet go to Settings and fill out Address and Port.
Next, under Manage Daemon click Show Advanced and type in the RPC login you've set in
In case of using the command line wallet, you may start it with the following:
monero-wallet-cli --wallet-file /path/to/your/wallet --trusted-daemon --daemon-address ip.of.your.node:18081 --daemon-login veryLongAndRandomUsername:veryLongAndRandomPassword
Personally, I prefer the command line wallet because it's cleaner and all you need, most of the time, is really just 3 or 4 commands.
The ones that you will likely use the most are:
show_transfersto view the list of all transactions
integrated_addressto get a receiving address containing a payment ID
balanceto view locked and unlocked balance
transfer <address> <amount>to make a payment
help to access the list of all commands.
As you can tell, setting up Monero full node from source is fairly easy if you have basic knowledge of the Linux command line.
Optionally, to make your node more secure and anonymous, you may want to run it behind torify or torsocks (essentially the same). Unfortunately, I haven't done it myself yet so you'll have to look elsewhere.
All in all, I hope you liked the tutorial.
Please let us know what you think in the comments section below.