1736009215

Community learning 2 lesson 1


# Equipment procurement Lets get started with the first part of the home server lessons. I plan these lessons to take about an hour each as I know alot of people really dont have alot of free time or you dont want to spend 4+ hours on your weekend. If you are like me and love to spend the entirety of your weekend doing this, message me and ill give you all the instructions, it can truly be done in little time once you know your way around. Speaking of knowing your way around. This guide is not going to be instructions that you just copy and paste. There will be parts where you just need to play around. This is more about how to create and maintain a server. If you want to learn nothing and just want a functional product at the end, message me. Ill write a script for you when i have free time. For the rest of you that are here to learn. Lets get started with what you need. As described in the [Community learning 2 post](https://chat-to.dev/post?id=895&redirect=/) you will need a spare computer. Its possible to run this on your desktop but it is not recommended. Please use a blanked drive so that if you mess something up you can just reformat and start over without any losses. Besides a computer and a spare drive you will need access to your home network. This is important especially if you want this service to be available to the internet. Even if you are not wanting to make this available you will still want access because most routers will dynamically change the ip of the device after some time and its a pain to check frequently to see what it is each week. Finally you are going to want another computer to access the server from. If you want you can follow these directions and be on the server via keyboard and a screen. However you are going to want to be able to control the server from any other computer in a "headless" setup, so i recommend you have a extra computer to remote into from as this will be the standard interface method. On to the instructions: <br> First we need to install an OS onto a server. First a quick question, what is a server? The answer is not complex, truly. A server is just a computer, whose purpose is to serve. Wild right? -_- That means that you can configure any computer with any OS to operate as a server. You just need to give it a task and a subject to serve. However, in the name of efficiency we dont use any old windows home edition machine laying around even if it is possible. We are going to use a "lite" OS. Nothing special really, honestly less special then a normal OS. Less special because it will contain only the bare minimum. If you want you can make your own. Search for linux from scratch, its a useful book. Not a good read for sure, but a useful reference tool. Anyways simply a lite system contains only what is needed to operate its self. there will be very few preinstalled applications and no desktop environment. This increases the amount of headroom for us to use. Find an "lite" os of your choice. The only major difference will be your package manager so if you want to copy paste my cmds then pick something debian based. For those who have never installed an OS before, if you encounter issues, message me and ill walk you through slowly. Some popular options are ubuntu server and SLES. Personally ill just be running debian. For transparency ill be running this project alongside you all on an old i386 chromebook and a raspberry pi02w. To install you need to throw the image (most often a .iso) onto a bootable medium. If you want, you can do this by removing the drive directly from your server and burn it directly, or use a flash drive or CD. There are 2 ways to install. It can be an auto-install where you set up everything in advance and you plug it in and it solves it self. The other option is the live install but this requires you to have a screen and keyboard for entry. Ill be doing both because i have my laptop which everything for live install, and automated because its a pi zero and i cant even plug in a keyboard because there arent any use-able ports. Thankfully I said in the requirements that a extra computer is REQUIRED for this class. If you want to do it the automated way [here](https://www.debian.org/releases/stable/i386/apb.en.html) is how to make a preseed that is "plug n play". Its a bit of a pain but super efficient if you are doing this to say, 20 computers at the same time. The rest of us normal people will proceed with the normal installer with a keyboard and screen. To burn the iso to your medium use whatever you already have to burn cd's. If you have none then get brasero or balena-etcher. Both are free. With the iso on the device, return to the server and insert the media. Some computers will have a locked down bios where it will only boot from 1 device. Mash what ever button gets you into your uefi settings. function row is a good bet, esc & del are a good second guess. Find your boot manager and disable the "secure boot" and now you can shift around the devices and select your media as the default boot device. Save and reboot. You should now be in the installer. Most of it is self explanatory so ill just give some advice. Use a wired connection if possible. Configure as much as possible now so you dont have to edit configs post install unless necessary. make sure you are installing to the correct device, this is important if your install media is a cd. select the correct target drive. When it ask if you want to have anything installed, dont. This is a LITE install remember. the goal is to have as little useless things as possible. No desktop, no "recommended utilities". APT will be installed so if you ever change your mind later, you can get those "recommended" and a desktop environment if you choose to. For now though remove everything except SSH. We need this as we will be controlling this machine from our other computer, possibly from even outside your home network if you choose too. We will get to that later as thatll be in the port forwarding section near the end. If you mess anything up, no problem. blank the media and start over. Once your server is finished installed you can remove the media, keyboard and screen, and place the server wherever it is out of the way. Closet is a good option, just make sure there is no fire hazard. If this is a laptop, you will need to research how to prevent your device from going to sleep if the lid closes. I cant help you much here, thats device specific. Anyways, take a look at your home router now. In the device list you should be able to find your server. Its ip address will change every so often so lets stop that. Different routers have different ways to do this. So far ive done it with cisco, netgear, tplink, and d-link routers. Keep in mind even within the same brand, different routers can have different ui's so please refer to the manual. We are looking for a setting that gives us the option to set a static IP. We will need to enter the MAC address of the server and the desired ip. It dont matter what you pick aslong as it is within the reserved block. If you dont have anything special in mind just put the ip that it currently has. Reboot the router and confirm changes. Now that we know the ip of the server and we know that it wont change we can connect to it. On your other computer ssh into the server. During the install when you selected ssh it may have given you a prompt to create a user on that machine. If you already created a user, type `ssh username@ipaddress`. If you did not make a user omit the username. When i connect from my spare computer whose user is David, it will automatically create a user on the machine called David in the usr/ dir. This is nice as it gives me a nice home/ specific to each device i connect from. This means that multiple people can use this server, from different devices and each get their own profile. If you dont want this functionality you can limit the ips able to connect via your router or iptables from within the server. Make sure to have a good password. If you ever need to change a password use `passwd username_here`. I think all this would have taken about an hour, atleast with my download speeds so ill stop here. Ill be in a video call for a bit after publishing this and you can reach me in the community learning chat room for any questions. Make sure to apt update && apt upgrade. See you next week.

(2) Comments
davidm8624
davidm8624
1736378030

Edit function broke. need to update title to learning not learing so that titles show up in "similar post"

amargo85
amargo85
1736388496

go to the CTD room and I'll tell you how to do it.


Welcome to Chat-to.dev, a space for both novice and experienced programmers to chat about programming and share code in their posts.

About | Privacy | Terms | Donate
[2025 © Chat-to.dev]