How do I connect my iPhone/iPad to a remote SMB server?

All programs I’ve tried fail to do this, unless I’m on the local network. On a Mac I can connect to my remote server just fine…

That makes total sense unless you make the local server available to the internet via a port forward or NAT on your router.
It is not the recommended way to do it anyway because protocols like SMB are supposed be local and no public. The right way to do it if you want to have access to you SMB server at home while you are out an about is to have a VPN server that you can connect back to.
By the way, the Files app can connect to SMB servers and I had no issues with it connecting to a Mac mini.

I don’t know if there is a step by step tutorial out there but you can try a search like this:

https://duckduckgo.com/?q=kylemanna+openvpn+docker+setup&t=h_&ia=web

Once you have Docker for Mac setup and running you should use this container.

Docker for Mac is a drag and drop installer and it has a setup wizard on the first run that shows you how to run a ‘hello-world’ container. Once you completed that, the second container you want to run is ‘kylemanna/openvpn’, you can search for it in the Docker app.

In the link for the container they explain the different setup options. Basically you need to open the Terminal app and run those commands in order.

The key for me was that I needed to add .local after the servername:

Files → 3 dots → Connect to Server

smb://servername.local

(note: may be case sensitive?)

enter username and password. Without the .local I get an error about unable to connect to socket for some reason.

For some reason I can’t connect via Files app, how can I make a VPN? Is there a simple guide to it?

Ok thanks I’ll try it

You rock! Was wondering why I was getting the socket error! .local saved the day!! Thank you!

Does the Files app work when you are connected to your local network?

Also, you mentioned your mac can connect. Is this only on the local network or you have also try while your mac is connected to the internet somewhere else?

Just trying to get all the details.

The easiest way to create a VPN in my experience is to use a raspberry pi, there is a script that does all the setup for you, gives you one file that you can email/airdrop to your phone or ipad, and then you install the free OpenVPN app from the app store and are good to go. Well, not really, the only step that can’t be automated is opening a port on your internet router to get your VPN traffic out into the internet, here I’m assuming you have at least one router/modem from your ISP that is acting as a firewall (that must be the case for 99% of ISP routers these days).

If you just want access to your files but SMB is not mandatory, you could checkout projects like ownCloud that you can run for free at home.

Files app works on local network for .local addresses, but not for the remote address

Connecting via Finder works on a MacBook even with another network

From my quick Googling, the VPN solution is something I should try but as it is the end of the month, I don’t have much money to buy OS X Server to make a VPN.

You can also just buy the cheapest raspberry Pi and install Pi VPN on there.

And when you connect with Finder from an external network, what address are you using? Do you have a dynamic dns setup for the server? Or use your external IP address?
I can’t imagine how that is working. Apple used to offer a Back to my Mac service that has been shutdown for over a year.

OS X server is like 20$, the cheapest raspi here is around 35$. I don’t see the Raspi being worth it as I already have a MacBook running as a server

I used the external IP address for connecting

You don’t need OS X server for a VPN. Install Debian in VirtualBox, setup OpenVPN inside the VM and you are good to do. I had mine like that for years.
Another even easier option, install Docker and get a container with OpenVPN. It is like a virtual machine but what you need is preinstalled.

The only way that could work is if you are already forwarding the necessary ports on your router to your server, or your server is publicly available on the internet (not behind a firewall).

Do you have to include a port number after the IP address to connect?

You may not need to do that if Finder is taking care of that for you (for example when you do Command-K to connect to a server you only have to specify the protocol but not the port number).

You can go here https://canyouseeme.org/ and check if have open ports 445 and 139 which are the ones SMB uses.

Aren’t those pretty heavy tho? The Mac is only a dual core, and I still need power left for a Minecraft server and simple machine learning tasks

Not really. OpenVPN only uses the CPU when you are actually encrypting traffic. And it is not multi threaded so there is a limit to how much CPU it can use.

A docker container would use less RAM than a VM because the OS it loads it’s more streamlined than a general purpose OS like Debian.

Is there a tutorial on setting up OpenVPN on Mac with docker? Like a full tutorial for noobs?

I got OS X Server, but appereantly they’ve removed VPN server from it ._.