How do I make port 18080 open for incoming connections on my router on Linux (Ubuntu 16.04) for running the Monero daemon?

I don't have access to the physical router in my building that I use for wireless connection to the Internet and I am wondering if I can do so using Ubuntu 16.04.

2 Answers 2


The methods to open ports are specific to the router you have. You don't need physical access to the router, just access to the routers web admin interface. So, I suggest you search for your specific router model and instructions, if this is your own router.

If you are on a non-configurable network like a public WiFi, instead you need to ask the Internet provider to open the port for you.

If you need to configure the Ubuntu firewall, you can install iptables plus ufw and open the 18080 port on the firewall with the directive ufw allow.


As @jtgrassie already mentioned, ufw is one of the tools that allows you to manage your ports. It is convenient to use ufw in a script, in conjunction with a cronjob, that automates the opening and closing of the port. I find such script particularly useful when I may want to temporarily stop my monerod for the sake of freeing my computer's resources (CPU/RAM/bandwith). And so the following script opens and closes port 18080 for you.

/usr/bin/pgrep -f /home/jerzy/monero-x86_64-linux-gnu-v0.17.2.0/monerod
#The following ifs deal with monerod when it is running.
if [[ "$?" == 0 ]]; then

 /usr/sbin/ufw allow 18080 && /usr/sbin/ufw reload

 /usr/sbin/ufw deny 18080 && /usr/sbin/ufw reload

Please remember to replace /home/jerzy/monero-x86_64-linux-gnu-v0.17.2.0/ with the path to monerod on your computer. Once you've made your script executable with sudo chmod 755 name_of_the_script.sh than proceed to schedule its execution by cron: sudo crontab -e and appending the following line:

* * * * * /path_to_the_script.sh

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.