前言 安装nginx(如果需要NginxWebUI,就不这样子安装) 1 2 3 4 5 # 安装 apt install nginx # 查看版本 nginx -v
安装Nginx Proxy Manager 1 2 3 4 5 6 7 8 9 10 11 12 version: '3.8' services: app: image: 'jc21/nginx-proxy-manager:latest' restart: unless-stopped ports: - '80:80' - '81:81' - '443:443' volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt
1 2 Email: admin@example.com Password: changeme
安装docker和docker-compose 安装docker 1 2 3 4 5 6 7 8 curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun 或者 curl -fsSL https://get.docker.com | bash -s docker # 查看版本 docker -v # Docker version 23.0.1, build a5ee5b1
国内 daocloud一键安装命令:官网都打不开了,不知道为啥,所以估计这个命名过不了多久就没有用 1 2 3 4 5 6 # 安装 curl -sSL https://get.daocloud.io/docker | sh # 查看版本 docker -v # Docker version 23.0.1, build a5ee5b1
1 2 3 4 5 6 7 8 9 10 11 12 sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://49qfdqkg.mirror.aliyuncs.com"] } EOF sudo systemctl daemon-reload sudo systemctl restart docker # 查看配置是否生效 docker info
如果出现这个问题Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
1 2 3 4 5 6 7 #重新启动 systemctl restart docker.service #开机启动 systemctl enable docker
安装docker-compose 官网安装介绍 注意,2.17版本更变了使用命令好像,运行的也是 1 2 3 4 #2.17版本 docker compose up -d
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 # 直接下载(国外ip) curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose # 使用代理加速下载(国内ip) curl -SL https://ghproxy.com/https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose # 查看版本 docker-compose -v # Docker Compose version v2.16.0 # 如果出现docker-compose -v Docker Compose version v2.16.0 # 执行下面命令即可 chmod +x /usr/local/bin/docker-compose # 接着查看版本,可以正常查看 docker-compose -v # Docker Compose version v2.16.0 # 或者 docker compose version # Docker Compose version v2.17.3
安装NginxWebUI(Nginx可视化工具) 1 2 3 4 5 6 # 安装java运行环境 apt install openjdk-8-jdk # 启动容器 # 端口可以自己更改 docker run -itd -v /home/nginxWebUI:/home/nginxWebUI -e BOOT_OPTIONS="--server.port=9764" --privileged=true --net=host --restart=always cym1102/nginxwebui:latest
安装nodejs(使用NVM管理) 使用nvm,这样子可以帮助我们管理nodejs版本 1 2 3 4 5 # 国外IP curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash # 国内IP curl -o- https://ghproxy.com/https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
安装完成后,如果输入nvm回车后提示command not found
,则关闭当前终端,打开一个新终端,然后再次尝试验证 1 2 3 4 5 6 7 8 # 安装指定版本 nvm install 16.19.1 # 安装最新版 nvm install node # "node" is an alias for the latest version # 查看安装了哪些版本 nvm ls
1 2 3 4 5 # 设置地址 npm config set registry https://registry.npm.taobao.org/ # 查看镜像源的地址 npm config get registry npm
安装自己常用docker 学习强国 拉取镜像(也可以直接去部署) 2023年3月26日14.33.45 更换新方法 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 version: "3.5" services: xuexi-auto: image: xlh001/study_xxqg:latest # 容器名 container_name: xuexi-auto environment: # 时区 - TZ=Asia/Shanghai # 配置文件路径 volumes: - ./config:/opt/config # 映射端口 ports: - 1234:8080 restart: unless-stopped
2023年3月24日14.32.45下面这种失效了 1 docker pull registry.cn-hangzhou.aliyuncs.com/wxyhgk/xxgq:2.0
1 docker pull registry.cn-hangzhou.aliyuncs.com/wxyhgk/xxqg_arm:1.0
部署 x86 处理器-p 1234:8080
表示内部8080端口映射到外部(服务器)1234端口 1 2 3 4 5 6 7 docker run \ --name study_xxqg \ -d \ -p 1234:8080 \ -v /etc/study_xxqg/:/opt/config/ \ --restart unless-stopped \ registry.cn-hangzhou.aliyuncs.com/wxyhgk/xxgq:2.0
1 2 3 4 5 6 7 docker run \ --name study_xxqg \ -d \ -p 1234:8080 \ -v /etc/study_xxqg/:/opt/config/ \ --restart unless-stopped \ registry.cn-hangzhou.aliyuncs.com/wxyhgk/xxqg_arm:1.0
1 2 3 4 5 6 —name 表示名字 ,名字是 study_xxqg -d 表示后台运行 -p 1234:8080 表示将 容器内部的 8080 端口映射到主机的 1234 端口 -v /etc/study_xxqg/:/opt/config/ 表示将 本机的 /etc/study_xxqg/ 映射到 docker 镜像的 /opt/config/ 下 registry.cn-hangzhou.aliyuncs.com/wxyhgk/xxgq:1.0 表示拉取这个镜像 --restart unless-stopped \ 表示重启docker后会启动此容器
完成和其他配置 完成后登录浏览器输入服务器IP地址:1234即可 其他配置请看此博主写的 安装青龙(docker-compose方式) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 version: '2' services: ql_web: image: whyour/qinglong:latest container_name: ql volumes: - ./data/config:/ql/config - ./data/log:/ql/log - ./data/db:/ql/db - ./data/scripts:/ql/scripts - ./data/repo:/ql/repo ports: - "0.0.0.0:5700:5700" environment: - ENABLE_HANGUP=true - ENABLE_WEB_PANEL=true restart: always
记得服务器防火墙开放端口5700
浏览器访问服务器地址:5700 安装好后安装下依赖(懂得都懂) 来源@青龙面板全依赖一键安装脚本 注意,里面的qinglong
要根据自己镜像名称来,上面我通过docker-compose
安装指定的名称为ql
,所以我改为了ql
1 2 3 4 5 6 7 8 9 # 国内版 docker exec -it ql bash -c "$(curl -fsSL https://ghproxy.com/https://raw.githubusercontent.com/FlechazoPh/QLDependency/main/Shell/QLOneKeyDependency.sh | sh)" # 国外版: docker exec -it ql bash -c "$(curl -fsSL https://raw.githubusercontent.com/FlechazoPh/QLDependency/main/Shell/QLOneKeyDependency.sh | sh)" # 【更新】 版本号 2.12+ 的新版本青龙安装失败请尝试: docker exec -it ql bash -c "$(curl -fsSL https://raw.githubusercontent.com/FlechazoPh/QLDependency/main/Shell/XinQLOneKey.sh | sh)"
1 npm install -g png-js date-fns axios crypto-js ts-md5 tslib @types/node requests tough-cookie jsdom download tunnel fs ws form-data js-base64 qrcode-terminal silly-datetime
安装qbittorrent @来源 创建docker-compose.yml
文件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 version: "2.1" services: qbittorrent: image: lscr.io/linuxserver/qbittorrent:latest container_name: qbittorrent environment: - PUID=1000 - PGID=1000 - TZ=Etc/UTC - WEBUI_PORT=8080 volumes: - /path/to/appdata/config:/config - /path/to/downloads:/downloads ports: - 8080 :8080 - 6881 :6881 - 6881 :6881/udp restart: unless-stopped 如果需要更改端口,可以看看下方注释 version: "2" services: qbittorrent: image: linuxserver/qbittorrent container_name: qbittorrent environment: - PUID=1000 - PGID=1000 - TZ=Asia/Shanghai - UMASK_SET=022 - WEBUI_PORT=8081 volumes: - /home/qb/config:/config - /home/d:/downloads ports: - 6881 :6881 - 6881 :6881/udp - 8081 :8081 restart: unless-stopped
安装aria2-pro 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 docker run -d \ --name aria2-pro \ --restart unless-stopped \ --log-opt max-size=1m \ --network host \ -e PUID =$UID \ -e PGID =$GID \ -e RPC_SECRET =<TOKEN > \ -e RPC_PORT =6800 \ -e LISTEN_PORT =6888 \ -v $PWD/aria2-config :/config \ -v $PWD/aria2-downloads :/downloads \ p3terx/aria2-pro (自用) docker run -d \ --name aria2-pro \ --restart unless-stopped \ --log-opt max-size=1m \ --network host \ -e PUID =$UID \ -e PGID =$GID \ -e RPC_SECRET =112233 \ -e RPC_PORT =6800 \ -e LISTEN_PORT =6888 \ -v /onetb/qbitandair/aria2-config/:/config \ -v /onetb/qbitandair/download/:/downloads \ p3terx/aria2-pro
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 version: "3.8" services: Aria2-Pro: container_name: aria2-pro image: p3terx/aria2-pro environment: - PUID=65534 - PGID=65534 - UMASK_SET=022 - RPC_SECRET=P3TERX - RPC_PORT=6800 - LISTEN_PORT=6888 - DISK_CACHE=64M - IPV6_MODE=false - UPDATE_TRACKERS=true - CUSTOM_TRACKER_URL= - TZ=Asia/Shanghai volumes: - /onetb/qbittorrent/config/aria2-config:/config - /onetb/qbittorrent/ariadownload:/downloads network_mode: host restart: unless-stopped logging: driver: json-file options: max-size: 1m AriaNg: container_name: ariang image: p3terx/ariang command: --port 6880 --ipv6 network_mode: host restart: unless-stopped logging: driver: json-file options: max-size: 1m
安装alist 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 version: '3.3' services: alist: restart: always volumes: - '/etc/alist:/opt/alist/data' ports: - '5244:5244' environment: - PUID=0 - PGID=0 - UMASK=022 container_name: alist image: 'xhofe/alist:latest'
或者
1 2 3 4 5 6 7 8 9 10 11 12 13 14 version: '3.3' services: alist: restart: always volumes: - './data:/opt/alist/data' ports: - '5244:5244' environment: - PUID=0 - PGID=0 - UMASK=022 container_name: alist image: 'xhofe/alist:latest'
记得服务器防火墙放行5244
浏览器访问服务器地址:5244
获取alist默认密码命令
1 docker exec -it alist ./alist admin
安装subconverter github地址
可以搭配sub-web使用
这里以安装subconverter
为例
docker安装
1 docker run -d --restart=always -p 25500:25500 tindy2013/subconverter:latest
1 2 3 4 5 6 7 8 9 10 11 version: '3.3' services: subconverter: restart: always volumes: - './data:/opt/subconverter/data' ports: - '25500:25500' container_name: subconverter image: 'tindy2013/subconverter:latest'
安装短链接Yourls 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 version: "3.5" services: mysql: image: mysql:5.7.22 environment: - MYSQL_ROOT_PASSWORD=my-secret-pw - MYSQL_DATABASE=yourls - MYSQL_USER=yourls - MYSQL_PASSWORD=yourls volumes: - ./mysql/db/:/var/lib/mysql - ./mysql/conf/:/etc/mysql/conf.d restart: always container_name: mysql yourls: image: yourls restart: always ports: - "8200:80" environment: YOURLS_DB_HOST: mysql YOURLS_DB_USER: yourls YOURLS_DB_PASS: yourls YOURLS_DB_NAME: yourls YOURLS_USER: admin YOURLS_PASS: admin YOURLS_SITE: https://gao.ee YOURLS_HOURS_OFFSET: 8 volumes: - ./yourls_data/:/var/www/html container_name: yourls_service links: - mysql:mysql
安装shlink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 version: '3.8' services: shlink: image: shlinkio/shlink:stable container_name: shlink ports: - '127.0.0.1:8200:8080' environment: - DEFAULT_DOMAIN=omgl.xyz - IS_HTTPS_ENABLED=true - GEOLITE_LICENSE_KEY=GEOLITE_LICENSE_KEY 需要在 Maxmind 注册帐号获取 - DB_DRIVER=maria - DB_NAME=shlink - DB_USER=shlink - DB_PASSWORD=随机密码1 - DB_HOST=db - DB_PORT=3306 - TIMEZONE=UTC - REDIRECT_STATUS_CODE=301 restart: always db: image: mariadb:10.6 depends_on: - shlink container_name: db ports: - '127.0.0.1:3306:3306' environment: - MYSQL_ROOT_PASSWORD=随机 root 密码 - MYSQL_DATABASE=shlink - MYSQL_USER=shlink - MYSQL_PASSWORD=随机密码1 volumes: - /opt/shlink/data:/var/lib/mysql restart: always shlink-web-client: image: shlinkio/shlink-web-client:stable container_name: shlink-web-client ports: - '127.0.0.1:9765:80' restart: always
1 docker exec -it shlink shlink api-key:generate
1 2 3 4 5 6 7 8 9 10 通过环境变量为默认服务器提供配置。当容器启动时,它将servers.json基于它们动态构建文件。(自 shlink-web-client 3.2.0 起)。 SHLINK_SERVER_URL:Shlink 服务器的完全限定 URL。 SHLINK_SERVER_API_KEY:API 密钥。 SHLINK_SERVER_NAME:要显示的名称。如果未提供,则默认为Shlink。 docker run \ --name shlink-web-client \ -p 8000:80 \ -e SHLINK_SERVER_URL=https://s.test \ -e SHLINK_SERVER_API_KEY=6aeb82c6-e275-4538-a747-31f9abfba63c \ shlinkio/shlink-web-client
如果是docker-compose配置添加默认环境的话也可以,但是莫名其妙没有成功,这里就使用下面的配置,结合config
文件来配置了 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 version: '3.8' services: shlink: image: shlinkio/shlink:stable container_name: shlink ports: - '127.0.0.1:8200:8080' environment: - DEFAULT_DOMAIN=omgl.xyz - IS_HTTPS_ENABLED=true - GEOLITE_LICENSE_KEY=GEOLITE_LICENSE_KEY 需要在 Maxmind 注册帐号获取 - DB_DRIVER=maria - DB_NAME=shlink - DB_USER=shlink - DB_PASSWORD=随机密码1 - DB_HOST=db - DB_PORT=3306 - TIMEZONE=UTC - REDIRECT_STATUS_CODE=301 restart: always db: image: mariadb:10.6 depends_on: - shlink container_name: db ports: - '127.0.0.1:3306:3306' environment: - MYSQL_ROOT_PASSWORD=随机 root 密码 - MYSQL_DATABASE=shlink - MYSQL_USER=shlink - MYSQL_PASSWORD=随机密码1 volumes: - /opt/shlink/data:/var/lib/mysql restart: always shlink-web-client: image: shlinkio/shlink-web-client:stable container_name: shlink-web-client volumes: - ./config/:/usr/share/nginx/html/conf.d/ ports: - '127.0.0.1:9765:80' restart: always
在docker-compose.yml下的文件夹config
建立servers.json
文件,内容格式如下 1 2 3 4 5 6 7 [ { "name": "服务器名称", "url": "https://xxxxx.xxxxxxxxxx", "apiKey": "执行获取的api" } ]
安装heimdall 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 version: "2.1" services: heimdall: image: lscr.io/linuxserver/heimdall:latest container_name: heimdall environment: - PUID=1000 - PGID=1000 - TZ=Etc/UTC volumes: - /path/to/appdata/config:/config ports: - 80 :80 - 443 :443 restart: unless-stopped
1 2 3 4 5 6 7 8 9 10 docker run -d \ --name=heimdall \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Etc/UTC \ -p 80 :80 \ -p 443 :443 \ -v /path/to/appdata/config:/config \ --restart unless-stopped \ lscr.io/linuxserver/heimdall:latest
1 2 3 4 5 6 7 8 9 10 docker run -d \ --name=heimdall \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Etc/UTC \ -p 84 :80 \ -p 5243 :443 \ -v /path/to/appdata/config:/config \ --restart unless-stopped \ lscr.io/linuxserver/heimdall:latest
1 docker run -d --name nas-tools --hostname nas-tools --network=host -p 3000:3000 -v /nastool/config:/config -v /nastools:/nastools -e PUID=0 -e PGID=0 -e UMASK=000 -e NASTOOL_AUTO_UPDATE=false nastools/nas-tools:2.9.1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 version: '3.3' services: nas-tools: container_name: nas-tools hostname: nas-tools network_mode: host volumes: - '/nastool/config:/config' - '/nastools:/nastools' environment: - PUID=0 - PGID=0 - UMASK=000 - NASTOOL_AUTO_UPDATE=false image: 'nastools/nas-tools:2.9.1' restart: unless-stopped
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 version: '3.3' services: nas-tools: container_name: nas-tools hostname: nas-tools ports: - '9703:3000' volumes: - './config:/config' - './nastools:/nastools' environment: - PUID=0 - PGID=0 - UMASK=000 - NASTOOL_AUTO_UPDATE=false image: 'nastools/nas-tools:2.9.1' restart: unless-stopped
安装vertex 1 2 3 4 5 6 7 docker run -d \ --name vertex \ -v /root/vertex:/vertex \ -p 3000:3000 \ -e TZ=Asia/Shanghai \ --restart unless-stopped \ lswl/vertex:stable
1 2 3 4 5 6 7 8 9 10 11 12 version: '3.3' services: vertex: container_name: vertex volumes: - './vertex:/vertex' ports: - '9704:3000' environment: - TZ=Asia/Shanghai restart: unless-stopped image: 'lswl/vertex:stable'
安装screen 安装 使用 1 2 3 4 5 6 7 8 9 10 screen -ls # 浏览当前有哪些后台作业 类似ls命令,列举出所有对话作业。 screen -S <作业名称> # 新建一个screen作业的名称。 screen -r <作业名称> # 恢复之前的一个screen作业。 screen -d <作业名称> # 挂起该作业 screen -S <作业名称> -X quit # 删除该作业 # 关闭退出 exit # 不关闭退出窗口(这样子就可以一直在后台执行) 快捷键 CTRL+A+D
安装cloudreve 看官网 我使用的是非docker安装,因为一个挂载块路径的问题 安装Kavita 官方wiki 安装按照教程来就好了,主要是开机启动的问题,kavita.service
使用官方的配置项莫名其妙启动失败,删除掉用户相关的莫名其妙就好了 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [Unit] Description=Kavita Server After=network.target [Service] Type=simple WorkingDirectory=/mnt/hdd/Kavita ExecStart=/mnt/hdd/Kavita/Kavita TimeoutStopSec=20 KillMode=process Restart=on-failure [Install] WantedBy=multi-user.target
安装 Web File Browser 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 docker run --restart=always --name filebrowser -d -v /onetb/qbitandair/download:/srv -v /onetb/filebrowser/filebrowserconfig.json:/etc/config.json -v /onetb/filebrowser/database.db:/etc/database.db -p 2334:80 filebrowser/filebrowser 或者 version: '3.3' services: filebrowser: restart: always container_name: filebrowser volumes: - '/onetb/qbitandair/download:/srv' - '/onetb/filebrowser/filebrowserconfig.json:/etc/config.json' - '/onetb/filebrowser/database.db:/etc/database.db' ports: - '2334:80' image: filebrowser/filebrowser
浏览器访问localhost:2334 默认账号和密码admin admin 使用root用户在AWS 1 2 3 4 5 6 7 8 9 10 #设置password密码 sudo passwd root #切换root su root #编辑 vim /root/.ssh/authorized_keys 修改内容,删除ssh-rsa以前的内容如下图,保存退出。 这样fianalshell就可以使用root直接登录了。
一键设置虚拟内存 1 2 3 4 5 #国外IP wget -O box.sh https://raw.githubusercontent.com/BlueSkyXN/SKY-BOX/main/box.sh && chmod +x box.sh && clear && ./box.sh #国内IP wget -O box.sh https://ghproxy.com/https://raw.githubusercontent.com/BlueSkyXN/SKY-BOX/main/box.sh && chmod +x box.sh && clear && ./box.sh
短链接的一个介绍博客 Just-Moh-it/Pckd: The most ⚡️ analytics-intensive 💪 self-hostable 🔗 URL shortener, with an amazing UI 😍 地址:https://github.com/Just-Moh-it/Pckd
Hello from Pckd - Docs | Pckd - Docs 地址:https://docs.pckd.me/
Prebuilt Docker image · Issue #32 · PckdHQ/Pckd 地址:https://github.com/PckdHQ/Pckd/issues/32
Pckd - The most ⚡️ analytics-intensive 💪 self-hostable 🔗 URL shortener, with an amazing UI 😍 : selfhosted 地址:https://www.reddit.com/r/selfhosted/comments/srn4wo/pckd_the_most_analyticsintensive_selfhostable_url/
AboutAn open-source link shortener with built-in analytics + free custom domains.
地址:https://github.com/steven-tey/dub
Free Modern URL Shortener.
地址:https://github.com/thedevs-network/kutt
服务器测试 1 2 3 4 5 6 wget -qO- bench.sh | bash 或者 curl -sL bench.sh | bash
参考文章 小知识点 1 2 docker-compose -f docker-compose.yml up -d