Create a simple home server
Sometimes there is no Internet connection in my area and since there is not much you could do at that time, I love to watch a movie and listen to my all times favorite music.
All the code is mentioned using $ ......
and you can run it in terminal
Equipment
- Raspberry Pi
- USB hard drive
Hardware configuration
If you have a new raspberry pi you may wish to Download and install OS in it.Download OS from the official link
To install just flash the OS to a memory card and attach it to raspberry pi.
Make a network connection
- wifi
- ethernet
Here you may want to have a fixed Local Network IP since this is what you will connect to for ssh and Plex server
Updating and Upgrading
$ sudo apt update && sudo apt upgrade
Optional
If you intent to use GUI in raspberry pi you can skip this step.
As we are using it as a server we can use remote access tool
- Install an open-ssh server.
To startup CLI as system Boots up.
$ sudo raspi-config
- Boot option
- Desktop / CLI
- choose Console
$ sudo reboot
Connecting Hdd as Raspberry pi boots up
You may need to pump up your USB port output for hdd to work.
sudo nano /boot/config.txt
- > set max_usb_current=1
Make a permanent location where HDD will Connect.
-
$ mkdir /media/hd
(if using NTFS drive install ntfs-3g)
To mount, we will need UUID
Here we will use uuid or partuuid and mention it in /etc/fstab, and when raspberry pi will boot it will auto-mount it to our desired location.
$ sudo blkid
get the UUID of your device
finally, add the device in the /etc/fstab
--> make sure you have a backup in case you mess-up or something went wrong.$ sudo nano /etc/fstab
attach your device using UUID or partuuid
sample file
PARTUUID=06568f1 /media/hd/ auto nofail,uid=1000,git=1000,umask=000 0 0
Plex Installation and configuration.
Download plex directly from Website
You will download a .deb file
-
To excute it
-
$sudo dpkg -i ./plexserver....deb
-
When installation is completed you may wish to reboot.
Now open a browser and head over to IP/web/index.html of your raspberry pi (in my case IP is 192.168.1.100)
--> 192.168.1.100:32400/web/index.htmlYou will need to log in to plex to continue.
-
Adding library
- select the media type
- select the folder
- When you are done it will sync the resources and you are good to go.
Important
since like me you may want to watch content from Plex even when there is no internet connection
This should be done before you encounter "No Internet"
- settings
- Server
- Network
- enable local network discovery
- Click on Advance Settings
- list of IP addresses and Networks allowed without Auth. You can add specific IP's or you may go with something like '192.168.0.0/24'
Well,for syncing I am currently using tools like rsync
. Have better options comment down.
Top comments (0)