Change WebUI Port – Ubiquiti EdgeRouter Lite

The below tutorial will walk you through altering the Web UI port on a Ubiquiti Edge Router Lite.
# Log into router via ssh/console
# Enter configure mode
{{{ lang=bash
configure
}}}
# Set the Web UI port; change `8443` to whatever you would like
{{{ lang=bash
set service gui https-port 8443
}}}
# Commit and save
{{{ lang=bash
commit
save
}}}
—–
//If you require access to the Web GUI from an external location, you will need to create a firewall rule to allow the traffic. //
# Create the firewall rule to allow inbound traffic on port 8443
{{{ lang=bash
edit firewall name WAN_LOCAL rule 50
set description “Inbound traffic to WEB GUI”
set action accept
set log disable
set protocol tcp_udp
set destination port 8443
}}}


Posted

in

by

Tags:

Comments

23 responses to “Change WebUI Port – Ubiquiti EdgeRouter Lite”

  1. UBNT-stig Avatar
    UBNT-stig

    While editing the template file will work, it’s better to just use the CLI to change it. No reboot required.

    configure
    set service gui https-port 8443
    commit
    save

    1. dlasley Avatar

      Awesome thank you; I have updated the post. +1 for Ubiquiti support!

  2. Nick Avatar
    Nick

    Made the above changes to change the webgui port, can access the gui locally, but now cannot access the webGUI via the internet, is there something else that needs to be done?

    1. dlasley Avatar

      Yes – you will need to create a firewall rule to allow inbound traffic on the specified port. I have updated the tutorial to reflect this.

      1. Nick Avatar
        Nick

        Thanks, Worked like a charm

    2. Stan Avatar
      Stan

      I made the same change and cannot get back into the router. How do you access GUI locally? Did you specify the port? I tried all combinations and can’t get back in. I don’t have my configuration backed up so I don’t want to reset the router. Any ideas?

      1. Dave Lasley Avatar

        Hi Stan – You should be able to access the UI by going to http://ROUTER_IP:8443

        1. Brian Avatar
          Brian

          I followed the steps and I can’t figure out how to get back into the router either.

          I can ssh but cannot get into the router GUI either thru Lan or Wan 443 or 8443?

  3. Tim Pozar Avatar

    Slight correction in the firewall rule.

    Change:
    edit firewall WAN_LOCAL rule 50

    To:
    edit firewall name WAN_LOCAL rule 50

    1. Dave Lasley Avatar

      Good catch, thanks for posting it! I went ahead and updated the article :)

  4. Won Avatar
    Won

    Great article. I followed the steps and everything works great. I want to create a similar firewall rule to enable SSH remote management access. Would I just do something like this?:

    edit firewall name WAN_LOCAL rule 60
    set description “Inbound traffic to SSH Management”
    set action accept
    set log disable
    set protocol tcp_udp
    set destination port 22

    1. Dave Lasley Avatar

      Great to hear that the tutorial worked! You are correct in regards to the creation of the new firewall rule, although I would recommend `set protocol tcp` instead of `tcp_udp` as SSH does not require UDP for operation ;)

      1. Won Avatar
        Won

        Awesome! I throught the firewall rule on (and set the protocol to TCP only as suggested–duh!) and works like a charm. Love your EdgeRouter tutorials. Thanks!

        1. Won Avatar
          Won

          LOL, I guess I was overly excited. “I threw the firewall rule on[…]”

  5. george kramer Avatar
    george kramer

    How do I disable wan gui management?

    1. Dave Lasley Avatar

      In most setups, you should already have a firewall blocking access from the WAN. If you do not, you can use the rule above by switching `action accept` to `action deny`.

  6. Kyle M Avatar
    Kyle M

    Hi, Dave! So I’ve just followed your guide to change the default port WebGUI port on my edgerouter, but i can’t seem to connect to it now via web. I can SSH into the device though. Here’s a copy of my firewall config, maybe I entered something wrong?

    Thanks!

    1. Kyle M Avatar
      Kyle M

      Actually, I’ve followed the steps posted by Stig, and that worked for me!

      1. Dave Lasley Avatar

        Well that was easy ;)

        Glad you got it working!

  7. Xander Robar Avatar

    Thanks for posting Dave, very helpful!

  8. kt Avatar
    kt

    After folling this example I can only access the router locally with the port designation attached to the router ip. How do I reverse this since my backup config wont load?

  9. Fuad Avatar
    Fuad

    Thank you very much for the post. It works great. Do you know how to set/enable the “service-gui” port in GUI also instead of CLI?

    1. Dave Lasley Avatar

      As far as I know, there is not a way to change the WebUI port from the WebUI itself. According to the forums (https://community.ubnt.com/t5/EdgeMAX/EdgeMax-Lite-Change-Web-GUI-Port-Access/m-p/1035879/highlight/true#M43723), it has been discussed but was not implemented.

Leave a Reply to Nick Cancel reply

Your email address will not be published. Required fields are marked *