Tutorial

Quickly Deploy Memos Personal Note System with Docker

2025-08-18 #Docker#Docker Compose#Self-hosted#Memos

Introduction to Memos

Memos is an open-source, lightweight note-taking service that allows you to easily capture every inspiration and thought, much like posting on Weibo or Twitter. Because it is open-source and supports Docker deployment, we can use it to build a private note-taking system completely under our own control.

The core features of Memos include:

  • Markdown syntax support
  • Tag management
  • Task list support
  • Public/Private note permission settings
  • Multi-user collaboration

Before starting the deployment, you can check out the official Memos Live Demo to experience it quickly.

This tutorial will guide you through deploying a secure, private Memos instance quickly using Docker Compose, giving you your own note management system in no time.

1. Environment Preparation

Before starting, you need your own VPS or a NAS system that supports Docker containers.

1. Installing Docker and Docker Compose

If your server does not have Docker and Docker Compose installed yet, you can refer to the following tutorial:

2. Creating the Project Directory

Create a dedicated directory for Memos to store configuration files and data.

1
mkdir -p /opt/memos && cd /opt/memos

2. Deploying Memos with Docker Compose

Creating the docker-compose.yml File

In the project directory (/opt/memos), create a file named docker-compose.yml.

1
vim docker-compose.yml

Paste the following content into the file:

1
2
3
4
5
6
7
8
9
10
11
12
services:
memos:
image: neosmemo/memos:latest
container_name: memos
ports:
- 5230:5230
volumes:
- ./data:/var/opt/memos
restart: always
environment:
- MEMOS_MODE=prod
- MEMOS_PORT=5230

Configuration Explanation:

  • ports: Maps Memos' Web interface to port 5230 of the host
  • volumes: Persists Memos data in the data folder under the same directory as docker-compose.yml, ensuring data is not lost when the container is reconstructed

For future backups or migrations, simply package and copy the ./data folder directly.

Starting the Memos Service

In the directory where docker-compose.yml is located, execute the following command to pull the image and start the service:

1
docker compose up -d

Then open a browser and visit http://<your-server-IP>:5230 to access the Memos Web interface. On the first launch, it will prompt you to register an administrator account (the page defaults to English, you can switch languages at the bottom).

memos-signup

3. Security Settings

For a private note-taking system, security is equally important. If you are using it only for personal purposes, you can disable registrations.

1. Disabling User Registration

Once logged into Memos, enter the administrator settings:

  • Click the settings button on the left sidebar.
  • Select System.
  • Turn on the Disallow user registration option.

Exposing the Web port directly to the public internet is unsafe. It is recommended to use Nginx or another reverse proxy tool to serve the Web interface and use HTTPS.

1 Modify Port Mapping: Restrict Memos' Web port to localhost access only.
Modify the ports section in the docker-compose.yml file:

1
2
ports:
- "127.0.0.1:5230:5230" # 仅允许本地访问

2 Restart Service:

1
2
docker compose down
docker compose up -d

3 Configure Reverse Proxy: In your reverse proxy tool, set up a proxy rule to forward traffic from memos.yourdomain.com to http://127.0.0.1:5230.

Nginx Example (Reverse Proxy Section Only)

The following example reverse proxies HTTP traffic for the domain memos.example.com to local 127.0.0.1:5230.

1
2
3
4
5
6
7
8
9
10
11
12
location / {
proxy_pass http://127.0.0.1:5230/;

rewrite ^/(.*)$ /$1 break;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade-Insecure-Requests 1;
proxy_set_header X-Forwarded-Proto https;
}

Test and reload Nginx configuration:

1
2
nginx -t
nginx -s reload

Conclusion

Congratulations! Through this tutorial, you have successfully set up a powerful and completely private personal note-taking system. Memos, with its lightweight design and excellent support for Markdown, serves as an outstanding tool for capturing ideas, managing tasks, and building a personal knowledge base.

Now, you can start recording your every inspiration freely without worrying about data privacy. Due to using Docker Compose, future maintenance and upgrades will also be extremely easy.

Hopefully, this new note-taking system brings convenience to your study and work.

Comments
Share

Comments