how to access nas from outside network
A million ways.
One of the safest, run a VPN server (free in most cases) on your router, but it depends on your ISP.
Or via the myQNAPCloud.com portal if you have it set up there. Some people don’t like to do it that way but it works. But the best and fastest is via a VPN on your router.
Wireguard on compatible router or Raspberry Pi. Tailscale on the NAS itself.
To downplay the answers given, a VPN on your router is better because:
A) It doesn’t rely on QNAP servers being operational and secure
B) It runs on an edge device in your LAN (i.e. router). not a device already inside with questionable security history (NAS).
C) It provides (secure) access to ALL resources within your home network such as all file servers, printers, scanners, switches, cameras, etc, not just the QNAP device
(Raspberry Pi would be my second choice)
As I said originally, there are a million options well covered by a google search as this is well discussed over many years and is a general, not NAS-specific question.
Also, not knowing your NAS model, firmware version, router or ANYTHING at all about your ISP or LAN setup, knowledge/skill level, or what you are willing to spend in time learning or money makes it impossible to give a proper answer.
Thank you very much. Let me try to use VPN.
My device: Model No. TS-431X
There are a number of advantages to running a VPN server on a dedicated device like a RPI…
Separation reduces the risk that a router firmware update or misconfiguration compromises VPN availability.
Router firmware often lags behind in VPN updates.
A Pi 4/5 can handle WireGuard at hundreds of Mbps with proper tuning whereas router implementations are often limited by CPU resources.
Ability to run the VPN in a DMZ exposing only the Pi, not the NAS or the router directly.
Expandability such a pi-hole and ddns updates.
Misconfigure WireGuard on your Pi, your router and internet connection still function normally but breaking WireGuard on the router could knock out your WAN or firewall rules.
Pricepoint!
Indeed there are advantages. However, for many people with a “current” router, it is easier (and slightly cheaper) and you avoid the RPi learning curve. It is one less device to have running, and one less thing to figure out the configuration for.
I agree 100% that it is worth the effort to learn and setup the RPi, but in many cases there is nothing wrong with the easy and free solution, if you router has it already built in.
Also in response to your downplay…
WireGuard on Linux (including Raspberry Pi) is widely documented with many guides, scripts, and support communities.
You can move the Pi setup to another network with minimal disruption (just plug into LAN).
Router-based WireGuard may tie you to specific hardware/firmware, making migration harder.
I highly recommend MikroTik routers. Incredibly flexible and built in WireGuard. Works very well. Router setup itself can be complicated but there’s a very good forum with a lot of users who can help.