Introduction
Changing the port in CasaOS is essential for resolving conflicts, improving security, or customizing network settings. By default, CasaOS runs on port 80, but in this guide, you’ll learn how to change the CasaOS port via GUI and terminal methods.
Step 1: Change CasaOS Port Using the GUI
Watch the step-by-step video here.
- Open the CasaOS dashboard in your web browser.
- Go to Settings > System Settings.
- Find the Network section and locate the port configuration.
- Change the port from 80 to your preferred port (e.g., 9090).
- Click Save & Apply to confirm the changes.
- Restart CasaOS if needed.
If you prefer a manual method, proceed to the next step.
Step 2: Modify CasaOS Configuration File
CasaOS stores its configuration files in /etc/casaos
.
- Open a terminal or SSH into your Raspberry Pi.
- Navigate to the configuration folder:
cd /etc/casaos
- Open the CasaOS main configuration file:
sudo nano casaos.conf
- Locate the line specifying the port (default: 80):
PORT=80
- Change
80
to your desired port, e.g.,9090
:PORT=9090
- Save and exit:
- Press CTRL + X, then Y, and hit Enter.
Step 3: Restart CasaOS Services
To apply changes, restart CasaOS:
sudo systemctl restart casaos
Verify that CasaOS is now running on the new port:
sudo netstat -tulnp | grep casaos
Step 4: Update Firewall Rules (If Needed)
If you have a firewall enabled, allow traffic on the new port:
sudo ufw allow 9090/tcp
sudo ufw reload
Step 5: Configure Remote Access (Cloudflare Tunnel & Tailscale)
If you’re using Cloudflare Tunnel or Tailscale, update the port settings.
Cloudflare Tunnel
Modify your Cloudflare Tunnel configuration:
- Open the Cloudflare Tunnel config file:
sudo nano /etc/cloudflared/config.yml
- Locate the
url
entry and update the port:url: http://localhost:9090
- Restart Cloudflare Tunnel:
sudo systemctl restart cloudflared
Tailscale
Tailscale automatically routes traffic, so no additional configuration is needed. Just access CasaOS using the Tailscale-assigned IP and the new port:
http://100.x.x.x:9090
Conclusion
Changing the CasaOS port improves flexibility, security, and compatibility with other services. Whether using the GUI or terminal, this guide provides a seamless way to configure the port. Additionally, updating Cloudflare Tunnel & Tailscale ensures remote access remains uninterrupted.
📌 Next Steps: Watch our video tutorial for a hands-on walkthrough!
💬 Need help? Drop a comment below !
🔗 Related Guides: