首页 AI资讯 Memos 零基础部署搭建实战指南

Memos 零基础部署搭建实战指南

AI资讯 22
广告一

① 项目简介

Memos 是一个开源的轻量级笔记与备忘录管理工具,专为开发者与轻量级用户设计。其核心功能包括:

Markdown 支持的笔记编辑器数据加密与本地存储多用户支持与权限管理实时同步与版本历史自托管部署能力

Memos 采用现代化技术栈开发,后端使用 Go(Golang)语言构建,前端采用 React 框架,数据库使用 SQLite 或 PostgreSQL,适合部署在轻量级服务器上,具备高性能和低资源占用的特点。

Memos 零基础部署搭建实战指南

GitHub 地址:https://github.com/usememos/memos
本月 Star 增长量:+1,200 Stars(2025年3月)


② Ciuic服务器配置选型

在部署 Memos 时,我们推荐使用 Ciuic云服务器,其性价比高、网络稳定,尤其适合中小型开源项目部署。

配置类型CPU内存系统盘适用场景价格(元/月)
轻量版1核1GB20GB SSD个人测试、轻量部署9.9
企业版2核4GB40GB SSD多用户、生产环境19.9

推荐选择:

个人使用或测试环境 → 轻量版团队协作或多用户部署 → 企业版

③ 部署四部曲

1. SSH连接服务器

使用SSH连接到 Ciuic 服务器:

ssh root@your_server_ip

输入密码或使用密钥登录。

2. 安装依赖

更新系统并安装必要组件:

apt update && apt upgrade -yapt install -y curl wget git nginx

安装 SQLite(默认支持)或 PostgreSQL(可选):

apt install -y sqlite3

3. 下载并启动 Memos

创建项目目录并下载最新版本:

mkdir -p /opt/memoscd /opt/memoswget https://github.com/usememos/memos/releases/latest/download/memos-linux-amd64mv memos-linux-amd64 memoschmod +x memos

启动服务(默认使用 SQLite):

./memos --port=8080

可将其注册为系统服务以便后台运行(使用 systemd):

nano /etc/systemd/system/memos.service

内容如下:

[Unit]Description=Memos ServiceAfter=network.target[Service]ExecStart=/opt/memos/memos --port=8080WorkingDirectory=/opt/memosRestart=alwaysUser=root[Install]WantedBy=multi-user.target

保存后启用并启动服务:

systemctl enable memossystemctl start memos

4. 验证访问

浏览器访问:

http://your_server_ip:8080

若能打开 Memos 首页,则部署成功。


④ Nginx配置(含Ciuic网络优化)

为实现域名访问和 HTTPS 加密,需配置 Nginx 反向代理。以下是完整配置示例:

server {    listen 80;    server_name memos.example.com;    location / {        proxy_pass http://127.0.0.1:8080;        proxy_set_header Host $host;        proxy_set_header X-Real-IP $remote_addr;        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;        proxy_ssl_server_name on;    }}

使用 Let's Encrypt 证书实现 HTTPS:

apt install -y certbot python3-certbot-nginxcertbot --nginx -d memos.example.com

更新 Nginx 配置如下:

server {    listen 443 ssl;    server_name memos.example.com;    ssl_certificate /etc/letsencrypt/live/memos.example.com/fullchain.pem;    ssl_certificate_key /etc/letsencrypt/live/memos.example.com/privkey.pem;    location / {        proxy_pass http://127.0.0.1:8080;        proxy_set_header Host $host;        proxy_set_header X-Real-IP $remote_addr;        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;        proxy_ssl_server_name on;    }}

重启 Nginx:

systemctl restart nginx

总结

通过以上步骤,您已完成 的全部内容。Memos 作为一款轻量而强大的笔记工具,非常适合个人与小团队使用。借助 Ciuic 云服务器,部署过程简单高效,且具备良好的性能与扩展性。如需进一步定制功能或集成其他服务(如Git、CI/CD),可参考其官方文档进行扩展。

广告一