08-09-2018, 12:00 PM
Installation of Peerflix on Ubuntu 16.04 LTS Server
Table of content
- Introduction
- Server Preparation
- Installation of NodeJS
- Installation of Peerflix
- Finale
1. Introduction
Hello Community
I decided to make this tutorial to help a new member of this forum. @Amresh opened a topic a bit ago in which he requested for help with the installation of Peerflix on a VPS.
So in this tutorial you will learn how to install NodeJS and Peerflix on a server with Ubuntu 16.04 LTS Server as its OS. I will try to keep it brief and as easy as possible. On the request of @Amresh this tutorial will also include screenshots of the installation process.
I don't use Peerflix myself! Unfortunately I won't be able to provide any help or support for it therefore. Please use the official ways to get support for it. Neither am I experienced with NodeJS! Just making this tutorial to help with the installation.
Sorry that the last 11 images aren't actually embedded as images. This forums only allows 10 images to be embedded as real images that you can instantly see without having to open another link
I decided to make this tutorial to help a new member of this forum. @Amresh opened a topic a bit ago in which he requested for help with the installation of Peerflix on a VPS.
So in this tutorial you will learn how to install NodeJS and Peerflix on a server with Ubuntu 16.04 LTS Server as its OS. I will try to keep it brief and as easy as possible. On the request of @Amresh this tutorial will also include screenshots of the installation process.
I don't use Peerflix myself! Unfortunately I won't be able to provide any help or support for it therefore. Please use the official ways to get support for it. Neither am I experienced with NodeJS! Just making this tutorial to help with the installation.
Sorry that the last 11 images aren't actually embedded as images. This forums only allows 10 images to be embedded as real images that you can instantly see without having to open another link
2. Server Preparation
Before you can start with installing anything it is always a good idea to keep your server update and fresh. So we will first perform a little bit of preparation before going on with the installation of NodeJS for Peerflix and finally the installation of Peerflix.
Connect to your server via SSH and login as a user with administrative permission via sudo or if you like simply as root. I will be using a normal user account that has administrative permission through sudo.
To login into your server via SSH you need a SSH client. Use PuTTY: https://www.chiark.greenend.org.uk/~sgta...atest.html - Just download the latest putty.exe in 32 Bit or 64 Bit to your computer.
After you have downloaded it open the download folder and double click the putty.exe file to start PuTTY.
In the PuTTY window enter the IP address or domain of your server into the "Host name (or IP address)" field and then click on the "Open" button to connect to your server.
If you connect the first time to your server from your computer you will see a security alert. In the security alert window simply accept the warning by clicking on the "Yes" button.
After that enter the username and password of the user you want to login with. Don't worry, in Linux you cannot see passwords when you type them. Hit enter after you have entered the username and password. After successful login you will be greeted by the server.
Now it is time to update the package database on the server to perform a OS and package update. To do so run the command "sudo apt-get update" in PuTTY. If you are logged in as root simply run "apt-get update" as sudo is not necessary when logged in as root. If you use sudo you will be asked to type in your password!
Once that is done it is time to update the OS and the installed packages. Run the command "sudo apt-get upgrade -y" to do this. If you are logged in as root simply run "apt-get uprgade -y" as sudo is not necessary when logged in as root.
When the update of the OS and package has finished it will return you automatically to the commandline.
Image: https://i.imgur.com/YTQ6XV9.png
The server preparation part is finished. You have logged into your server with a user that has administrative permission or root and you have updated your OS to keep it fast, fresh and secure.
Connect to your server via SSH and login as a user with administrative permission via sudo or if you like simply as root. I will be using a normal user account that has administrative permission through sudo.
To login into your server via SSH you need a SSH client. Use PuTTY: https://www.chiark.greenend.org.uk/~sgta...atest.html - Just download the latest putty.exe in 32 Bit or 64 Bit to your computer.
After you have downloaded it open the download folder and double click the putty.exe file to start PuTTY.
In the PuTTY window enter the IP address or domain of your server into the "Host name (or IP address)" field and then click on the "Open" button to connect to your server.
If you connect the first time to your server from your computer you will see a security alert. In the security alert window simply accept the warning by clicking on the "Yes" button.
After that enter the username and password of the user you want to login with. Don't worry, in Linux you cannot see passwords when you type them. Hit enter after you have entered the username and password. After successful login you will be greeted by the server.
Now it is time to update the package database on the server to perform a OS and package update. To do so run the command "sudo apt-get update" in PuTTY. If you are logged in as root simply run "apt-get update" as sudo is not necessary when logged in as root. If you use sudo you will be asked to type in your password!
Once that is done it is time to update the OS and the installed packages. Run the command "sudo apt-get upgrade -y" to do this. If you are logged in as root simply run "apt-get uprgade -y" as sudo is not necessary when logged in as root.
When the update of the OS and package has finished it will return you automatically to the commandline.
Image: https://i.imgur.com/YTQ6XV9.png
The server preparation part is finished. You have logged into your server with a user that has administrative permission or root and you have updated your OS to keep it fast, fresh and secure.
3. Installation of NodeJS
Peerflix is a NodeJS application and in order to run NodeJS applications on servers or computers we need the NodeJS framework and its additional service programs. At this point we will install NodeJS on the server.
What we need to do first is that we have to add the NodeJS repository to our package manager sources so we can get recent NodeJS version. To do this run the command below. It will download a script that will automatically add the correct repository for Ubuntu 16.04 LTS Server into the package manager sources.
Image: https://i.imgur.com/gTJ0I5Z.png
Once it is done you will see the following message and it will also return you back into the commandline.
Image: https://i.imgur.com/xTEDrJ5.png
Now you we can install NodeJS with the command "sudo apt-get install -y nodejs gcc g++ make". If you are logged in as root simply run "apt-get install -y nodejs gcc g++ make" as sudo is not necessary when logged in as root.
Image: https://i.imgur.com/xOnXogg.png
Once that is done you will be brought back to the commandline again.
Image: https://i.imgur.com/9p94fEh.png
You've made it . NodeJS is now installed on your server.
What we need to do first is that we have to add the NodeJS repository to our package manager sources so we can get recent NodeJS version. To do this run the command below. It will download a script that will automatically add the correct repository for Ubuntu 16.04 LTS Server into the package manager sources.
Code: (Select All)
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
Image: https://i.imgur.com/gTJ0I5Z.png
Once it is done you will see the following message and it will also return you back into the commandline.
Image: https://i.imgur.com/xTEDrJ5.png
Now you we can install NodeJS with the command "sudo apt-get install -y nodejs gcc g++ make". If you are logged in as root simply run "apt-get install -y nodejs gcc g++ make" as sudo is not necessary when logged in as root.
Image: https://i.imgur.com/xOnXogg.png
Once that is done you will be brought back to the commandline again.
Image: https://i.imgur.com/9p94fEh.png
You've made it . NodeJS is now installed on your server.
4. Installation of Peerflix
It is finally time to install Peerflix on the server as you have finished server preparation and already installed the necessary NodeJS framework and additional service programs.
You can install peerflix via the NodeJS package manager "npm" with the command "sudo npm install -g peerflix-server". If you are logged in as root simply run "npm install -g peerflix-server" as sudo is not necessary when logged in as root.
Image: https://i.imgur.com/lyifGAg.png
The installation process may take a bit of time. The NodeJS package manager will resolve package dependencies and actually install everything needed for peerflix automatically before it can install peerflix. When the installation is finished you will see a screen similar to the following one.
Image: https://i.imgur.com/Vgl7WZ2.png
You probably don't want to start peerflix everytime by hand. So you need a daemon service that will run the peerflix-server automatically in the background. You can install the NodeJS daemon program "forever" with the command "sudo npm install -g forever". If you are logged in as root simply run "npm install -g forever" as sudo is not necessary when logged in as root.
Image: https://i.imgur.com/1OFcbwA.png
Once that is installed run the command "sudo forever start $(which peerflix-server)" to launch peerflix-server as a service. If you are logged in as root simply run "forever start $(which peerflix-server)" as sudo is not necessary when logged in as root.
Image: https://i.imgur.com/tykfwYq.png
You can stop the peerflix-server service with the command "sudo forever stop $(which peerflix-server)". If you are logged in as root simply run "forever stop $(which peerflix-server)" as sudo is not necessary when logged in as root.
Image: https://i.imgur.com/ruGyUsj.png
That's it folks. The peerflix-server is now installed and can be ran as a system service.
You can install peerflix via the NodeJS package manager "npm" with the command "sudo npm install -g peerflix-server". If you are logged in as root simply run "npm install -g peerflix-server" as sudo is not necessary when logged in as root.
Image: https://i.imgur.com/lyifGAg.png
The installation process may take a bit of time. The NodeJS package manager will resolve package dependencies and actually install everything needed for peerflix automatically before it can install peerflix. When the installation is finished you will see a screen similar to the following one.
Image: https://i.imgur.com/Vgl7WZ2.png
You probably don't want to start peerflix everytime by hand. So you need a daemon service that will run the peerflix-server automatically in the background. You can install the NodeJS daemon program "forever" with the command "sudo npm install -g forever". If you are logged in as root simply run "npm install -g forever" as sudo is not necessary when logged in as root.
Image: https://i.imgur.com/1OFcbwA.png
Once that is installed run the command "sudo forever start $(which peerflix-server)" to launch peerflix-server as a service. If you are logged in as root simply run "forever start $(which peerflix-server)" as sudo is not necessary when logged in as root.
Image: https://i.imgur.com/tykfwYq.png
You can stop the peerflix-server service with the command "sudo forever stop $(which peerflix-server)". If you are logged in as root simply run "forever stop $(which peerflix-server)" as sudo is not necessary when logged in as root.
Image: https://i.imgur.com/ruGyUsj.png
That's it folks. The peerflix-server is now installed and can be ran as a system service.
5. Finale
Let's make a small summary of what we have done so far.
We have updated out server OS and all packages to the latest version. After that we added package sources for the newest NodeJS version and then we installed NodeJS and all necessary additional service programs for it. After that we installed the peerflix server and a tool to run it as a service. At the end we launched the peerflix server as a service.
Now the last step is to open the browser of your choice and access the installed peerflix server over the URL:
Image: https://i.imgur.com/bisjFLj.png
Happy Streaming!
We have updated out server OS and all packages to the latest version. After that we added package sources for the newest NodeJS version and then we installed NodeJS and all necessary additional service programs for it. After that we installed the peerflix server and a tool to run it as a service. At the end we launched the peerflix server as a service.
Now the last step is to open the browser of your choice and access the installed peerflix server over the URL:
Code: (Select All)
http:\\<IP address of your server>:9000\#\
Image: https://i.imgur.com/bisjFLj.png
Happy Streaming!