First we need a computer where we will install programs to make it into a server. Any PC will do, laptops are often a good choice since they also have their own battery to keep them online in case of power outage.
Your machine doesn't need to be high end or have any special requirements.
Servers often require less resources then a reguluar gaming laptop.
Also there are often high quaility inexpensive servers you can buy second hand on the internet, but they can be very loud. They may look unusal, unlike PC, huge and flat, but inside they are basicaly just a regular PC you use everyday. The only real difference is that there is usually at least two of everything inside, 2 seperate CPUs, two power supplies, multiple RAM and hard drive slots. However, you can install all the same software on them as a regular PC, they are the same architecure, just more specialised to rarely be offline and louder.
You don't need a strong Internet connection to have a server. You only need to have access to log into your router by visiting it's webpage.
You will need to find an IP address of your router, most often it is either 192.168.1.1
or 192.168.0.1
, so first you should type http://192.168.1.1
in your browser and check other common IP addresses if that doesn't work. Don't forget http:// in front of the IP address, otherwise your browser might just reddirect you to the default search engine that is set in your browser instead of opening the page.
If no page opens for either of these urls, you will need to find the IP address of your computer. On GNU/Linux you can use ip route list default
in your terminal. It should say something like default via 10.0.2.1
, type those 4 numbers with dots between them in your browser like http://10.0.2.1
.
On some GNU/Linux or BSD distros you will only have "ifconfig" command. Instead of usuing ip
command, use ifconfig -a
and look for set of 4 numbers devided by a period .
, like in the above example and type in your browser first 3 followed by a dot .
, just don't write the last numberand write number 1
instead of it. Example: inet 10.0.4.42/16
, write http://10.0.4.1
in your browser.
Credentials for access to your router are often written on the back of your router. If you where given multiple devices by your Intrenet Service Provider (ISP), your router is probably the one that is not directly connected to the cable leading outside of your house/appartment. It is the device that you directly connect your computer to, either over cable or wifi.
Only setting that intrests us is port forwarding, usually found in the firewall section of your routers web portal, but it videly differs from one model of router to the next. Sometimes you only have credenials for some basic router settings and you can't access port forwading settings, although they are almost always available by usuing some set of credentials. If you can't find anyware that port forwarding or port mapping is mentioned, try to look up on the Internet if somebody shared admin credentials for your model of a router. Often Internet service providers (ISP) will use same set of credentials for admin accounts.
Although it is not necessary, it is often a good practice to edit your BIOS settings to allow for automatic powering on, in case of power outage.
BIOS menu differes on different computers and entering them is different as well. Usually when you turn on your PC, a screen will show for a second or two telling you to press F1
or Del
key to enter setup. The key can be different, but it is always at the very beggining of the boot process, so you have to be fast and you might miss it a few times and see your system fully power on, before you succeced. You can also search on the Internet for the exect key used on your model of motherboard/laptop.
If you have Windows installed on your PC, you might not even be able to get into the BIOS setup due to something called fast boot. In that case unplug your PC and/or remove battery from your laptop and try booting afterwards, to make sure your PC is fully shutoff. If that doesnt work, search on the Internet how to do full shutdown of your Windows machine, or simply remove the harddrive from your PC.
To put it simply you will need to install some Linux distro on your machine to make it run as a server. You can use BSD as well, but you will rarely be using Windows as a server.
In order to install Linux on your PC you will need to either enter BIOS menu and find Boot order menu or find out what is a key to enter directly into boot menu for your PC.
In the boot menu you need to select the USB with the Linux installation or change the boot order in BIOS settings so that your USB is at the top.
In order to place intallation of Linux on your USB flash drive, you can either use dd
command on Linux and BSD (BUT USE lsblk
BEFORE TO BE SURE!) or use Rufus for Windows. If you have MacOS, you will need to buy a different computer, since Mac computers can't be used to install Linux on them.
To use dd
command first run lsblk
on your Linux system after inserting your USB drive. You will see names of different drives on your computer like sda
and sdb
and their sizes in gigabytes. Usually the last entry is the name of yourUSB drive, but it is simplest to find it by looking at the sizes.
The name of the drive has no numbers in it. The rows that you see that have numbers at the end of their names, like sda1
, are names of the exact partisions of your drive.
If you are using BSD or if you are not sure, you can use dmesg
command to find out the name of the drive, you will need sudo (or root) access to use it. On BSD they are named differently, something like sd1
or something like that, names of partitions end with a letter, sd1a
.
Once you are certain of the name of the drive you can use dd
command, by running
dd if=installation_image.img of=/dev/sdc bs=1M
Replace installation_image.img
with the path to your installation file that you downloaded from the website of your chosen distro. For example
dd if=/home/alice/Download/debian-12.2.0-amd64-netinst.iso of=/dev/sdc bs=1M
You will know that dd finished copying when you get a prompt for commands in your terminal, like it was before you ran the dd
command.
One of the popular GNU/Linux distros is Debian.
During installation follow the instructions and answer questions asked by the installer. Mostly you can just click through by clicking next, but I will mention some frequently asked questions here.
In the very begginging choose Graphical install
. For the hostname simply enter the desired name of your computer, this option is not really important. For the domain name enter nohting. You can choose "Guided" partitioning and you probably shouldn't encrypt your drive if you want your computer to automatically boot after possible power outage. For the Desktop envirement
you can uncheck that option, as you don't need it for a computer running a server, but GNOME is the just fine. Enable ssh server
, this will save us some time, but it is not an important option. Make sure that for GRUB boot loader you selected your hard drive and not your USB.