How to Change the Language to Ubuntu Server from Terminal, Console or SSH

Ubuntu Server is the version of Canonical’s operating system oriented to its use in servers, either in dedicated servers, VPS servers and even in servers in the Cloud. Depending on how you have done the installation, you may have Ubuntu Server in English, and you want to change it to Spanish easily and quickly, without the need to perform a complete reinstallation of the operating system. Once the server is installed, we can connect to it remotely via SSH, and start installing the packages we need and configuring them. Although it is possible to install a graphical environment, this is not recommended as it would significantly reduce the performance of the server by having many more packages loaded in memory.

Generally, during the installation of Ubuntu Server, the administrator will be asked about the language in which the system will be installed, with English being the default language. When we rent a dedicated server, the system will probably be in the language of the company’s origin. The most normal thing is to find an Ubuntu Server in English, and with the keyboard layout also in English, but some French server hosting services put it in French by default, with its corresponding keyboard layout.

Change the Language to Ubuntu Server

Today in this article we are going to teach you how to change the language of any version of Ubuntu Server to Spanish, and also how we can change the keyboard layout to our language, so as not to have any problem when entering via terminal or console locally.

Change the language of Ubuntu Server to Spanish

Taking into account that Ubuntu Server does not have a graphical user interface, and that we will normally use this operating system on a dedicated server, VPS or Cloud very far from us, the only way to manage it remotely and change the language to Spanish is to use SSH protocol, which is installed by default.

The first thing we must do is connect remotely to the Ubuntu Server of our dedicated server. Next, we execute the following command by console, either by SSH or directly in the local terminal itself:

sudo dpkg-reconfigure locales

When we execute this command, we will get a small language configuration wizard. In this wizard we will have to deselect the English language, and choose only the Spanish language that is indicated as es_ES.UTF-8. To select or deselect we must use the space bar to show us an asterisk. Now we go to “OK” and press enter.

We choose the default language of the operating system, in this case es_ES which is the only one we will have on the server. Once selected, click on «OK» and «Enter».

In these moments we will have changed the language to Spanish, we will have to restart the server for the changes to be applied correctly. When we return to the operating system, if we execute the following command we can verify that we actually have it in Spanish:

locale

In the past this process was much more tedious, because we had to edit different configuration files manually with a specific syntax, then apply the changes with the dpkg-reconfigure, and finally, restart the server. Now executing a simple command we can carry out the whole process with a really simple and friendly configuration wizard, without the need to edit any type of text file to change the language to Spanish.

As you have seen, now the process to follow is much simpler, and we can verify that we have it in Spanish by executing the command «locale» as we have explained.

Change Ubuntu Server keyboard layout to Spanish

Now that we have changed the language of the operating system to Spanish, we are going to change the keyboard layout. Via SSH we would not have problems because it preserves the original keyboard layout, but if we are going to enter the terminal locally in the operating system, then we will have problems if we have it in English, which is typical. In the past, changing the keyboard layout of any Linux operating system was quite tedious, editing different configuration files and having to restart the operating system to save the changes. Now, just by executing a command per terminal with root permissions and following the configuration wizard that Ubuntu Server will show us, we can do this process in minutes.

To quickly change the keyboard layout, we must execute the following command so that a configuration wizard appears:

sudo dpkg-reconfigure keyboard-configuration

When we run it, we will get a wizard where we will select the keyboard model, if we do not know it or it does not appear in the list, we leave the default option or one similar to our keyboard. Next, by default we have it in English, but we can easily change it to Spanish, going down to the «Spanish» section and selecting it, clicking OK to go to the next menu.

When we click on «Spanish», we must choose the first option that comes by default, although we have other possibilities as you can see in the photo gallery. We will also have the possibility to configure the ALT-GR key on our keyboard, and even the «FN» key that we have on some keyboards.

Once we have configured everything, it will indicate that the changes will be applied when restarting the server, therefore, we will have to execute the typical “sudo reboot” to restart it and we will be able to enjoy the Spanish keyboard layout.

As you have seen, changing the keyboard layout in an Ubuntu Server operating system is really simple, we simply had to execute a command and follow the configuration wizard that will appear directly in the terminal. This process can be done via SSH without any problem.

With this we will already have our Ubuntu Server in a language that we understand better and with which we can begin to manage the system more easily, in addition to being able to use our keyboard layout in Spanish, and not have problems with symbols such as colon, dashes and low bars, which in the English keyboard layout change radically and the use of the console can be complicated if we don’t put the keyboard in Spanish.