Changing the CasaOS web UI port involves modifying its gateway configuration file. Ensure you have SSH access to your CasaOS server.
Modify Configuration File
-
Connect via SSH: Access your CasaOS server terminal.
ssh your_username@your_casaos_ip_address
-
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/*
-
Locate and change port: Find the line starting with
http_port =
(e.g.,http_port = 80
).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.
-
Save changes and exit editor:
- Nano: Press
Ctrl+O
, thenEnter
(to write out), andCtrl+X
(to exit). - Vim: Press
Esc
, then type:wq
and pressEnter
(to write and quit).
- Nano: Press
Apply Changes
-
Restart CasaOS gateway service: Apply the new port configuration by restarting the relevant service.
sudo systemctl restart *
-
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
).

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