I'm looking for a way to access my devices files in Firefox. The reason for this is I want to use an extension to read *.md file.

I know that I can use file:/// to access files, but the extension can't use this way. The only way is to use localhost. I have searched around but have only found talk about accessing the PC via localhost. I want to access the local android files.

Here is the link to the extension I want to use: Markdown Viewer

  • I think, files you can see with file:/// URLs. – peterh Feb 14 at 18:21

If you need localhost, than run a web server on your Android and bind it to loopback address. There are many apps on Play Store that can run a web server. I just tested out HTTP Server powered by Apache and it works fine.


  1. Install and launch it.

  2. Grant Storage permission/access.

  3. Download an Apache version. The latest version comes with the app and would be marked with X sign next to it. Tap on that entry once to install that version.

  4. Afterwards, go to the section Server address & port → Change:

    • Server Address:
    • Server Port: 8080 (or anything above 1024)
    • Fallback action: Stop
  5. Start Server. The server's home directory is /sdcard/htdocs/public/, so move your directories under public directory.

  6. Setup your addon in Firefox and add under Allowed Origins as mentioned here.
  7. Load your file in Firefox by using the address ` The extension should work now.

Replace PORT with the port you used for the server. Replace PATH with the path of your directory/file relative to public directory. So, if file is under /sdcard/htdocs/public/testing/readme.md, the PATH should be testing/readme.md.

Note: for some reason the addon sometimes load, other times it just shows a blank page when trying to load README.md.

enter image description here


After playing around a little and trying out some options (especialy from Firelord), I decided to actually try to use file:///, and to my great surprise it worked, even though the instructions for the add-on says it doesn't.

So to answer the question, you can access the files by using file:///. This is much easier then having to install and setup another app.


Well you can do this by simply installing Apache Web Server in Termux. So after installing Termux. Do the following steps:-

  1. apt update && apt upgrade -y

  2. apt install apache2

It will install Apache Web Server in your Termux Then do apachectl start it will start the Apache server.

You might see a Warning like this:-

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Set the 'ServerName' directive globally to suppress this message

To correct this : just uncomment the line 221:

which says # ServerName www.example.com:8080

And then place your /sdcard in your web root:


by doing

cp -r /sdcard /data/data/com.termux/files/usr/share/apache2/default-site/htdocs/

Then point to: in your browser.

Now, you will be able to access your files in your browser.

  • I would like to be able to access the sdcard on a steady basis. Besides that copying it takes a long time, and waists a lot of space. – Sruly Feb 18 at 23:45
  • 1
    @Sruly It will not actually copy /sdcard instead it will create a symlink like this:- sdcard -> /storage/self/primary in your webroot and it takes no time and extra space – daya Feb 19 at 5:49
  • OK thanks that clarifies it. I thought because of the -r that it copies it, thanks for the clarification. – Sruly Feb 20 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.