Server Selection
Before setting up a server, it’s important to choose the right server for your needs. There are several factors to consider when selecting a server, including:- Budget: Determine how much you can afford to spend on a server.
- Purpose: Decide what you want to use the server for, such as hosting a website, running a business, or running a development environment.
- Location: Choose a server that is close to your users and has good connectivity.
- Security: Ensure that the server is secure and protected against potential threats.
Server Configuration
Once you have chosen a server, you need to configure it properly. This involves setting up the server’s operating system, configuring the server’s network settings, and setting up any necessary software or applications.OS Configuration
The first step in configuring a server is to set up the operating system. This involves installing the operating system and any necessary software packages. Here are some steps to follow:Choose an operating system
Select an operating system that is compatible with your needs and budget. Some popular options include Ubuntu, CentOS, and Debian.
Update the operating system
Use a package manager like
apt or yum to update the operating system on the server.Configure the network settings
Set up the network settings, such as IP address, subnet mask, and gateway, to ensure that the server can communicate with other devices on the network.
Get an account on any cloud provider
We will use Linode as our cloud provider. Linode is a cloud hosting provider that offers a wide range of virtual private servers (VPS) with varying configurations and prices. It is a popular choice for hosting web applications and other types of software. Once the account is created, you can choose the plan that best suits your needs. The plan will determine the number of servers you can create, the amount of storage space available, and the price per month. Once the machine is created and up and running, you can connect to it using your terminal, in my case I am using warp terminal. You can use warp to connect to your machine and manage it remotely.apt update command before apt upgrade to ensure that you have the latest packages available.
Change password (optional)
Although most cloud providers offer a way to change the password of your machine directly from the control panel but in case you want to do it manually, you can use the following command:Add Non-root User
To add a non-root user, you can use the following command:groups command. After that, you can add the user to the sudoers group using the following command:
Connect to the server using SSH
Setting up SSH key on your machine is fairly easy and you need to do it once. You can generate it once as your machine identification and then you can use it to connect to the server. Here is a link to the official documentation on how to generate SSH keys on Linux and MacOS. Here are some simple steps to follow:.ssh in your home directory if it doesn’t already exist. Then create a new file called authorized_keys in the .ssh directory and paste the public key into the file.
Disable password login
After this, no one will be able to log in to your server using the username and password. Be careful with this.PasswordAuthentication and change it to no. Optionally, you can also change the PermitRootLogin to no to prevent root user from logging in.
Now, restart the ssh service using the following command:
Firewall Configuration
You can install firewall package to protect your server from external attacks. In my case I will use linode firewall that I can easily configure from the control panel. Some people prefer to use ufw (Uncomplicated Firewall) which is a simple and easy to use firewall. To install ufw, run the following command:Summary
In this tutorial, we have learned how to set up a server for hosting. We have covered topics such as server selection, server configuration, and server hardening.Next: Nginx Configuration
Continue your journey by learning how to install and configure Nginx on your server.

