memos – 使用docker搭建轻量笔记本,彻底抛弃飞书

2024年3月30日
Share

memos官方给的介绍是“A privacy-first, lightweight note-taking service. Easily capture and share your great thoughts.” 一 隐私至上的轻量级笔记服务。轻松捕捉并分享您的精彩想法。

Key points

  • Open source and free forever. Embrace a future where creativity knows no boundaries with our open-source solution – free today, tomorrow, and always.
  • Self-hosting with Docker in just seconds. Enjoy the flexibility, scalability, and ease of setup that Docker provides, allowing you to have full control over your data and privacy.
  • Pure text with added Markdown support. Say goodbye to the overwhelming mental burden of rich formatting and embrace a minimalist approach.
  • Customize and share your notes effortlessly. With our intuitive sharing features, you can easily collaborate and distribute your notes with others.
  • RESTful API for third-party services. Embrace the power of integration and unleash new possibilities with our RESTful API support.

主要特征:

  • 🦄 开源且永久免费
  • 🚀 使用 Docker 几秒内安装托管
  • 📜 纯文本,支持 Markdown 语法
  • 👥 将备忘录设为私人或公开给
  • 🧑‍💻 支持 RESTful API
  • 📋 使用 iframe 在其他网站上嵌入备忘录
  • 🏷️ 支持标签
  • 📆 GitHub 式的交互式日历视图
  • ☁️ 数据库可保存至 S3 API(AWS S3、Cloudflare R2、MinIO)
  • 👮 支持 SSO 登录(OAuth 2.0)
  • 💾 轻松迁移和备份数据

今天将使用docker-compose 搭建这个轻量级笔记服务,彻底“抛弃”飞书!

默认已经安装好了docker,和docker-compose,创建项目文件夹和宿主机数据卷储存位置

mkdir -p /docker/data/memos
cd /docker/data/memos

官方的docker-compose.yml

version: "3.0"
services:
  memos:
    image: neosmemo/memos:stable
    container_name: memos
    volumes:
      - ./memos-data:/var/opt/memos  //数据卷存储的地方修改为自己创建的文件夹
    ports:
      - 5230:5230  //映射端口号,可以自定义,也可以使用官方默认

使用up命令生成容器,完成后就可以使用端口加IP访问

登入后显示如下

这样我们就成功部署了自己的轻量级笔记服务,可以开始愉快的折腾了。

关于升级备忘录,官方也给出了详细说明

若要将备忘录升级到最新版本,请执行以下步骤:

首先,停止并移除旧容器:

docker stop memos && docker rm memos

虽然是可选的,但建议备份数据库:

cp -r ~/.memos/memos_prod.db ~/.memos/memos_prod.db.bak  //要根据自己的路径修改

接下来,拉取最新的备忘录图像,根据你选择的方式,我这边还是使用的docker-compose

docker-compose up -d

官方github:https://github.com/usememos/memos?tab=readme-ov-file

第三方客户端

memos 有着不少第三方客户端: