Server Setup

This guide will hopefully be a good introduction to self-hosting. I will also assume you don’t know shit about hosting, if you do, get the fuck out this guide isn’t for you.

I wont get too technical with this, its simply a tutorial to get you ready to host stuff, you don’t need to have much knowledge right away. If you are interested enough you will get it later.

Requirements:

Hardware

This is an obvious requirement when you want to self host something.

Any PC that came out on the last decade will work depending on what you want.

Realistically you would want a PC you can have it on 24/7 as well a decent connection thru Ethernet.

You will also need an USB drive.

Free time

Especially if you are a complete noob you will need at least 1 whole hour of free time to set this up, assuming you might fuck up the process (because if you don’t, this can be made in under 30 minutes)

A PC to work on

The server is going to be headless, typically you will want a PC so you can access the server remotely

An OS

I recommend Debian for better support and stuff.

But, there are many other OSes, typically you would want something that is stable, fast and secure by default (so, no windows).

At the time of writing this I am trying openBSD (which is not Linux), and i gotta say, its pretty good. Fast, stable and secure, but comes at the cost that some things may not work on it, but since I just want to host web, minecraft and email, its a great option, if not the best.

Cloudflare account

Cloudflare is king when it comes to setting up DNS records for the domain.

Go make your account at cloudflare

A domain

Again, cloudflare has stable prices, and then everything is setup.

There’s a lot of places where u can get a domain for about 5€ or even less, for a year. The drawback is that they will charge you a lot more for the following years.

Any tld will do (example: .com .net .sex), but keep in mind that some are more expensive than others.

The setup

Install an OS

Download ventoy, flash it on the USB drive and then put the .iso for the OS you picked on the USB drive. I will not teach you how to install Debian, its very simple you should figure it out on your own (doing stuff on your own is a good life skill XD). Just make sure you pick a minimal install without a DE (desktop environment).

For the sake of the guide I will assume you installed Debian and all commands I teach are going to be for Debian and might not work on other OSes, especially if you went for OpenBASED

Software setup

Install

The software you will want for this first setup is simply openssh. Install using the following command (for Debian):

sudo apt install openssh

Setup SSH

After installing openssh you will want to enable it and start it, for this you use the command:

sudo systemctl enable sshd

And also start it, with:

sudo systemctl start sshd

Note your local IP

After this extremely easy setup, note down your local IP, you can check it with the command:

ip addr

Your local IP starts with “192.168.” note it down on a piece of paper.

SSH into the machine

Using an ssh client like openssh or putty (if you are on windows), you can log into the terminal and access the files of your server remotely (as long as you are on the same connection). on openssh simply use the command ssh followed by your username, then a ‘@’ and the local IP that you definitely noted down. The command should look like bacalhau@192.168.1.69. run it and enter your password.

Host stuff!

At this point you should have a working server, with nothing hosted on it. On my next guide I will teach you how to setup a simple https website, so stay tuned and subscribe!

Updates:

12/10/2024 - minor editing