You can use basically any HTTP server to achieve that, like Apache or Nginx. If the directory (specified by the path in the URL) doesn't contain a file that matches the default file in the config (index.html and such), the server will list the directory contents instead.
Selfhosted
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
I use Caddy for all kind of things and it has a very simple file browser built in that can be activated super easily: https://caddyserver.com/docs/quick-starts/static-files
Looks like shown here: https://peterpf.dev/posts/caddy-simple-fileserver/
I did not know Caddy could do that. TIL
Thanks
Those are directory listings. They are the default in apache2 (maybe others as well... I only know apache2), unless disabled or disallowed in the configs (enabled and allowed by default). If the directory you're accessing such as http://192.168.123.123/somedir/ does not contain a default file, such as an index.html, the directory list will be served instead.
Like others said, if you just want to let people download files from your server, use a directory listing.
For my self-hosting though, I use FileBrowser and it's very simple but still works well.
And make sure to not be listed on r/openDirectories without intending it ;)
python3 -m http.server
Read-only, or the ability to edit filenames & upload files?
Read only: as per other answers here, basically any HTTP server. The easiest one I know would be darkhttpd, because it requires no config files and can be run without root.
Read write: I like WFM https://github.com/tenox7/wfm
I built my own https://drkt.eu/files/
https://drkt.eu/files/fileindexer.zip
An...interesting...collection of stuff.
:)
Cockpit has a file browser.
I use yazi via ssh(it beats most file browsers even the gui once with photo preview and such) and before that i was browsing through the casa OS file manager. Casa was my second entry to self hosting
Have you thought of using an ftp server? That dir tree view used to be the default.
Don't recommend using FTP. It's a shitty old protocol that needs to die. Just use nginx or apache with directory listing enabled.
Most Webbrowser Support ftp. So if you setup an ftp server you can access it by typing ftp://[server] as the URL, if you want to do it remote I am legally required to recommend you using ftps
Most Webbrowser Support ftp.
None of the popular web browsers support FTP. Maybe some niche browsers still do, but certainly not "most".
Not anymore.
Chrome removed ftp access.
I believe Firefox followed as well.