安装curl,git,vim,wget,docker,docker-compose等必备的工具

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#升级系统
apt update -y
#安装curl、git、vim、wget
apt install -y wget vim sudo curl git
#安装docker
wget -qO- get.docker.com | bash
#检验docker安装成功
docker -v
#启动docker
systemctl enable docker
#安装docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
#添加可执行权限:x
sudo chmod +x /usr/local/bin/docker-compose
#在/usr/bin/路径下创建软连接
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
#检验docker-copose安装成功
docker-compose --version

新建项目文件夹

1
2
3
4
5
cd ~
新建umami文件夹
mkdir -p ~/data/docker_data/umami
进去umami文件夹
cd ~/data/docker_data/umami

编辑配置文件

1
nano docker-compose.yml

写入docker-compose代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---
version: '3'
services:
umami:
image: docker.umami.dev/umami-software/umami:postgresql-latest
ports:
- "3000:3000"
environment:
DATABASE_URL: postgresql://umami:umami@db:5432/umami
DATABASE_TYPE: postgresql
APP_SECRET: replace-me-with-a-random-string
depends_on:
- db
restart: always
db:
image: postgres:15-alpine
environment:
POSTGRES_DB: umami
POSTGRES_USER: umami
POSTGRES_PASSWORD: umami
volumes:
- ./sql/schema.postgresql.sql:/docker-entrypoint-initdb.d/schema.postgresql.sql:ro
- ./umami-db-data:/var/lib/postgresql/data
restart: always

检查完毕之后,ctrl+x退出,按y确认修改内容,enter确认

启动Umami

1
docker-compose up -d

甲骨文的Ubuntu开行3000端口

1
2
3
4
5
6
iptables -I INPUT -p tcp --dport 2181 -j ACCEPT
#保存规则
iptables-save
#永久保存规则
netfilter-persistent save
netfilter-persistent reload

访问http://ip:3000 用户名admin,密码umami