
In our daily walk in the world of IT, we must at all times learn new trends, new programs and certainly have the ability to develop in different areas of systems. In this tutorial we will see the installation and configuration of a server with Ubuntu, but what What advantages can we get as administrators when installing a server with Ubuntu?
In this tutorial you can learn how to install the Server version of Ubuntu and thus manage our server. You will also know the steps to configure it easily and set it up to start using it at any time.
If you still don't know what it means to work with Ubuntu Server, here are some of its advantages so you know what it means to work with it.
Some advantages of installing Ubuntu Server
- It is certified to be a guest or guest server on Azure, AWS, IBM (power) platforms, among others.
- It has a full Kernel integration.
- Run on x86, x64, ARM v7, ARM 64 and Power architectures.
- Great support.
- Designed for the cloud, among others.
We will analyze how to perform the installation process of our Ubuntu server. As a first step we will go to the following official Ubuntu website, to proceed with the download of our ISO image .
OFFICIAL UBUNTU
Once there we will click on the Download tab, and choose Server, we will see the following:
1. Install Ubuntu Server
In this tutorial we will install on a virtual machine which allows us to simulate exactly the behavior of the Ubuntu server in real life, as we have said before, it is important to use virtual environments to familiarize ourselves with the environments before jumping into a productive environment with the In order to avoid mishaps.
Step 1
At the beginning of the installation we must choose the language with which our system will remain, in our case we choose Spanish, but we can see that we have different languages to choose from in Ubuntu Server, the default language is English since Ubuntu is distributed worldwide, we select Spanish moving with the arrow keys and we enter.
Options we have
As we see in the following window, we have different options to install or manage our Ubuntu, among which are:
Install Ubuntu Server
It allows us to execute an installation from scratch.
Installation of several servers with MAAS (Metal As A Service)
It gives us the possibility of simultaneously installing Ubuntu on several servers.
Check disk defects
It allows to run a review of possible failures in sectors of the hard disk.
Check memory
It gives us the possibility to run a test to the server RAM to check its operation.
Boot from the first hard drive
It allows you to start the system from the main hard disk in case you have several.
Recover a damaged system
It gives us the possibility of running a general test and trying to recover a system that presents some kind of error.
We choose the first option Install Ubuntu Server .
Step 2
We give Enter, then we choose the geographical area where we are located, this will allow us to immediately configure the time zone. In case the country where we are is not in the list we must choose the other option.
Step 3
Enter and then the system will indicate if we want to configure the keyboard, it is advisable to accept this proposal since it will allow us to configure and adjust the model of our keyboard automatically:
Step 4
We click Yes and press Enter . Then the following window will appear:
This configuration option asks us to press any of the displayed keys (and, u, r, n, etc), in our case we will press the n key, then it will ask us to press the w, as we indicate this is in order to optimize the distribution and correct configuration of the keyboard . We will press the w key.
$config[ads_text5] not foundNext step different questions will be displayed on some keys in particular, if our keyboard has them we will click Yes, otherwise we will press No.
Once we have made the different checks requested, the following window will be displayed confirming that everything was correct and giving us a guide of our keyboard “es” = Spanish .
$config[ads_text6] not foundStep 5
We will click on Continue and begin the process of downloading some additional components for proper installation.
Step 6
Once the add-ons have been downloaded, a window will be displayed requesting to enter the name that we will give to our Ubuntu server .
We choose the appropriate name and click on Continue .
Step 7
Next, we choose the name of the user who will have access to the administration of the server (User by default). Click Continue, and the system will request the username to access the system (It is a different user from the previous one).
Step 8
Click Continue and then enter the password :
Click on Continue and enter the password again (confirmation).
Step 9
We click on Continue . Next, the system asks us if we want to encrypt our personal folder, which is recommended if we have sensitive information since encryption generates greater security, but it can be a headache in case the system fails and we try to access our information In Ubuntu's opinion we will be intruders or hackers. In our case we choose No.
Step 10
Next, the system confirms our time zone based on the location we determined at the beginning of the installation, if it is correct, click Yes.
Step 11
Once we have selected yes, a series of questions about the server configuration will begin. Initially the system will ask us about the partitions that the hard disk will have:
Options we have
Guided-use the entire disk
It allows us to use the disk completely.
Guided-use the complete disk and configure LVM
$config[ads_text6] not foundIt allows us to use the complete and additional disk to configure the LVM (Logical Volume Management) for the respective partitions.
Guided-use the entire disk and configure encrypted LVM
It allows us to use the complete and additional disk to configure the LVM (Logical Volume Management) with an encryption system to protect the information.
Manual
It allows us to perform the entire process manually but it is not recommended.
In our case we will use the first option, Guided-use the entire disk . Once selected press the Enter key and the following window will be displayed:
We see that the information of the hard disk to be used is displayed, press Enter to continue the installation process. The following window is displayed indicating the partitions that will be created in our Ubuntu:
Note
The ext4 partition is similar to the NTFS in Windows and the swap partition has its exclusive space in Ubuntu so that the swap memory can write to it.
Click on the Yes option to write the changes. The following window will be displayed showing the progress of the installation of the base system:
Then the system will ask us if we want to configure the proxy, since it is not so usual, we will leave the field blank and click on Continue:
All apt packages (related to the network) will be downloaded and you will be asked how we want to configure the updates, we see that we have three (3) options:
Options
No automatic updates
It is recommended for servers as some updates may restart the server or cause instability behaviors on it.
Automatic Updates
Updates are installed automatically whenever there is any available.
Manage the system with Landscape
Allows you to manage updates through the Landscape tool.
We will choose the first option in our case, without automatic updates, click Continue (We will have to install the updates manually). Next, ask what features we want to add to our server, we have some like OpenSSH, Print Server, etc.
In our example we will enable the OpenSSH option to be able to manage the server remotely, to select it we place the cursor on that option and press the space bar to choose it.
$config[ads_text5] not foundThe functions of each option, in summary form are:
- OpenSSH : Remote Administration
- DNS Server : Domain Name Server
- LAMp Server : Web Server
- Mail Server : Mail Server
- PostgreSQL database : Database server
- Print Server : Print Server
- Samba File Server : File Sharing Server
- Tomcat Java Server : Java Server
- Virtual Machine Host : Virtual Machine Server
- Manual package selection : Manual package selection
We give Enter to continue our installation process. The system will ask us if we want to install the GRUB bootloader in the main register, remember that the GRUB (Grand Unifier Bootloader) is the first thing that is loaded when our server starts, therefore, we select the Yes option.
Note
If at any time you have problems with the GRUB, try visiting the following tutorial, you will have help to solve problems.
We continue with our installation and we will see that everything has been installed correctly:
We click Continue and we will be careful not to restart the server with the disk inside the drive so as not to repeat the entire installation process. As we see Ubuntu works under the command line which allows us to use the resources of the machine in installed applications.
We can see that once the machine is restarted, the access credentials already created during installation will be requested.
2. Connection via SSH with Ubuntu
Let's see how we connect through a secure SSH connection to our Ubuntu server. An SSH connection allows us to connect externally to our server. It is very important to remember that our Ubuntu server must be on the same network from which we want to connect.
We can see how the configuration of our network is found using the command:
ifconfigWhich displays a summary of it. In our case we see the IP address of our server s 192.168.0.10 and we can see the different network configurations.
To make the SSH connection from an external site we will use the Putty software which is free and can be downloaded from the official website. Here we leave a tutorial to see more about Putty. This software gives us the possibility to connect, it is basically a connection client for Linux.
To connect to our server through Putty we will do the following:
- In IP address we will place the exact IP of the Ubuntu server (In our case 192.168.0.10)
- We leave the default port (22)
- In connection type we select SSH
We click Open and the first time we run Putty a message will be displayed indicating that the server key is not registered in the cache, this is for security reasons, we can accept and the following window will open to enter credentials. Once we enter our password we will see that we can access our server as if we were in front of it.
$config[ads_text5] not foundThis will allow us to manage the physical server no matter where it is located.
3. Control options and parameters
The parameters allow us to configure the way the commands will behave on our Ubuntu server. For example, if we wanted to go to the root folder of the system to see its contents, we would normally use cd: and then again cd: (So we would download 2 folders), to save time we can use the symbol / which allows us to go to the root folder directly, the command would be cd / .
We will see that the command line is already located in the root of the system. Now if we want to return to the Solvetic personal folder we will not use cd home and then cd home, rather we will use the command:
cd / home / solveticAnd so we will go to the personal folder.$config[ads_text6] not found
If we wanted to see in a more organized way the folders located in the root, since normally they would look a bit messy. We can use the ls command with the -l parameter to view the folders in a more organized way ( ls -l ):
We will see that it shows us more specific details of each folder, such as size, creation date, etc.
We can see the different options we have to parameterize a command, for this we can use the following methods. We can use the following parameter:
ls -–helpWe will deploy the help of Linux where we can see the different options to add to it command, each option comes with its respective summary.
Another option we have is to use the man (manual) command, this command displays much more explicit information about each command. For example, we can use the following line:
man ls(It will show us the ls command manual). Remember that this option will take us out of the command line.$config[ads_text6] not found
We can develop within the manual using the up and down arrows. To return to the command line press the q key.
Here is a link to a tutorial with interesting commands for Ubuntu:
Ubuntu Commands
4. File and directory management in Ubuntu
As administrators at any time we have to manage the different files that we have on our server and it is important that we know how to do this process. We will review the process to create files and folders, but it is advisable not to create these within the Ubuntu root folder, the ideal is to create them within the personal folder.
Create folder
To create a folder within Ubuntu we will use the mkdir (Make Directory) command, in our example we will use the line:
mkdir TestsAnd press Enter . To verify that we have created the folder correctly, use the ls command and we will see our created folder and if we use (As we have already seen) the command:
ls -lWe will see a more complete summary of the newly created folder.
Note
The system is case sensitive, we can have two folders (Tests and tests).
Create file
To create a file we will use the touch command, the parameter is;
touch Extension_NameFor example, touch Exercise.txt . If we use ls -l we can see our document created.
Copy and paste options
To copy a file we will use the cp file (cp File name Destination path), in our case it would be, cp Exercise.txt Tests . To see that the file was correctly copied to the destination we will use the following process, let's use the command cd Destination folder name (cd Tests) once inside Tests we use the ls command to see the file we just copied.
With the mv command we can move a file or folder from one location to another, its syntax is identical to that of copying, mv Destination_file_name .
Here we leave a tutorial that talks about this.
Delete files and folders
To delete files : We will use the rm (remove) command, its syntax is rm Filename, in our example it would be rm Exercise.txt and we can see through ls -l that the file no longer exists in our Ubuntu system.
Below is an image with all the commands we have been commenting on:
To delete directories : We will use the rmdir command, the syntax would be rmdir Directory_Name, in our case, rmdir Tests and in this way we will delete the System Tests directory. We can use the ls -l command to verify that said directory no longer exists in Ubuntu:
In this way we have seen some of the options and configurations that we have on our Ubuntu server .
Rename Ubuntu files and directories
Articles