1
Service:MeTube
Jeffery edited this page 2026-03-06 02:52:05 +00:00

安裝相關套件

apt update && apt install -y git nodejs npm curl ffmpeg

下載 MeTube

git clone https://github.com/alexta69/metube.git

安裝 MeTube

前端

cd ~/metube/ui && npm install && node_modules/.bin/ng build

後端

cd ~/metube && curl -LsSf https://astral.sh/uv/install.sh | sh && uv sync

設定環境變數

echo 'source $HOME/.local/bin/env' >> ~/.bashrc && source ~/.bashrc

執行 MeTube

uv run python3 app/main.py

設計 MeTube 服務

nano /etc/systemd/system/metube.service

服務檔內容

[Unit]
Description=MeTube

[Service]
Type=simple
WorkingDirectory=/root/metube
ExecStart=/root/.local/bin/uv run python3 app/main.py
Restart=always
User=root

[Install]
WantedBy=multi-user.target

啟動服務

systemctl daemon-reload && systemctl enable metube.service && systemctl start metube.service

連接埠 8081