NextCloud Port Forwarding for Remote Access
Port forwarding is a critical step to ensure seamless operation and remote access to your private cloud, such as a self-hosted NextCloud instance on an Ubuntu Server. NextCloud, an open-source platform, empowers users to securely manage and access files, contacts, calendars, and more from anywhere. To enable smooth access, especially from external networks, configuring the appropriate ports for forwarding is essential. Understanding which ports are required and how to set them up helps maintain optimal performance while keeping your NextCloud environment secure.
This article will guide you through the ports required for NextCloud to operate efficiently and explain the steps to set up port forwarding on your router. By the end, you’ll have a properly configured network to enable optimal NextCloud functionality.
Understanding Port Forwarding
Port forwarding is a network configuration method that allows external devices to communicate with services on your internal network. For NextCloud to be accessible externally, certain ports must be forwarded from your router to the server running the application. These ports ensure that the web interface, synchronization clients, and other features can operate without interruptions.
NextCloud Required Ports for Remote Access
The following ports needs to be open:
- NextCloud Application: HTTP/HTTPS Ports:
- By default, NextCloud uses ports 80 (HTTP) and 443 (HTTPS). Ensure that these ports are open to allow access to the NextCloud web interface.
- In my case, just port 443 (HTTPS) is opened.
NextCloud Talk Required Ports for Remote Access
NextCloud Talk requires the following ports:
- NextCloud Talk: STUN/TURN Ports:
- NextCloud Talk uses STUN (Session Traversal Utilities for NAT) and TURN (Traversal Using Relays around NAT) servers for establishing direct communication between peers. By default, STUN uses port 3478, and TURN typically uses ports 3478, 5349, or others as specified.
- The High Performance Backend uses a certain range of ports for WebRTC media connections (20000-40000 by default). A client could be behind a restrictive firewall that only allows connections to port 443, so even if the High Performance Backend is publicly accessible the client would need to connect to a TURN server in port 443, and the TURN server will then relay the packets to the 20000-40000 range in the High Performance Backend.
There is a post on NextCloud Forum related to this topic.


QUESTION?
In my case, even though I approved all these ports, sometimes I don’t receive a notification when I receive a message or a call to the NextCloud Talk application on my phone. Do you have an idea of what still needs to be done?
Enhancing Security for Port Forwarding
While port forwarding enables accessibility, it also opens a pathway into your network. Here are some tips to enhance security:
- Enable HTTPS Only:
- Ensure NextCloud operates only over HTTPS to secure all communications.
- Restrict Access:
- Update Regularly:
Conclusion
Setting up port forwarding for NextCloud is a crucial step in enabling remote access to your private cloud solution. By understanding the required ports and properly configuring your router, you can ensure secure and seamless operation of your NextCloud server. Additionally, implementing security best practices will help protect your network and data.
At this link, you can check my security concept for NextCloud Self Hosted installation with ForitGate firewall.
Great post. Thanks!