This is post number two in my series about building a Linux Home Server. You can check out the first post right here about the planning of the server.
Last week I started the journey of setting up my own Linux home server. I sat down and planned everything out in my first post, and this week it was time to start getting to work on it. I’m still waiting on a piece of hardware to show up so I thought, in the mean time, I’ll get the basic setup done.
Getting the Server Software
Last post I started looking at a specific distribution for this setup. Called Raspliance, it came built with a few server essentials for my needs. However, I quickly found out that, for whatever reason, it won’t boot on my Raspberry Pi. So I put the thinking cap on.
In my case, there was no need to really dig far, as a build of Debian is available from Raspberry Pi in the form of Raspbian. So I headed to the page to the left and grabbed the latest desktop image. The reason for the full distro and not the lite version will become apparent here in a little while.
Raspbian is basically the latest version of the Debian Linux distribution made for the architecture of the Raspberry Pi. Being an ARM device, it does require a few tweaks to the Linux kernel. Also, it runs the OS from a Micro SD card, and not on board storage.
Flashing the OS to the Server
The simplest part of the project is flashing the operating system. I am writing the image from a Linux desktop, Kali Linux to be specific. So the dd command makes it simple to write the image to the SD card for use. It did take some time for it to write the whole image, but there were no errors or missing blocks when the write was completed. After this, it is time to pop that SD card into the Pi and boot up my home server for the first time.
First Boot and some House Keeping
First boot was quick, and immediately loaded me into the desktop. When using a full image as I did in this case you quickly figure out that there is a lot of software that you can do away with. And that is something you definitely want to do. Why? Because this is a home server, not a home desktop. The plan is to make this an installation that is accessed through SSH and the Webmin interface. There is absolutely no reason for applications like Libre Office, Games, and accessories like a calculator and text editor. I will be using VIM and nano for any file editing that needs to be done.
So first thing was first. The handy tool for removing unwanted packages from the distro went into full gear. The good thing about having the full distribution was that it already included a few things that I will be making use of on this home server including SSH capability, Python platform, and a few other handy development tools. Anything that didn’t relate to direct need was immediately axed.
Setting Up the Critical Settings
After removing unwanted packages from the setup, there were a couple of crucial settings that needed to be updated in order to make the home server functional as a standalone unit. Luckily there are multiple ways to do this on the Raspberry Pi so I chose the graphical settings interface so it would be easier to show all the settings that were changed.
First thing you will see on the right are some basic settings that should be setup no matter what kind of installation you are running. Changing the user password, setting up the hostname, and more. You will also see a few options like which interface you want to boot into and auto login. For this particular setup I want it to boot into the CLI because after that’s setup, I will be removing the desktop environment. Also, since this is a home server and not a production type server, it is safe to set it up to auto login. This is actually a big advantage on this setup.
On the picture to the right you will see and extra set of settings. This controls the different active interfaces on the Raspberry Pi home server. Since I don’t have an interest (yet) in adding many peripherals to this, the only interface I need active on boot is the SSH interface to be able to login and actually administer the server. So for now, the rest of the interfaces stay disabled. In the future, should I need them, I will have the option to enable other interfaces via the terminal.
Update and Relocate
Last but not least in the initial setup process, run the first updates, power down, and relocate the server to its more permanent residence. So with a simple sudo apt-get update and sudo apt-get upgrade I applied the necessary updates and powered down the PI. This is when I moved it over to it’s permanent residence near my router and modem. Main reason for this location: The server will be plugged directly into the modem. This provides a faster network connection and a better way to issue the server a static IP whicKapow! Success! The server is in running order, SSH is enabled, and now the real fun can begin. h will become a necessity. This is also good because it keeps me from eating the bandwidth of my router.
Moment of Truth
I plugged the network cable into the Raspberry Pi home server and then hooked up the power. Remember the auto login thing? This is why it comes in handy. By default, you cannot SSH into the device as the root user. Which is actually a good thing. So after a little time to let it fully boot up, I opened my terminal to start an SSH session.
Kapow! Success! The server is in running order, SSH is working, and now the real fun can begin.
In the next post of the series, I will be getting into hooking up peripherals, USB Hub, cooling fan, and external hard drive. I will also start installing the other platform tools and packages that will be necessary for further use of the server. We’ll look at adding the Webmin package for graphical administration of vital server functions, we will setup zram to give more virtual memory to the system. I will be configuring which parts of the server functions will exist on which storage devices. So stay tuned for the third post in the series soon.