Projects/Moments Memos
Home services

Moments Memos

Lightweight fragmented notes, like your own Moments, for jotting down ideas anytime.

What It Is

Memos is a lightweight fragmented-note service. I use it as my personal “Moments” feed: jot down a couple of thoughts, paste a link, or record a conclusion, without opening a note-taking app to create folders or posting to a public social platform. It is self-hosted on a small server at home, with the data in my own hands.

Why I Built It

My previous records were scattered across chat logs, notes, and various apps, making them hard to find. What I wanted was actually very simple—a single input box; write and save, and later browse by time. Memos fits exactly this form, and deployment is lightweight: one container is enough, and it does not use much resources.

Current Status

The service is running. The memos container (ghcr.io/usememos/memos:latest) has been running stably for 12 days, and health checks are normal; externally, it is reverse-proxied via Nginx Proxy Manager to https://memory.xiejun-server.top/, and a “Moments” entry is added on the Homer dashboard, with the subtitle “Memos · 992 archived”.

For routine maintenance, I wrote a small script for Homer, add_homer_entry.py: when appending or updating an entry on the dashboard, it automatically backs up config.yml, avoids adding duplicate entries for the same URL, can change the subtitle “N entries on a single page” to the actual count, and automatically rolls back if YAML validation fails. This saves me from worrying every time I edit the config by hand.

Features

  • Docker 单容器部署 Memos,资源占用低,长期稳定运行
  • 通过 Nginx Proxy Manager 反代并上 HTTPS,对外域名访问
  • 在 Homer 导航页挂了「朋友圈」入口,带归档条数副标题
  • 用 Python 脚本 add_homer_entry.py 追加/更新导航入口,自动备份与去重
  • 副标题中的「单页 N 个入口」数量自动维护,YAML 校验失败自动回滚
  • 重建脚本 rebuild_homer.py 支持按新地址批量重建导航配置

Stack: Memos · Docker · Python · Homer · Nginx Proxy Manager · YAML

Deployment Steps

1. Prepare the Data Directory

Data must reside on the host machine, not inside the container.

mkdir -p /opt/memos

2. Start the Container

Use the official image ghcr.io/usememos/memos:latest and map the internal port:

docker run -d \
  --name memos \
  --restart unless-stopped \
  -p 49486:5230 \
  -v /opt/memos:/var/opt/memos \
  ghcr.io/usememos/memos:latest

5230 is Memos' default listening port. On the host side, I used 49486 to avoid conflicts with existing services. After startup, access it locally first to confirm the page opens.

3. Reverse Proxy and Certificate

Create a Proxy Host in Nginx Proxy Manager:

  • Forward Hostname: the host address where the container resides (if on the same machine, you can directly enter the container name or 127.0.0.1)
  • Forward Port: 49486
  • Enable Block Common Exploits, request a Let's Encrypt certificate, and force HTTPS

After configuration, verify with an address such as https://memory.xiejun-server.top/.

4. Add to Homer Dashboard

Write a spec file with only four fields:

{"name": "朋友圈", "icon": "fas fa-comments", "subtitle": "Memos · 归档", "url": "https://memory.xiejun-server.top/"}

Then execute:

python3 add_homer_entry.py homer_spec.json

The script does several things: first, it backs up /opt/web/homer-assets/config.yml to /opt/web/homer-backups/; then it checks whether an entry with the same URL already exists (if so, it only updates the name/icon/subtitle and does not add a duplicate); finally, it changes "single page N entries" in the subtitle to the actual count. If YAML parsing validation fails, it automatically rolls back.

5. Verification

Refresh the Homer homepage and confirm the entry appears and navigation works; then go back to Memos and post a random record to see whether it is persisted.

Notes

  • Before upgrading the image, back up /opt/memos, and keep the last working image tag for rollback.
  • If there is a reverse proxy in front, confirm that WebSocket and upload size limits are not blocked.
  • Try to modify the Homer configuration through the script rather than manually editing config.yml; the rollback cost is much lower.