How to Change the Port in CasaOS | Step-by-Step Guide

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.

  1. Open the CasaOS dashboard in your web browser.
  2. Go to Settings > System Settings.
  3. Find the Network section and locate the port configuration.
  4. Change the port from 80 to your preferred port (e.g., 9090).
  5. Click Save & Apply to confirm the changes.
  6. 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.

  1. Open a terminal or SSH into your Raspberry Pi.
  2. Navigate to the configuration folder: cd /etc/casaos
  3. Open the CasaOS main configuration file: sudo nano casaos.conf
  4. Locate the line specifying the port (default: 80): PORT=80
  5. Change 80 to your desired port, e.g., 9090: PORT=9090
  6. 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:

  1. Open the Cloudflare Tunnel config file: sudo nano /etc/cloudflared/config.yml
  2. Locate the url entry and update the port: url: http://localhost:9090
  3. 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:

Show Comments (0) Hide Comments (0)
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Stay Updated!

Subscribe to get the latest blog posts, news, and updates delivered straight to your inbox.

By pressing the Sign up button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use