Method 1) A one-time start of monerod
You can use 'screen' to keep it running when you log out.
Ubuntu: apt-get install screen
CentOS: yum install screen
screen monerod --rpc-bind-ip <your external IP address> --rpc-bind-port 18089 --restricted-rpc --confirm-external-bind
Replace with the IP address of your VPS.
When monerod is running inside of screen, you can press Control-a-d
to detach from the screen session and return to the command line. You use screen -r
to reattach to the session.
Method 2) Keep monerod running perpetually
Create a new blank file called monerod-cron
and add the following line. Be sure to enter the full path to your monerod binary and your external IP address.
0 * * * * <full/path/to/monerod> --detach --rpc-bind-ip <your_ip> --rpc-bind-port 18089 --restricted-rpc --confirm-external-bind
Example:
0 * * * * /usr/local/bin/monerod --detach --rpc-bind-ip 100.22.33.44 --rpc-bind-port 18089 --restricted-rpc --confirm-external-bind
Save the file and load it into your crontab by running crontab monerod-cron
. This will start monerod automatically every hour. If monerod is already running, it will not start a second copy.
To view the monerod logfile:
tail -f ~/.bitmonero/bitmonero.log
To view the crontab logfile:
tail -f /var/log/cron
Notes
Your firewall will need to accept incoming connections to TCP port 18089.
There's some more info at https://moneroworld.com/#nodes