1.1 How to Build a Home Server?
Why build our server?
As we all know in this growing world, data is also growing and with the world, our data is also growing. It started with MBs then moved to GBs, and now we are having our know data in TBs. Where do you store all this data? We mostly go with the external hard drives and accessing those data is a typical task and what if you need that data when you are away from your home and not carrying that hard drive as it is also hard to carry all the time.
So why not move to the cloud?
Moving to cloud storage will help you to manage and access data remotely from anywhere without carrying more things. You just need an internet connection and a smartphone.
There are many solutions available to store our data and access it from anywhere. But the issue is with the cost, storing data will cost us a lot, we need to pay a monthly rent for only GBs and yeah, of course, privacy.
Build our cloud.
Building our cloud will help in many ways.
- Data will be safe. Add as many users as you want to.
- We can deploy our application without paying anything to any cloud service provider.
- We don’t have to pay any monthly rent.
- last not least, It looks cool.
Let’s Start
Below is the table of content, that we will cover to build our server.
- Required Components.
- Install OS and access using ssh in the local network.
- Mount storage
- Setup and install Nextcloud
- Required setting to access from anywhere
1. Required Components
- Memory card: 32GB memory card is good enough to install OS.
- Raspberry Pi: We can go with Raspberry Pi 4 with 8 GB. This is a very good pick to build a home server. With the Ram of 8 GB, we can deploy multiple NodeJS applications for your dev purpose.
- External Storage: We are going to store our data in external storage only. In case, if something wrong happens to our OS we will not lose our data. Data will be safely stored in storage only. Like, we do not store our data in the C drive of windows. I picked a 2TB hard drive to go with. You can choose as per your requirement.
- Ethernet Cable: To connect raspberry Pi and Internet Router. Cat6 is a good choice for now.
- Power Cable for Raspberry Pi
- Card Reader
2. Install OS
Now, we start with installing OS on Memory Card.
First, insert the memory card into the laptop. Plus, download and install Raspberry Pi Imager.
Step 1: Select Raspberry Pi OS Lite
Go to Choose OS -> Raspberry Pi OS (Other) -> Raspberry Pi OS Lite (32-bit)
Step 2: Select Memory Card as storage
Go to Storage -> Select your Memory Card
Step 3: Click on the Write button and then Verify after installing.
Once the installing is done it automatically ejects the memory card. Please check and re-insert.
Note: Do not forget to create an empty ssh file in the root directory. This will enable SSH.
Go to Memory Card and create ssh file in the root directory
BOOOM, we are done with the OS installation part. Now, we will connect our Raspberry Pi to the internet and try to access the device in our local network using SSH
- Insert Memory Card in Raspberry Pi.
- Connect Router and Raspberry Pi Via Ethernet Cable.
- Supply Power.
Connect via SSH
We can connect our device using ssh commands likessh pi@<ip>
First, we need to find out the Raspberry Pi IP address. For that, we will just go to our router address. Mine is 192.168.1.1
. Open your browser and go to your router address.
Once you logged into your route panel. You can find all the connected devices. Like below, check the IP address for your Raspberry pi. In my case its 192.168.1.24
Using that IP address, access your device remotely.
ssh pi@192.168.1.24
Once you run the above command using your IP address for Raspberry Pi. It will ask you the password. Default password is raspberry
.
Do not forget to change your default password. Use passwd
command to change the current password. Refer to the screenshot I attached below.
Root User
Let’s set up a password for the root user as well. We will be doing everything on root user only.
To change the root password. Use sudo passwd
command.
Thank You!
Till now, We have successfully installed OS and hosted our Home server on the local network only.
In the next blog, We will be going to extend storage and install Nextcloud to access and store data via browser.