您的位置:首页 >Flatnotes开源轻量笔记:基于Ubuntu系统Docker容器化部署实战记录
发布于2026-08-13 阅读(0)
扫一扫,手机访问
FlatNotes 是一款自托管、无需数据库的 Web 笔记应用,放在下面这些场景里,用起来往往会格外顺手:
[root@jeven ~]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2023-08-23 23:41:16 CST; 1 weeks 1 days ago
Docs: https://docs.docker.com
Main PID: 9562 (dockerd)
Tasks: 50
Memory: 1.4G
CGroup: /system.slice/docker.service[root@jeven ~]# docker version
Client: Docker Engine - Community
Version: 20.10.17
API version: 1.41
Go version: go1.17.11
Git commit: 100c701
Built: Mon Jun 6 23:05:12 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.17
API version: 1.41 (minimum version 1.12)
Go version: go1.17.11
Git commit: a89b842
Built: Mon Jun 6 23:03:33 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.6
GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
runc:
Version: 1.1.2
GitCommit: v1.1.2-0-ga916309
docker-init:
Version: 0.19.0
GitCommit: de40ad0[[root@jeven ~]# docker compose version
Docker Compose version v2.19.1[root@jeven ~]# docker pull dullage/flatnotes
Using default tag: latest
latest: Pulling from dullage/flatnotes
1d5252f66ea9: Pull complete
eefb43356e06: Pull complete
c26db0eb1f01: Pull complete
300843d99304: Pull complete
daddf7df59b6: Pull complete
fd5b7d323a9e: Pull complete
956d12ab1aba: Pull complete
3a27da5a148e: Pull complete
9bc9c825c797: Pull complete
4f4fb700ef54: Pull complete
2dff9aeca767: Pull complete
745990a309e1: Pull complete
cf33157fe535: Pull complete
1f4f074b255f: Pull complete
042bd107273a: Pull complete
Digest: sha256:666b237abff5a16d781ee7f06ccdadef9e42951de3ec320a071407a9e85666ef
Status: Downloaded newer image for dullage/flatnotes:latest
docker.io/dullage/flatnotes:latestmkdir -p /data/flatnotes/data && cd /data/flatnotes/目录授权工作 chmod -R 777 /data/flatnotes/[root@jeven flatnotes]# cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 24 | head -n 1
Nl1rQmfg4gsnJfBfsmkXOo7Gdocker run -d
--restart unless-stopped
--name flatnotes
-p "28880:8080"
-v "/data/flatnotes/data:/data"
-e "FLATNOTES_AUTH_TYPE=password"
-e "FLATNOTES_USERNAME=admin"
-e "FLATNOTES_PASSWORD=admin"
-e "FLATNOTES_SECRET_KEY=Nl1rQmfg4gsnJfBfsmkXOo7G"
-e "PORT=8080"
dullage/flatnotes:latestversion: '3'
services:
flatnotes:
image: dullage/flatnotes:latest
container_name: flatnotes
restart: always
ports:
- 28880:8080
volumes:
- /data/flatnotes/data:/data
environment:
- FLATNOTES_AUTH_TYPE=password
- FLATNOTES_USERNAME=admin
- FLATNOTES_PASSWORD=admin
- FLATNOTES_SECRET_KEY=Nl1rQmfg4gsnJfBfsmkXOo7G
- PORT=8080[root@jeven flatnotes]# docker compose up -d
[+] Running 2/2
⠿ Network flatnotes_default Created 0.1s
⠿ Container flatnotes Started 0.4s[root@jeven flatnotes]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
23eebd85b174 dullage/flatnotes:latest "/entrypoint.sh" 13 seconds ago Up 13 seconds 0.0.0.0:28880->8080/tcp, :::28880->8080/tcp flatnotes[root@jeven flatnotes]# docker logs flatnotes
Setting up user and group...
Adding group `flatnotes' (GID 1000) ...
Done.
Adding user `flatnotes' ...
Adding new user `flatnotes' (1000) with group `flatnotes' ...
Creating home directory `/home/flatnotes' ...
Copying files from `/etc/skel' ...
Setting file permissions...
WARNING: Breaking changes introduced in version 3.x:
- The port flatnotes uses inside the Docker container has been changed to 8080 (previously 80).
- To accompany the above change, support for the PORT environment variable has been removed.
- The note directory inside the Docker container has moved from /app/data to simply /data.
Starting flatnotes...
2023-09-01 10:22:51 [INFO]: Creating new index
INFO: Started server process [1]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)






[root@jeven data]# pwd
/data/flatnotes/data
[root@jeven data]# ls -l
total 8
-rw-r--r--. 1 admin admin 5680 Sep 1 18:52 Linux系统之普通用户sudo提权配置.md
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店
正版软件
正版软件
正版软件
正版软件
正版软件
1
2
3
4
5
6
7
8
9