Self-hosted, mobile-first photo/video album. | 自托管、移动端友好的照片/视频相册。
4.3K
PhotoSilo is a mobile-first, self-hosted photo & video album built in Go, with a front-end that mimics the phone gallery experience. One binary, no complex dependencies.
ffmpeg generates video thumbnails automaticallyHttpOnly + SameSite session cookie, login requiredlinux/amd64 & linux/arm64docker run -d -p 8080:8080 \
-v /path/to/photos:/data \
ericwang2006/photosilo
A default config is generated on first start (account admin / admin). Open http://<host>:8080 in your browser.
Note
The auto-generated config sets `photo_dir` to `"."`, which resolves to `/app` inside the container — so the command above browses `/app`, **not** `/data`. To serve the photos you mounted at `/data`, add the persistence setup below and set `"photo_dir": "/data"` in the config.
By default the thumbnail cache, favorites and the config all live inside the container and are lost when the container is recreated:
/tmp/photosilo-thumbs-<hash>/thumbs.db/tmp/photosilo-favs-<hash>/favs.db/app/photosilo.jsonFirst generate a valid config file on the host (the image auto-creates one with admin/admin — just print it):
docker run --rm ericwang2006/photosilo cat /app/photosilo.json > /path/to/config.json
Then point photo_dir at /data and give the thumbnail / favorites DBs persistent paths:
{
"photo_dir": "/data",
"port": 8080,
"thumb_db": "/thumb/thumbs.db",
"thumb_max_age_days": 30,
"thumb_max_size_gb": 10,
"fav_db": "/thumb/favs.db",
"users": [
{ "username": "admin", "password_hash": "<keep it from the generated file, don't hand-edit>", "is_admin": true }
]
}
Run:
docker run -d -p 8080:8080 \
-v /path/to/photos:/data \
-v /path/to/cache:/thumb \
-v /path/to/config.json:/app/photosilo.json \
ericwang2006/photosilo
Now thumbnails, favorites and the config survive container restarts / re-creation.
Note
Because the config file now exists, the container will **not** auto-run `init` anymore — the config must contain at least one valid user (the `password_hash` from the generated file is a proper bcrypt hash, keep it). To add more users later, run `photosilo adduser` inside the running container (config reloads automatically, no restart needed).
PhotoSilo 是一款移动端友好的自托管照片 / 视频相册程序,采用 Go 编写,前端仿手机相册交互。无需任何复杂依赖,一个二进制即可运行。
ffmpeg,自动生成视频缩略图HttpOnly + SameSite),访问需登录linux/amd64 与 linux/arm64docker run -d -p 8080:8080 \
-v /path/to/photos:/data \
ericwang2006/photosilo
首次启动自动生成配置,默认账号 admin / admin,浏览器访问 http://<主机>:8080 即可。
Note
自动生成的配置 `photo_dir` 为 `"."`,即容器内的 `/app`——上面这条命令实际浏览的是 `/app`,**并不是** `/data`。要让挂载到 `/data` 的照片生效,请按下面的「持久化(推荐)」方式设置 `"photo_dir": "/data"`。
缩略图缓存、收藏夹和配置默认都在容器内部,容器一旦重建就会丢失:
/tmp/photosilo-thumbs-<hash>/thumbs.db/tmp/photosilo-favs-<hash>/favs.db/app/photosilo.json先在宿主机生成一份有效配置(镜像会自动生成含 admin/admin 的配置,直接打印出来即可):
docker run --rm ericwang2006/photosilo cat /app/photosilo.json > /path/to/config.json
然后把 photo_dir 指向 /data,并为缩略图 / 收藏数据库指定持久化路径:
{
"photo_dir": "/data",
"port": 8080,
"thumb_db": "/thumb/thumbs.db",
"thumb_max_age_days": 30,
"thumb_max_size_gb": 10,
"fav_db": "/thumb/favs.db",
"users": [
{ "username": "admin", "password_hash": "<保持生成文件里的内容,不要手改>", "is_admin": true }
]
}
启动容器:
docker run -d -p 8080:8080 \
-v /path/to/photos:/data \
-v /path/to/cache:/thumb \
-v /path/to/config.json:/app/photosilo.json \
ericwang2006/photosilo
这样缩略图缓存、收藏夹和配置都能在容器重启 / 重建后保留。
Note
因为配置文件已存在,容器**不会再自动执行 `init`**——配置里必须包含至少一个有效用户(生成的 `password_hash` 是合法的 bcrypt 哈希,保留即可)。之后要加用户,在运行中的容器里执行 `photosilo adduser` 即可(配置会自动重载,无需重启)。
Content type
Image
Digest
sha256:aa4b4c4b1…
Size
53.7 MB
Last updated
3 days ago
docker pull ericwang2006/photosilo