Want to know how to change port on CasaOS? This is the clearest guide you will find online.

Want to know how to change port on CasaOS? This is the clearest guide you will find online.

Changing the CasaOS web UI port involves modifying its gateway configuration file. Ensure you have SSH access to your CasaOS server.

Modify Configuration File

  1. Connect via SSH: Access your CasaOS server terminal.

    ssh your_username@your_casaos_ip_address

    Want to know how to change port on CasaOS? This is the clearest guide you will find online.
  2. Edit gateway configuration: Open the file /etc/casaos/* using a text editor with superuser privileges.

    sudo nano /etc/casaos/*

    Alternatively, use vim:

    sudo vim /etc/casaos/*

  3. Locate and change port: Find the line starting with http_port = (e.g., http_port = 80).

    Want to know how to change port on CasaOS? This is the clearest guide you will find online.

    Modify the port number to your desired value. For instance, to use port 8080:

    http_port = 8080

    Important: Select a port not in use by other services and typically above 1024.

  4. Save changes and exit editor:

    • Nano: Press Ctrl+O, then Enter (to write out), and Ctrl+X (to exit).
    • Vim: Press Esc, then type :wq and press Enter (to write and quit).

Apply Changes

  1. Restart CasaOS gateway service: Apply the new port configuration by restarting the relevant service.

    Want to know how to change port on CasaOS? This is the clearest guide you will find online.

    sudo systemctl restart *

  2. Verify service (optional): Check if the gateway service is running correctly.

    sudo systemctl status *

    Look for an "active (running)" state.

Access CasaOS on New Port

After the service restarts, access the CasaOS web UI in your browser by navigating to your server's IP address, followed by a colon, and the new port number (e.g., your_casaos_ip_address:8080).

Want to know how to change port on CasaOS? This is the clearest guide you will find online.

Firewall Adjustments (If Active)

If a firewall (like UFW) is enabled on your server, you must allow traffic on the new port.

For UFW:

sudo ufw allow YOUR_NEW_PORT/tcp

Replace YOUR_NEW_PORT with the actual port number. Then, if necessary, reload the firewall rules:

sudo ufw reload

Want to know how to change port on CasaOS? This is the clearest guide you will find online.
Share this article: