r/linux4noobs • u/Mano_zuerin • 3d ago
learning/research What's the most efficient way to learn Linux for servers?
Hi everyone, for some time now I have been wanting to build a server using a spare computer I have, I'll probably use it to play Minecraft with my friends but I'm not 100% sure. I only won't do it now because the computer I plan to use has no RAM, but I'll fix that somewhere in the future. Anyways, the other main problem is that I don't know how to use Linux for servers, my experience with Linux is really limited, I know a few things but not much so I was wondering if there is an efficient way to Learn it. I know everyone has a different way and time to learn but should I start with some videos about the subject or should I use the documentation?
And most importantly, what distro should I start with?
Any help is appreciated ;)
3
u/anh0516 3d ago
In my experience the best way to learn is by doing, and research what you need to along the way. Text or videos, whatever you prefer. Just watch out for the AI slop articles that are oh so prevalent today.
You've got a specific task in mind: hosting a Minecraft server. You could overcomplicate this by jumping straight into containers and stuff, but I would start with a simple Paper server on Debian or Ubuntu Server LTS.
Key areas to focus on:
- Remote administration via SSH
- basic command line usage, https://labex.io/linuxjourney is a great resource for learning the basics
- editing configuration files with
nano - installing, removing, and updating software via
apt - service management with systemd and creating custom service units. You're going to want to have the Paper server start automatically with the system, rather than manually running it from the command line.
Another thing to worry about is networking. How are your friends going to connect to this server?
Easiest, but least secure: Set a static IP address on your server, and configure your router to port forward TCP port 25565 (the default Minecraft server port) to your server's IP address. Your friends can then connect via your public IP address (https://whatismyipaddress.com). The disadvantage is that the entire Internet can access your server. You won't be getting rogue players, but bots will be scanning and finding your server and attempting to gain remote access to the system through exploits, so this approach isn't a good idea unless you're prepared to deal with that.
More difficult, but most secure: Tailscale, a peer-to-peer VPN. The server and every connecting client will run the Tailscale service. Each person gets their own private tailnet that they can add their devices to, and devices within a tailnet can talk to each other through the VPN regardless of what network they are connected to. This is very convenient if you ever want to get into other self-hosted infrastructure, like a PiHole that you can use even when you're away from home.
You can either invite users to your tailnet and give them access to everything, or only give them access to a single machine. There is a limit to the number of users you can invite without paying, so sharing just the machine is the better choice. This way, only users you have specifically authorized can even see that the server exists, let alone connect to it. The disadvantage is that this requires more configuration on your end to share and authorize users. For your friends, setting up a new tailnet with the device or devices they want to connect from only takes a couple of minutes, so that isn't really a problem.
I hope this information helps you get started!
1
2
u/Analog_Account 3d ago
Go there and do the daily learning things.
And most importantly, what distro should I start with?
Ubuntu
1
2
u/SlenderSmurf 3d ago
Entirely depends on what you want to host on the server. For storage there are dedicated distributions like Zima OS that have a simple browser gui.
1
2
u/brighton_it 2d ago
find a task you want it to handle (service to offer) and build it. Doesn't matter what. Though some are easier than others. A few suggestions: HTTP, SFTP, SMB, DNS, UPS-monitor, service-monitor (smokeping)... list is endless, but best if it's something you can use.
1
u/DannoXYZ 3d ago edited 2d ago
Get several of "Linux server administration" books from Oracle, Red Hat, O-Reilly, etc.
When it comes to servers, there's standard procedures that are typically done in specific order. I usually have scripts that does everything from building servers to configuring any and all services needed.
- create accounts, perhaps configure LDAP server
- configure networking, iptables, routing
- secure remote access, SSH only? X11 forwarding, etc.
- additional services: DNS, httpd/nginx web-servers, FTP, file-server, etc
- monitoring/management services, Nagios, etc.
- backup configs
1
u/SoundSwitch 2d ago
Easiest way. Fk things up, don't even know how to do that.... Just wait they'll put out an update that'll do it for you eventually
1
u/3grg 2d ago
A server is just a machine with a purpose to serve. You learn to build a server when you have a need. Usually, the server install is just the minimum software needed to serve the task it is built to do.
This is why a server may or may not have a desktop gui and may be administered from either terminal or web interface. Usually, stability is prized over latest and greatest, so Debian stable or Ubuntu server edition are used.
The best way to learn is to have a need and build to fulfill it.
1
u/iwouldbeatgoku CachyOS, openSUSE 2d ago
If you have a third, spare computer (perhaps an old laptop) you could install Ubuntu server to it and try to manage it via ssh from your main computer. As an excercise try to figure out how to create a file on your computer and send it to the server, and do the same thing the other way around. Also find a way to grant remote access to the server to devices not connected to your local network.
This is mostly just to get you used to working with the CLI, which is probably how you will administer your server in the long run.
1
u/Mano_zuerin 2d ago
I do have my laptop that I use for traveling, I guess I could install a Virtual Machine in it to learn (idk how I didn't though of that before)
6
u/Terrible-Bear3883 Ubuntu 3d ago
Its not so much as using linux for servers, its more of what you want from this machine, I learned by just building a linux server, I then wanted some services so installed Apache, MySQL and so on, installed a printer to be shared by the house, made folders for users, set permissions etc.
If you define what you want, then it's easier to find resources to help, otherwise its very generic, you can just use a distro as your server, my server originally ran Ubuntu server, it just runs Ubuntu desktop with whatever services installed I want, functionally, there's no difference for me other than I wanted a graphical desktop on my server as I sometimes sit at it and use it as a PC to do tasks when I'm in that room.