Skip to main content

Light local file sharing with a calm browser workspace

Project description

LitheServer logo

Light local file sharing with a calm browser workspace.

中文 | English

LitheServer

LitheServer is a lightweight local file server for the moments when you just want to share a folder, open it in a browser, and get on with your work.

It keeps the small, no-fuss feel of python -m http.server, but adds the things people actually reach for in practice: browser upload, inline preview, better navigation, sorting, and simple file actions.

Screenshots

Homepage

LitheServer homepage

Preview Panel

LitheServer preview panel

中文

如果你经常只是想把一个目录临时开出来,让手机、平板、另一台电脑,或者局域网里的同事直接在浏览器里上传、下载、查看文件,那 LitheServer 就是为这种场景做的。

它想做的不是一个很重的“全能文件管理器”,而是一个更顺手的本地文件服务器:

  • 启动要简单
  • 浏览器里就能完成大多数操作
  • 看起来清爽,不折腾
  • 不引入额外 Python 依赖

适合什么场景

  • 临时共享当前目录
  • 给手机或平板传文件
  • 在浏览器里快速预览文本、图片、PDF
  • 在受信任的局域网里做轻量文件工作台
  • 替代 python -m http.server 这种过于原始的目录列表页

目前有什么

  • 零依赖:只使用 Python 标准库
  • 一个命令启动服务
  • 浏览器上传文件
  • 点击文件夹名直接进入目录
  • 点击文件名直接在右侧预览
  • 文本文件语法高亮
  • 图片和 PDF 内嵌预览
  • 其他文件类型显示文件信息和下载入口
  • 文件下载、文件夹 ZIP 下载
  • 重命名、删除、移动、新建文件夹
  • 文件夹优先排序
  • 隐藏文件默认折叠,可手动显示
  • 桌面和移动端都能使用

快速开始

python -m pip install litheserver

# 直接服务当前目录
litheserver

# 指定端口和目录
litheserver -p 8080 -d /path/to/folder

启动后访问终端里打印出来的地址即可。

命令行选项

litheserver [options]

Options:
  -p, --port PORT        Port to serve on (default: 8000)
  -d, --directory DIR    Directory to serve (default: current directory)
  --host HOST            Host to bind to (default: 0.0.0.0)
  --version              Show version
  -h, --help             Show help

使用方式

  1. 启动服务后,在浏览器打开 http://localhost:8000 或终端中打印出的局域网地址。
  2. 点击文件夹名进入目录。
  3. 点击文件名,在右侧预览面板查看内容。
  4. 通过右侧 action 按钮下载、重命名、删除、压缩下载等。
  5. 顶部支持搜索、排序、隐藏文件切换。
  6. 拖拽文件到上传区,或者点击上传区选择文件。

预览支持

  • 文本文件:语法高亮预览
  • 图片文件:直接预览
  • PDF:浏览器内嵌预览
  • 其他文件:显示文件信息并提供下载入口

没有扩展名但本质上是文本的文件,也会尽量按文本预览。

安装源码版本

git clone https://github.com/xyanmi/litheserver.git
cd litheserver
python -m pip install .

注意

  • LitheServer 更适合个人使用、临时共享和受信任的本地网络环境。
  • 它不是面向公网暴露的重型文件服务,也没有做复杂鉴权。
  • 如果你只是本机使用,可以显式指定:
litheserver --host 127.0.0.1

English

LitheServer is for the very common case where you want to expose a folder, open it in a browser, and immediately upload, download, or inspect files without setting up a heavyweight file manager.

It stays small and dependency-free, but gives you a much better day-to-day experience than a raw directory listing.

Good Fit For

  • Quickly sharing the current folder
  • Sending files to a phone or tablet
  • Browsing files from another device on the same LAN
  • Previewing text, images, and PDFs in the browser
  • Replacing python -m http.server with something more practical

Features

  • Zero dependencies: Python standard library only
  • One-command startup
  • Browser upload
  • Click folder names to enter directories
  • Click file names to open the right-side preview panel
  • Syntax highlighting for text files
  • Inline image and PDF preview
  • File info + download fallback for other file types
  • File download and folder ZIP download
  • Rename, delete, move, and create folders
  • Folder-first sorting
  • Hidden files are hidden by default, with a toggle to show them
  • Works on desktop and mobile browsers

Quick Start

python -m pip install litheserver

# Serve the current directory
litheserver

# Serve a custom folder on a custom port
litheserver -p 8080 -d /path/to/folder

Then open the address printed in the terminal.

CLI

litheserver [options]

Options:
  -p, --port PORT        Port to serve on (default: 8000)
  -d, --directory DIR    Directory to serve (default: current directory)
  --host HOST            Host to bind to (default: 0.0.0.0)
  --version              Show version
  -h, --help             Show help

How It Works

  1. Start the server.
  2. Open http://localhost:8000 or the LAN URL printed in the terminal.
  3. Click folder names to navigate.
  4. Click file names to preview them in the side panel.
  5. Use the action buttons for download, rename, delete, ZIP download, and other file operations.
  6. Use search, sorting, and the hidden-file toggle from the top toolbar.

Preview Support

  • Text files: syntax-highlighted preview
  • Images: inline preview
  • PDFs: embedded browser preview
  • Other file types: file information plus a download action

Extensionless files that look like text are also previewed as text when possible.

Install From Source

git clone https://github.com/xyanmi/litheserver.git
cd litheserver
python -m pip install .

Notes

  • LitheServer is intended for personal use, quick sharing, and trusted local networks.
  • It is not meant to be a hardened public-facing file server.
  • If you only want local machine access, bind explicitly to localhost:
litheserver --host 127.0.0.1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

litheserver-0.2.0.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

litheserver-0.2.0-py3-none-any.whl (2.6 MB view details)

Uploaded Python 3

File details

Details for the file litheserver-0.2.0.tar.gz.

File metadata

  • Download URL: litheserver-0.2.0.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for litheserver-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6fdbf7884332e9039cb5da30c23ba6f354c5d2950cb73e9e352670729409e2a1
MD5 3b891dbf7c0f20909bebe3e98bfe7b30
BLAKE2b-256 f1e6d632cdaa8df85cb8d5d3dbadd52b08c22985610c5266efbcaf4bb126bf2b

See more details on using hashes here.

File details

Details for the file litheserver-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: litheserver-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for litheserver-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65b2e7ea66166ac05a85f75169eaf29a88e45b3e9d943b8f96a03fd4b12c00d3
MD5 7b56b6ba332585e278ee550a9947da9e
BLAKE2b-256 b6dc6a5e73a3a955c470181692ffa0e80eb83c733003459f9807efeb89232146

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page