Monero is the current gold standard for private cryptocurrencies. Unlike Bitcoin, it allows you to easily and seamlessly transact value online without any visible record on the Monero blockchain, so users often prefer Monero for transactions they want to be anonymous. Here, we show you how to install a Monero node, set it up for streaming over Tor, and connect it via a mobile wallet.
Why Host Your Own Monero Node?
One problem with Monero is that if you use it through a mobile wallet, your current location can be revealed through your IP address. Not only that, but it's also possible for a malicious node operator to eavesdrop on your transactions if you don't use your own node.
One way to address this issue is to host your Monero node through Tor. Similar to hosting a hidden website, doing this will ensure that any connection you make is private and that you can host your node even in a CG-NAT network.
Monero node installation
Before you can install Monero, you need to make sure you have the following resources available and ready:
- A device that is constantly connected to the internet. This could be an old computer in your home or a VPS server you're currently renting.
- A generous amount of hard disk space And the memory on your device. For the most part, a 1TB hard drive and 8GB of RAM should be sufficient to accommodate the entire Monero blockchain.
- Root access to your device, because installing Monero node will require you to configure and modify system files.
This tutorial was created on a Ubuntu 22.04.1 LTS, although the steps for other Linux distributions are similar.
Get Monero
Get a copy of the latest Monero binaries. By default, the current version of both the Monero daemon and the client are not available as installable packages in apt.
- Download the A copy of the latest binary program From the developer's website using the following command:
wget https://downloads.getmonero.org/cli/monero-linux-x64-v0.18.1.2.tar.bz2
- Create New evidence To extract and run the Monero daemon:
mkdir monero && cd monero
- Extract Monero Archive To your new guide:
tar xvf ./monero-linux-x64-v0.18.1.2.tar.bz2 && cd ./monero-linux-x64-v0.18.1.2
Monero node sync
You'll find a number of binaries in the "monero" directory. To initialize the daemon, run the following command:
./monerod --detach
This command will create all necessary files and folders for Monero in the current user's home directory, completely detaching itself from the currently active terminal process and syncing quietly in the background.
In most cases, synchronization with the Monero blockchain can take one to three days, as the block validation process for this blockchain is CPU-intensive. For example, my Core2Duo took four days to fully synchronize with the network.
Install Tor and create a hidden service
Once you have a working node, start configuring it to work over the Tor network.
- install Tor With its own facilities:
sudo apt install tor torsocks
- Create New hidden service entry For Monero node by editing the file “/etc/tor/torrc” Using your favorite text editor:
sudo nano /etc/tor/torrc
- Look for Section In the configuration file for hidden services, click on Ctrl + W , then write “HiddenServiceDir”.
- Add New Service Manual and Port To allow Tor By passing any listening programs on the local machine to the Tor network by adding the following lines of code in the file: “/etc/tor/torrc” your:
HiddenServiceDir /var/lib/tor/monero/ HiddenServicePort 18081 127.0.0.1:18081
- Restart Tor Hidden to apply your new settings:
sudo systemctl restart tor
Configure your node to use Tor
-
- Make sure the program is stopped. Monero daemon Exactly by running the following commands:
cd /home/$USER/monero/monero-linux-x64-v0.18.1.2 ./monerod stop_daemon
- Create and modify the daemon configuration file:
nano /home/$USER/.bitmonero/bitmonero.conf
- Add the following lines of code to your configuration file:
rpc-bind-ip=0.0.0.0 rpc-bind-port=18081 restricted-rpc=1 rpc-login=ramces:everysecurepassword no-igd=1
- The two options “rpc-bind-ip” و “rpc-bind-port” They tell the Monero node where to broadcast its service. In this case, you're telling it to broadcast all interfaces on port 18081.
- The option tells rpc restriction The node will ask for a password whenever a client tries to connect to it.
- Appoints “rpc-login” The username and password for this Monero node. In my case, I set the username to Ramses And the password is on “averysecurepassword”.
– Tells value “no-igd” The node disables UPnP, which prevents the node from accidentally broadcasting its real IP address over the Internet.
- Save Configuration file by pressing Ctrl + O ثم Ctrl + XRestart the hidden program by running .
- Make sure the program is stopped. Monero daemon Exactly by running the following commands:
./monerod –detach.
Connect your node to your mobile wallet
With your node up and running over the Tor network, test it by pairing it with a mobile wallet. By default, Monero's developers designed their cryptocurrency to be as modular as possible, making it easy to connect multiple wallets together to a single node that provides all blockchain data.
- Download a mobile wallet. In my case, I'll use Monerujo, because it supports Tor connections By default.
- Install a Tor client on your device. To do this, you can: Download Orbot of Play Store.
- Open Orbot and click the . button Tor-Enabled Apps At the bottom center of the screen.
- Scroll through your list of apps and select the checkbox below Monerujo.
- Go back to the previous screen and click the button. "Start". This will create a network. VPN Small force Monerujo to connect to the Internet using Tor.
Connect Monerujo to your Tor node
Once Monerujo uses the Tor network, you can connect your Tor-only Monero node to your mobile wallet.
- Open Monerujo app Click on the section "The network".
- Click on “+” icon in the lower right corner of the application.
- This will open a small window where you can provide your Monero node details. For the first item, you need to provide both the node's .onion address and its port number. You can quickly check your node's .onion address by running the following command:
sudo cat /var/lib/tor/monero/hostname
- You also need to provide both the username and password for the node's RPC client. In my case, I'll use Ramses As my username and “averysecurepassword” As my password.
- Click the button "a test" In the lower left corner of the window to check if your wallet can successfully connect to the node.
- Click the button "OK" To save and contact your contract details.
Frequently Asked Questions
Q1. Is it possible to speed up the blockchain synchronization process?
answer. Yeah. Get a copy of the entire blockchain From the developer's website, then import the external blockchain by navigating to the Monero folder and running
./monero-blockchain-import --input-file /home/$USER/Downloads/blockchain.raw
.
Q2. Can you connect your Monero desktop wallet to a remote node?
answer. To connect your desktop CLI wallet to a Tor node only, ensure that this wallet can access the Tor network by installing and running torsocks .
In the current station session followed by:
./monero-wallet-cli --daemon-address address.onion:18081
.
Q3. I can't connect to my Tor-only Monero node. How can I fix this?
answer. This issue is likely caused by a firewall issue on your node device. By default, Monero's RPC port should be open, regardless of which firewall software you use. However, there are instances where you may have accidentally blacklisted all unknown ports from your system while setting up your firewall.
To fix this issue, explicitly tell your firewall to keep port 18081 open at all times. For example, you can run ufw allow 18081/tcp
To tell the ufw program to allow any incoming RPC connections.