Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

macstatic

macrumors 68020
Original poster
Oct 21, 2005
2,023
164
Norway
Is it possible to view local web documents on an iPad (iPadOS 16)?
From what I can tell (own experience and forum discussions etc) there's no support for this in Safari.
And if I transfer a folder (containing my HTML, CSS and JS documents) over to the "Files" app I can open the HTML document, but apparently at a very basic level, skipping the CSS etc.

Likewise, I've figured out how to connect my iPad locally so I can access my Mac's files, but again I can't do any more than basic reading of the HTML file. So is there another solution for checking out web pages (without first having to make them available online) on an iPad? It would be useful to check out how my website will work in Safari in iOS/iPadOS while developing it).
 

Boyd01

Moderator
Staff member
Feb 21, 2012
7,947
4,879
New Jersey Pine Barrens
I was looking for a web server to run on iOS/iPadOS as part of a project but didn't find anything to do quite what I wanted. There are some good solutions for Android, but the main issue I found with iOS/iPadOS is that none of the apps will work in the background. So, you can serve your site but can't open it in Safari because the server stops.

This app has a built-in browser so you can do everything in the app. Didn't do what I wanted, but might work for you.

 
Last edited:

casperes1996

macrumors 604
Jan 26, 2014
7,593
5,764
Horsens, Denmark
I mean, if it's just to try it on the iPad but you still develop on your Mac or whatnot, you can just use Safari to connect to your local IP of your Mac where the webserver is presumably running for testing. Like
192.168.1.xxx:yyyy
You can option-click the Wi-Fi icon in the menu bar to quickly get your IP (assuming you run on Wi-Fi, otherwise check ifconfig

If it's a simple setup you can even just quickly expose the file with netcat
nc -l 80 < file.html
Then it'll be available for local network HTTP (not S) connections - single fire, wrap in while true; do; if you want it continuously available.
 

Boyd01

Moderator
Staff member
Feb 21, 2012
7,947
4,879
New Jersey Pine Barrens
I got the impression the OP wanted a stand-alone solution for the iPad. Otherwise, sure, you can just access the site over wifi on your LAN if you're running a server on your Mac. I use MAMP for that myself.

Have to say though, Android really has an edge when it comes to this kind of thing. I have installed Termux on a couple inexpensive Android phones and a tablet. It's a surprisingly robust Linux subsystem and you can install most of the standard tools. The result is an environment almost the same as the Linux internet server that I lease, I access it with ssh and copy files with sftp. A bit complicated to setup, but I have it running in the background with Apache and SSL with my complex GPS/mapping web app. The site and nearly 1tb of content are on an SD card.

I can access my web app on the same device with Chrome where it works just the same as the real site on the web. I can also connect to it from my Mac, iPhone and iPad on wifi. Performance is surprisingly good, but there are some "gotchas" so it's not easy. Spent awhile working on this last year but had to move on to other things. But it's something I'll get back around to. A cheap Android phone can literally be a webserver in your pocket. :)
 

casperes1996

macrumors 604
Jan 26, 2014
7,593
5,764
Horsens, Denmark
I got the impression the OP wanted a stand-alone solution for the iPad. Otherwise, sure, you can just access the site over wifi on your LAN if you're running a server on your Mac. I use MAMP for that myself.

Have to say though, Android really has an edge when it comes to this kind of thing. I have installed Termux on a couple inexpensive Android phones and a tablet. It's a surprisingly robust Linux subsystem and you can install most of the standard tools. The result is an environment almost the same as the Linux internet server that I lease, I access it with ssh and copy files with sftp. A bit complicated to setup, but I have it running in the background with Apache and SSL with my complex GPS/mapping web app. The site and nearly 1tb of content are on an SD card.

I can access my web app on the same device with Chrome where it works just the same as the real site on the web. I can also connect to it from my Mac, iPhone and iPad on wifi. Performance is surprisingly good, but there are some "gotchas" so it's not easy. Spent awhile working on this last year but had to move on to other things. But it's something I'll get back around to. A cheap Android phone can literally be a webserver in your pocket. :)

There's also something called iSH for iOS/iPadOS that will allow you to run an Alpine Linux container. You get a full Linux command line in a virtualised environment. There's a fair bit of overhead to it, but it works. iOS also imposes some fairly strict limitations on background execution so you can't easily just have a continuously running process with it like a web server but it allows you to fool around a little at least. And for iPad you can use Stage Manager to have it always running that way in the background
 
  • Like
Reactions: Boyd01

Boyd01

Moderator
Staff member
Feb 21, 2012
7,947
4,879
New Jersey Pine Barrens
I installed ish awhile ago and thought about mentioning it, but didn't because of the performance issues. Certainly worth a try though. Didn't do much with it myself, the multitasking restrictions would appear to be a deal-killer for my own use. That worldwideweb app I mentioned above is also supposed to run in the background on iPadOS. Tried that and didn't like it, IIRC it starts to beep continuously while running in the background. Apparently this is meant to warn of possible battery drain?

I should play around with ish some more. Still using a 2018 iPad, so these things probably work better on new hardware. Have been very impressed with Linux on Android though (it doesn't run natively, it's a task under Android). The performance is quite good on my cheap (~$100) phones, even with more than one device accessing it as a server. And, of course, the ability to put the site on a SD card is a plus.

In addition to Termux, there are a variety of other ways to get Linux on Android such as Linux Deploy.
 
  • Like
Reactions: casperes1996
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.