This tutorial will cover how to install Ubuntu server in minutes using a pre-configured Ubuntu dedicated server by Cherry Servers and set it up for production usage. To install Ubuntu manually, head over to the official Ubuntu download page.
Cherry Servers provides bare metal and virtual private (with shared or dedicated resources) server solutions.
What is Ubuntu?
Ubuntu is one of the most popular free open-source operating systems based on Debian-based Linux. Ubuntu server, its server-oriented product, provides a minimal stable system tailored for production environments. It comes with no GUI by default, and the most common drivers commonly used in Desktop environments are not included to favor performance.
How to install Ubuntu server
Ubuntu server comes with a wide variety of applications and services that can be easily installed. Those include applications to run your web and Internet servers, such as HTTP servers, database servers, game servers, email servers, DNS servers, and more.
What’s more, Ubuntu provides various installation images and supports ARM, POWER, RISC-V, and even IBM Z architectures. The installation can be done on bare metal (physical servers), virtual machines (VirtualBox, QEMU), or cloud computing providers such as Cherry servers, AWS, Google Cloud, and Azure.
In this tutorial, we will guide you through the installation of an Ubuntu server on Cherry Servers bare metal cloud (dedicated) server, getting the most out of the raw power of a physical server. Depending on workloads and server requirements, you can also opt for a virtual server and follow the same steps.
To follow along this tutorial, you will need the following:
- a Linux workstation from which you will connect the newly deployed server;
- a Cherry Servers account.
Step 1: Generate and upload SSH key
We will use an SSH key to connect to our server, as it is more secure than using a password and provides a passwordless login.
1. Generate SSH key pair
We will now generate an ssh key pair on your workstation, the computer you will use to connect to the server we are deploying.
Create a new key pair with the following command:
ssh-keygen -C "Cherry servers"
-C switch will add a comment in your key so that you can easily identify it later.
When prompted for a passphrase, leave empty and press
Enter for no passphrase.
Your keys are generated in
~.ssh/ by default.
2. Upload SSH key on Cherry Servers profile
Now that we have our SSH key, we will upload it to Cherry servers so that it can be deployed on the server that we will create.
Go to https://portal.cherryservers.com/settings/ssh-keys and click on
Add SSH key:
We can now copy/paste the content of our ssh public key,
Step 2: Install Ubuntu server
We will now install Ubuntu server on a dedicated bare-metal server.
1: Choose server
Cherry servers provide servers in different regions and models. In this tutorial, we will pick an Intel dedicated server in Lithuania with 8 cores and 32GB of RAM:
2: Select operating system
We will use the pre-configured Ubuntu server operating system provided by Cherry Servers. With this option, we can deploy a running system in less than 10 minutes.
3: Instance name and SSH key
Before deploying, we will change the name of the server instance and make sure that our SSH key has been selected for the deployment:
4. Deploy server and pay
Now that everything has been configured, we can deploy the server by clicking on
Pay & Deploy Now:
Step 3: Ubuntu server setup
Once the server is ready, we can proceed with the Ubuntu server setup. An email is sent to you with all the information needed to connect to the server via SSH. A KVM (Keyboard, Video, Mouse) access is also provided that allows full remote control of the physical server.
Connect via SSH using SSH key
We will now connect via ssh using the key we deployed earlier:
ssh root@<IP of server> -i ~/.ssh/id_rsa
<IP of server> with the IP that has been assigned to your server. You can find this IP either via Cherry Servers customer portal or via the email sent to you when the server was deployed.
Once logged in, you will get your root terminal access:
Note: If you have problems with connecting to the server, check here for more information.
Update system packages
The first thing to do is to update the packages list:
We then proceed to a system upgrade:
When asked about updating the sshd configuration, choose the default option:
Keep the local version
Proceed to a reboot to fully upgrade the server.
As we are using a dedicated physical server, you can also access the Remote KVM console to have full control of the reboot process:
Secure SSH connection
We will now secure the SSH by disabling Password authentication. Edit
/etc/ssh/sshd_config with your favorite editor and change
Save the modification and restart
systemctl restart ssh
You can also enforce the SSH security with Fail2Ban to prevent brute-force attacks
Create a new user
We will also create a new user with sudo privileges:
We now add the user to the sudo group:
usermod -aG sudo didier
Enable automatic updates
Automatic unattended updates are activated and started on Ubuntu. This will help make your server secure by installing security patches.
You can confirm if the service is running with the following command:
sudo systemctl status unattended-upgrades.service
In this tutorial, we have covered how to install Ubuntu server on Cherry servers dedicated bare-metal servers. We have also covered how to set up the server for a production environment. Having full control over the physical server gives you all the power to host your services online.