--- layout : post title : "mStream——自建音乐库" subtitle : "ADs? pay for songs? Go away!" date : 2022-05-15 01:16:46 author : "Manford Fan" catalog : false header-img : "img/post-bg-universe.jpg" tags : - mStream - Music - Server --- 本来想将这个内容加到"[Debian Server部署全过程记录](https://blog.rustle.cc/2022/03/29/debian-server/)"中的,但是一方面,由于这篇博客太长了,不好再往里加内容,另一方面,想把这种做成一个系列,后续还会有自建家庭影院,自建家庭相册等,最重要的是,还可以水一篇blog(不好意思断更太久不是,哈哈哈)。因为音乐付费以及广告的问题,很早之前就有自己host一个音乐站点的想法了,由于一直在忙其他的,本周六稍微安稳了一点(包括内和外,心累...),就赶紧去找了一下,最后锁定mStream这个开源方案,看[Github](https://github.com/IrosTheBeggar/mStream)上的提交记录,作者已经不经常更新了,不过搭建完之后看还是不错的,算是比较完善了。 > **【update @ 10/16/2022】已经发现一个更好的音乐库解决方案,本方案弃用......** ## 一、安装mStream > mStream is a personal music streaming server. You can use mStream to stream your music from your home computer to any device, anywhere. 如上是官方对mStream的介绍,很简洁,就是让你可以在任何设备上访问你自己电脑上的音频流,即`mStream`支持跨平台,安卓,iOS,Windows,Linux,Mac都有客户端。至于安装配置,[官网](https://mstream.io/)也介绍的很清楚了,有三种方式:docker,源码,以及二进制包,其优缺点也各有介绍。由于我的小破站资源并不是很丰富,本着能省一点内存是一点的原则,选择了源码安装,官网的介绍优点是节省资源,缺点是不能自己开机启动,个人感觉这个并不是个问题。 ```bash $ curl -fsSL https://deb.nodesource.com/setup_18.x | bash - $ apt-get install -y nodejs $ git clone https://github.com/IrosTheBeggar/mStream.git $ cd mStream $ npm run-script wizard ... ____ _ _ __ ___ / ___|| |_ _ __ ___ __ _ _ __ ___ | '_ ` _ \\___ \| __| '__/ _ \/ _` | '_ ` _ \ | | | | | |___) | |_| | | __/ (_| | | | | | | |_| |_| |_|____/ \__|_| \___|\__,_|_| |_| |_| v5.11.4 Check out our Discord server: https://discord.gg/AM896Rr 2022-05-14T16:54:26.306Z info: Config File does not exist. Attempting to create file 2022-05-14T16:54:26.309Z info: Config file does not have secret. Generating a secret and saving 2022-05-14T16:54:26.331Z info: Access mStream locally: http://localhost:3000 ``` 当看到如上的输出时,说明mStream已经成安安装,并启动,在浏览器输入http://localhost:3000即可看到界面。