Navidrome是开源的音乐服务器,它可以把硬盘的音乐文件以流媒体的方式呈现出来,就可以在任何的浏览器收听自己的音乐,并兼容subsonic API接口,也可以在第三方的客户端,最终在PC和手机,平板上实现全平台的音乐输出。
这里我在自己的万由NAS上自建一个开源播放器,我这里尝试了subsonic
、Navidrome
这两款开源的程序,两款我都安装了,在使用一段时间后还是navidrome
的服务,主要是UI界面比较讨好我,性能方面都差不多。
大概的安装方式,看一下官方文档,这里我使用Debian来进行安装,嫌麻烦可以使用docker方式安装。
安装方法
- 系统安装运行条件
sudo apt update
sudo apt upgrade
sudo apt install vim ffmpeg
- 新建一个用户和用户组来运行
# 创建用户组
groupadd -r navidrome
# 创建用户
useradd -r -g navidrome -s /sbin/nologin -M -c "Navidrome Daemons" navidrome
- 创建navidrome的安装目录和运行目录
sudo install -d -o navidrome -g navidrome /opt/navidrome
sudo install -d -o navidrome -g navidrome /var/lib/navidrome
- 获取最新安装包
在GitHub的发布页面下载最新版本,将内容解压到可执行的安装目录。
wget https://github.com/navidrome/navidrome/releases/download/v0.49.3/navidrome_0.49.3_Linux_x86_64.tar.gz -O Navidrome.tar.gz
sudo tar -xvzf Navidrome.tar.gz -C /opt/navidrome/
sudo chown -R navidrome:navidrome /opt/navidrome
- 创建navidrome的配置文件
查看navidrome给出的配置文件可用选项,自己进行调优
# 创建配置文件
vim /var/lib/navidrome/navidrome.toml
# 编辑写入
MusicFolder = "<library_path>"
Port = "31500"
ps:<library_path>修改为音乐文件存放路径,port为远程服务的端口,如果不需要就去除使用默认的4533端口
- 创建启动服务选项
vim /etc/systemd/system/navidrome.service
复制粘贴加入以下内容,要注意的是user和Group的配置,不然会无法启动报错。
[Unit]
Description=Navidrome Music Server and Streamer compatible with Subsonic/Airsonic
After=remote-fs.target network.target
AssertPathExists=/var/lib/navidrome
[Install]
WantedBy=multi-user.target
[Service]
User=navidrome
Group=navidrome
Type=simple
ExecStart=/opt/navidrome/navidrome --configfile "/var/lib/navidrome/navidrome.toml"
WorkingDirectory=/var/lib/navidrome
TimeoutStopSec=20
KillMode=process
Restart=on-failure
#See https://www.freedesktop.org/software/systemd/man/systemd.exec.html
DevicePolicy=closed
NoNewPrivileges=yes
PrivateTmp=yes
PrivateUsers=yes
ProtectControlGroups=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
RestrictNamespaces=yes
RestrictRealtime=yes
SystemCallFilter=~@clock @debug @module @mount @obsolete @"reboot"#42 @setuid @swap
ReadWritePaths=/var/lib/navidrome
# You can uncomment the following line if you're not using the jukebox This
# will prevent navidrome from accessing any real (physical) devices
#PrivateDevices=yes
# You can change the following line to `strict` instead of `full` if you don't
# want navidrome to be able to write anything on your filesystem outside of
# /var/lib/navidrome.
ProtectSystem=full
# You can comment the following line if you don't have any media in /home/*.
# This will prevent navidrome from ever reading/writing anything there.
#ProtectHome=true
- 更新并启动navidrome
# 更新服务列表
systemctl daemon-reload
# 启动navidrome服务
systemctl start navidrome.service
# 查看navidrome的服务运行状态
systemctl status navidrome.service
查看服务状态为 Active: active (running)
的服务状态,并在防火墙开放当前端口之后
使用IP:你的端口 默认为4533 访问当前服务器,并设置管理员账号密码后,添加自启动服务。
systemctl enable navidrome.service
支持第三方应用
iOS:play:Sub、 substreamer、 Amperfy和 iSub
安卓:DSub、Subtracks、substreamer、Ultrasonic、Audinaut、音流
网络:Subplayer、 Airsonic Refix、 Aurial、 Jamstash和 Subfire
桌面:Sublime Music (Linux) 和Sonixd (Windows/Linux/macOS)
CLI:Jellycli (Windows/Linux) 和STMP (Linux/macOS)
这里安特一下国内开发者的音流
APP,暂时支持两个平台subsonic
、navidrome
。
最新评论
我现在基本都不是用QQ了,电脑没装,手...
我成为了范例 😃
看起来很完美。
1ro.cn 还收不,怎么联系不到人
你的feed貌似有点问题。你看下。`v...
哈哈哈,路过。看到了