When storing our website, using a hosting, we can take into account different options. One of them is to have a virtual private server, or better known as VPS . In this article we will explain what it consists of, as well as the first steps to configure it correctly. We will give some advice.
What is a VPS server
A VPS is one of the options that we will have when hiring a hosting and storing our website. It basically consists of receiving a part from a physical server. That server can be divided into multiple parts and each of them represents a virtual private server.

The physical server is the one that allocates the available resources. For example, it allows you to install an operating system and use it with some freedom. It is based on virtualization technology . It is a very interesting alternative to shared servers, since they are more secure and the user can have private resources.
We can say that it is an intermediate solution between a shared server and a dedicated server. It is ideal for a web page with a medium level traffic, without needing something more advanced and that would also be more expensive.

First steps with a VPS
When we start to use a VPS , it is important to carry out a series of initial steps. The objective is none other than to avoid problems and achieve optimal operation. We are going to explain some of the main actions that we must carry out.
Installing the operating system
One of the first steps will be to choose the operating system that our VPS will have. We can upload the ISO image and carry out the installation. Generally, our provider will offer us a wide range of possibilities, but we can highlight some of the main ones such as Ubuntu, Debian or CentOS.
Depending on the provider we have, they will also show us options regarding the version of the system that we want to install. Sometimes the most recent is not always the best option, since some users choose to choose one that takes longer and therefore a longer run-in to detect possible malfunctions. With the system already installed we will obtain an IP address to be able to access.
Connect via SSH
When we have the system installed and ready to go, we can connect via SSH. There we will have to put the user we have created and the password. We can use Putty, an SSH client that allows us to connect in Windows environments. So we can execute different commands necessary to manage the service in that VPS.
We will have to put the username, the hostname and the port to which it is going to connect. Later, it will ask us for the VPS password. In case we install a Debian-based system, the most used commands would be apt-get, cp, cd, mv, mkdir, apt, sudo or chmod, among others. So we can, for example, update the dependencies using sudo apt update or sudo apt upgrade.
We can also access from the terminal, where we would have to put the command ssh root @ IP_VPS. In “IP_VPS” we have to put the IP address of the service provider.
Change host name
Normally the host name that comes by default with a VPS server is often difficult to memorize. We can customize the name that is linked to the IP address of that server and thus facilitate its use. We can do this once we have accessed from the terminal. In addition, it must be taken into account that the root user is not secure, so it is advisable to have a different one.
Upgrade the system
When starting a VPS for the first time it is very important to perform a complete system update . We must have the latest version available, as well as all the packages that we are using. This will help us avoid vulnerabilities and also achieve the best possible performance.
It is important to keep the system updated at all times, so this process must be carried out periodically. This way we will correct small bugs that may arise or vulnerabilities that may compromise security.
We will have to run apt update && apt upgrade.
Create a user besides root
The first user that we can use is the administrator. However, it is interesting to create a user beyond root. We can also give you certain administrator privileges . This is useful to avoid problems with a bad configuration or mistakes that we could make.
To do this, you must execute the command adduser Name. In “Name” we will put what we want, which will be our user. It will also ask us to create a password. We can also give administrator rights to this user. in this case we would have to execute the command gpasswd -a Name sudo. Once again, we change “Name” to our username.
Set the date and time
The VPN server may not have the time set correctly. Ideally, we assign the time zone that corresponds to us. In this way we will not have any problem with the time and date on our server.
Install other utilities
We can add different utilities to our VPS server. These are tools that allow us to have different added features and functions. We can install those that we deem convenient and that will help usability.

Security measures in a VPS
We can also take into account some tips related to security . The idea is to have the server adequately protected, not to leave the door open to possible intruders and hackers who could carry out their attacks.
Use a firewall to restrict access by ports
A security measure that we can take into account in our VPS server is to use a firewall . In this way we will be able to restrict access to certain ports, so we will avoid unwanted access by possible intruders that compromise security.
UFW is a Linux tool that allows us to manage connections and act as a firewall. We can add it simply by sudo apt install ufw.
Change the default SSH port
By default the SSH port is 22. This means that hackers could carry out brute force attacks against that port. The advice is to change it for another, preferably one from 1000. Thus we avoid using another that is being used for other common services.
For example, we could change port 22 to port 8274. Anyone over 1000 would work for our goal.
Create a strong password
Of course we must create a password that is strong and complex for all users, apart from the administrator. It should have letters (uppercase and lowercase), numbers, and other special symbols. It must be unique and totally random. Ultimately it is the first security barrier to prevent anyone from accessing it.
Although we have generated one when creating a user or when installing the system, in the case of the administrator, it is convenient to change it periodically. Thus we will always have a secure password, which has not suffered any type of leak that could compromise access to our VPS.
Public key authentication
We can also use public key authentication . It is a technique that is more secure than traditional passwords. Generates a set of public and private keys.
What the server does is store the public key and it will use it to authenticate the private one, to which only the user will have access as a file on the computer. Once we configure public key authentication, we will need both the private key and a passphrase to log in, which increases security significantly. We can use, for example, PuTTYgen to generate SSH keys in Windows.
Secure SSH
Another security issue that we can take into account is to secure access through SSH. It basically consists of preventing access to our VPS by other means than by means of a public key, which we have already explained in the previous point why it is important. Of course, we must bear in mind that we must keep it safe and never lose it.
Logging in as root, in this case what we will do is edit the / etc / ssh / sshd_config file and change two values:
- PasswordAuthentication no
- PermitRootLogin no
With the first value what we do is disable access via SSH through password, so we can only enter with the public key. The second prevents root access.
Later we will put the command AllowUsers Name. Once again we put the corresponding username, which would be the one we have previously created.
Monitor the server
Another security tip that we can apply to our VPS server is to monitor it. In this way we will know at all times the consumption of resources that you are having. If we see a strange process, something that does not correspond to what it should, it could mean that there is a security problem.
In short, these are some basic steps that we can take when we start a VPS server. We have seen some essential configurations that we must carry out, as well as some improvements in terms of security, a very important factor to be able to properly protect our server.